Disclosure of Invention
Therefore, the present invention aims to provide a method and an apparatus for transmitting data across a class of cross-domain, so as to alleviate the technical problem of low efficiency of the existing method for transmitting data across a class of cross-domain.
In a first aspect, an embodiment of the present invention provides a method for transmitting data across classes and network domains, which is applied to middleware of a source end, and includes: acquiring data to be transmitted sent by a source terminal, and constructing task codes of target transmission tasks based on multidimensional parameters of the data to be transmitted, wherein the target transmission tasks are tasks for transmitting the data to be transmitted, and the multidimensional parameters comprise: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter; constructing a data packet of the target transmission task based on the data to be transmitted, and constructing a header file based on the task code, the data packet of the target transmission task and a preset header file template; adding the target transmission task to a task list to obtain a target task list, and sequencing the transmission tasks in the target task list based on a heap sequencing algorithm to obtain a sequencing result; determining a current transmission task based on the sequencing result, encrypting a header file of the current transmission task, and obtaining an encrypted header file; based on the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, sending the encrypted header file and the data packet of the current transmission task to the target end, wherein the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task comprises the following steps: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different levels of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains.
Further, the preset header file template includes: task coding, task names, task execution states, dimension information, transmission priority scores, data packet information and log information; the calculation formula of the transmission priority score is as follows:wherein->For the transmission priority score, +.>For the multidimensional parameter of the data to be transmitted +.>Priority parameters of individual dimension parameters, +.>Is->Corresponding weight values.
Further, based on the data to be transmitted, constructing a data packet of the target transmission task, including: compressing the data to be transmitted to obtain a compressed packet; if the data volume of the compressed packet is larger than the preset data volume, the compressed packet is segmented to obtain a plurality of sub-compressed packets, and the plurality of sub-compressed packets are determined to be the data packets of the target transmission task, wherein the number of the sub-compressed packets is smaller than the preset data volume; and if the data volume of the compressed packet is smaller than or equal to the preset data volume, determining the sub-compressed packet as the data packet of the target transmission task.
Further, based on a heap ordering algorithm, ordering the transmission tasks in the target task list to obtain an ordering result, including: a first sorting step of sorting the transmission priority scores of the transmission tasks in the target task list from small to large to obtain an initial sorting result; a second sorting step, namely sorting the initial transmission tasks based on priority parameters of target dimension parameters of the initial transmission tasks if the transmission tasks in the target task list comprise the initial transmission tasks, so as to obtain an intermediate sorting result, wherein the initial transmission tasks are transmission tasks with the same transmission priority scores, and the target dimension parameters are dimension parameters with the largest weight values in the multidimensional parameters; and determining the initial transmission task as a transmission task in the target task list, determining the dimension parameters except the target dimension parameter in the multidimensional parameter as the target dimension parameter, repeatedly executing the second sorting step until the transmission task in the target task list does not contain the initial transmission task, and updating the initial sorting result by utilizing the intermediate sorting result to obtain the sorting result.
Further, sending the encrypted header file and the data packet of the current transmission task to the target end, including: if the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of the same network domain and of different grades, sending the encrypted header file and the data packet of the current transmission task to the middleware of the target end corresponding to the current transmission task through the middleware of the source end; if the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains, sending the encrypted header file and the data packet of the current transmission task to middleware of the target end corresponding to the current transmission task through a network gate; after receiving the encrypted header file and the data packet of the current transmission task, the middleware of the target end processes the data packet of the current transmission task by utilizing the encrypted header file to obtain transmission data of the current transmission task, and writes the transmission data of the current transmission task into a database corresponding to the target end corresponding to the current transmission task.
Further, processing the data packet of the current transmission task by using the encrypted header file to obtain transmission data of the current transmission task, including: decrypting the encrypted header file to obtain the header file of the current transmission task; based on the header file of the current transmission task, checking the integrity of the data packet of the current transmission task; if the data packet passing the test and the current transmission task comprises a plurality of sub-compression packets, merging and decompressing the data packet of the current transmission task to obtain the transmission data of the current transmission task.
In a second aspect, an embodiment of the present invention further provides a cross-class cross-network domain data transmission device, including: the system comprises an acquisition unit, a transmission unit and a transmission unit, wherein the acquisition unit is used for acquiring data to be transmitted sent by a source end, and constructing task codes of target transmission tasks based on multidimensional parameters of the data to be transmitted, wherein the target transmission tasks are tasks for transmitting the data to be transmitted, and the multidimensional parameters comprise: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter; the construction unit is used for constructing a data packet of the target transmission task based on the data to be transmitted and constructing a header file based on the task code, the data packet of the target transmission task and a preset header file template; the sorting unit is used for adding the target transmission task to a task list to obtain a target task list, and sorting the transmission tasks in the target task list based on a heap sorting algorithm to obtain a sorting result; the encryption unit is used for determining a current transmission task based on the sequencing result, encrypting the header file of the current transmission task and obtaining an encrypted header file; the transmission unit is configured to send the encrypted header file and the data packet of the current transmission task to the target end based on a correspondence between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, where the correspondence between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task includes: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different levels of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains.
Further, the preset header file template includes: task coding, task names, task execution states, dimension information, transmission priority scores, data packet information and log information; the calculation formula of the transmission priority score is as follows:wherein->For the transmission priority score, +.>For the multidimensional parameter of the data to be transmitted +.>Priority parameters of individual dimension parameters, +.>Is->Corresponding weight values.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory is configured to store a program for supporting the processor to execute the method described in the first aspect, and the processor is configured to execute the program stored in the memory.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon.
In the embodiment of the invention, task codes of target transmission tasks are constructed by acquiring data to be transmitted sent by a source terminal and based on multidimensional parameters of the data to be transmitted, wherein the target transmission tasks are tasks for transmitting the data to be transmitted, and the multidimensional parameters comprise: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter; constructing a data packet of the target transmission task based on the data to be transmitted, and constructing a header file based on the task code, the data packet of the target transmission task and a preset header file template; adding the target transmission task to a task list to obtain a target task list, and sequencing the transmission tasks in the target task list based on a heap sequencing algorithm to obtain a sequencing result; determining a current transmission task based on the sequencing result, encrypting a header file of the current transmission task, and obtaining an encrypted header file; based on the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, sending the encrypted header file and the data packet of the current transmission task to the target end, wherein the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task comprises the following steps: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different grades of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains, so that the aim of cross-grade cross-domain data transmission by utilizing middleware is fulfilled, the technical problem that the existing cross-grade cross-domain data transmission method is low in efficiency is solved, and the technical effect of improving the cross-grade cross-domain data transmission efficiency is achieved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment one:
in accordance with an embodiment of the present invention, there is provided an embodiment of a method of data transmission across a hierarchical cross-domain, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
Fig. 1 is a flowchart of a method for transmitting data across classes and network domains according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
Step S102, obtaining data to be transmitted sent by a source end, and constructing task codes of target transmission tasks based on multidimensional parameters of the data to be transmitted, wherein the target transmission tasks are tasks for transmitting the data to be transmitted, and the multidimensional parameters comprise: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter;
step S104, constructing a data packet of the target transmission task based on the data to be transmitted, and constructing a header file based on the task code, the data packet of the target transmission task and a preset header file template;
step S106, adding the target transmission task to a task list to obtain a target task list, and sequencing the transmission tasks in the target task list based on a heap sequencing algorithm to obtain a sequencing result;
step S108, determining a current transmission task based on the sequencing result, and encrypting a header file of the current transmission task to obtain an encrypted header file;
step S110, based on a correspondence between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, sending the encrypted header file and the data packet of the current transmission task to the target end, where the correspondence between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task includes: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different levels of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains.
In the embodiment of the invention, task codes of target transmission tasks are constructed by acquiring data to be transmitted sent by a source terminal and based on multidimensional parameters of the data to be transmitted, wherein the target transmission tasks are tasks for transmitting the data to be transmitted, and the multidimensional parameters comprise: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter; constructing a data packet of the target transmission task based on the data to be transmitted, and constructing a header file based on the task code, the data packet of the target transmission task and a preset header file template; adding the target transmission task to a task list to obtain a target task list, and sequencing the transmission tasks in the target task list based on a heap sequencing algorithm to obtain a sequencing result; determining a current transmission task based on the sequencing result, encrypting a header file of the current transmission task, and obtaining an encrypted header file; based on the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, sending the encrypted header file and the data packet of the current transmission task to the target end, wherein the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task comprises the following steps: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different grades of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains, so that the aim of cross-grade cross-domain data transmission by utilizing middleware is fulfilled, the technical problem that the existing cross-grade cross-domain data transmission method is low in efficiency is solved, and the technical effect of improving the cross-grade cross-domain data transmission efficiency is achieved.
The above-described multidimensional parameters are described below.
The task code is formed by splicing 9 dimension parameters, each dimension is identified by a division of '_', and the code assignment rule is as follows: the system dimension parameter (source-target) _space dimension parameter (source-target) _service dimension parameter_data type dimension parameter_data update dimension parameter_role dimension parameter_time dimension parameter.
Task coding example: C-C_P-P_03-01_371300-371300_ DZ.TDLYXZ.TDLYXZ2018_2_UP_1_20210709161317. The task code is used as a global unique identification to distinguish different data transmission tasks.
The 9 dimensions of the middleware in the embodiment of the invention are defined as follows, chinese and English are names of the dimensions, and then codes of the dimensions are listed.
The rank dimension (gradeCode) parameters include four levels of country, province, city, county, and corresponding codes are A, B, C, D, respectively.
The network dimension (network code) parameter includes three network domains, namely private network, government external network and internet, and the corresponding codes are P, G, I.
The system dimension (system code) parameter mainly refers to various systems with data mounting, and other systems can be supplemented according to actual conditions.
For example, codes corresponding to the complete life cycle data integration system and the database communication software are 01, 02, 03 and 04 respectively for the national space basic information platform, the national space one-piece graph implementation supervision information system and the development protection current situation assessment.
The space dimension (spaceCode) parameter is divided by administrative region and may be encoded by administrative region codes.
The business dimension (business code) parameter is defined according to the business database which needs communication and data transmission. Taking management functions and business rules of departments related to natural resource information resource planning as examples, the related data are encoded, and the design is carried out according to five major categories of ground administration, ore administration, administrative measurement, administrative regulation and other.
As described in the following table:
| class I class | Second class | Three-level class (element set) | Class IV (element class) | Encoding | Remarks |
| Special land industry | | | | dz | |
| Present of land use | | | tdlyxz | |
| | Present of land use | | tdlyxz[*] | * Indicating the addition of year information to the next |
| | | Map spots of ground type | dltb | dz.tdlyxz.tdlyxz[*].dltb |
| Construction land approval | | | jsydsp | |
| | Construction land approval data | | jsydspsj | dz. jsydsp.jsydspsj |
| Geological mineral production specialty | | | | kz | |
| Mineral geology | | | kcdz | |
| | Mineral resource distribution | | kczyfb | kz.kcdz.kczyfb |
| | Mineral resource development and utilization | | kczykfly | kz.kcdz. kczykfly |
| | Status quo of mineral resources | | kczyxz | kz.kcdz. kczyxz |
| Special surveying and mapping industry | | | | cz | |
| Basic mapping | | | chjc | |
| Space planning | | | | gh | |
| Overall planning | | | ztgh | |
| | | | | |
| Detailed planning | | | xxgh | |
| | | | | |
| Private planning | | | zxgh | |
| | | | | |
| Comprehensive class | | | | zh | |
| Comprehensive statistics | | | zhtj | |
The data type (datatype) parameter is divided according to different data types, and mainly comprises spatial data and non-spatial data, wherein the classification is because the data mounting modes adopted by the different data types are different. Wherein, the codes corresponding to the attribute data, the space data, the unstructured data and other data are respectively 1, 2, 3 and 4.
The data update (updateTypeCode) parameter mainly characterizes both the update and the revocation operations. For the data update operation, the data update frequency is considered, and the time point data update and the temporal data update are mainly included. The time point data update can be performed at regular time or manually triggered, and the time state data is automatically updated in near real time. The corresponding codes of time point data update, temporal data (near) real-time automatic update and data withdrawal are UP, UT and R respectively.
Role dimension (roleCode) parameters mainly characterize the role names that a specific operator who has undergone a data change has. And in the data mounting process, character information of key links is mainly recorded, wherein the character information comprises examination, auditing and approval, and the corresponding codes are respectively 1, 2 and 3.
The time dimension (version) parameter mainly characterizes time information when data change, and is specifically recorded to date and time minutes and seconds, and the corresponding coding format is "yyyMMddHHHmms", such as "20200615165602".
The specific format of the header file is described below:
the preset header file template comprises the following steps: task coding, task names, task execution states, dimension information, transmission priority scores, data packet information and log information.
{
"taskCode": ",// task code
"taskName": ",// task name
Status ":",// task execution status, process: in execution, SUCCESS: successful execution, FAIL: execution failure
"createTime": ",// task creation time
"dimensions" [ {// dimension information, 9 sets of values, make up a set of values
"name": "networkCode",// dimension name
The value is P-P, the value of the dimension value is/is assigned, the latitude value assignment method is the same as that of each section of codes in the step 1, and if the transmission direction is required to be represented, the assignment method is source end code-target end code "
"priority": "988",// dimension priority
Weight is 300, weight of the same dimension is kept unchanged for different tasks
},
...],
"priority": ",// priority score
"blockInfo" {// packet info
"fileName": "dltb",// file name
"fileSize":535801019,// File Total size, units Byte
"md5": 8c0391ec3c757d5985c76b8c08b5766b "// file md5 code
},
"logs [ {// log information ]
"taskCode": ",// task code
"stepCode": ",// current execution phase encoding
"status": "// 0: failure (default), 1: success of
"message": "// log information
"startTime": ",// current phase start time, localDateTime type
"complexetime": "// current phase end time, localDateTime type
},
...
]
}
In the embodiment of the present invention, step S104 includes the following steps:
compressing the data to be transmitted to obtain a compressed packet;
if the data volume of the compressed packet is larger than the preset data volume, the compressed packet is segmented to obtain a plurality of sub-compressed packets, and the plurality of sub-compressed packets are determined to be the data packets of the target transmission task, wherein the number of the sub-compressed packets is smaller than the preset data volume;
and if the data volume of the compressed packet is smaller than or equal to the preset data volume, determining the sub-compressed packet as the data packet of the target transmission task.
In the embodiment of the invention, the middleware periodically polls and searches the communication task with dimension maintenance completed through the shared block query interface, reads the data packet and the header file in the shared block to the designated path of the local disk through the shared block reading interface, and names the file folder as the communication task code. The data packet preprocessing is carried out according to the size of the data packet and the condition of network resources, and the preprocessing steps are as follows:
Acquiring the upper limit (i.e. the preset data amount) of the data packet according to the configuration file, wherein the upper limit is adjustable but is required to be an integer multiple of 1 MB;
acquiring a congestion window of a network target end, and determining the size of a transmission data stream, wherein the transmission of the data stream is an integer multiple of 64 KB;
compressing all folders under the task folder, and caching the compressed packets to a memory;
judging the size of the compressed packet: if the data quantity of the compressed packet is less than or equal to the upper limit of the data packet, directly writing the compressed packet into a path to be transmitted; if the compressed packet is greater than the upper limit of the data packet, dividing the compressed packet stream in the memory according to the byte stream sequence to obtain a plurality of sub-compressed packets, wherein the size of the sub-compressed packets does not exceed the upper limit;
and after all the sub-compression packets are written into the folder to be transmitted, updating the segmented data packet information to the header file.
And adding the information such as the starting time, the ending time, the execution result state, the execution log and the like of the step of generating the communication data packet into the log information array of the header file.
And finally, writing the header file into the folder to be transmitted.
In the embodiment of the present invention, step S106 includes the following steps:
a first sorting step of sorting the transmission priority scores of the transmission tasks in the target task list from small to large to obtain an initial sorting result;
A second sorting step, namely sorting the initial transmission tasks based on priority parameters of target dimension parameters of the initial transmission tasks if the transmission tasks in the target task list comprise the initial transmission tasks, so as to obtain an intermediate sorting result, wherein the initial transmission tasks are transmission tasks with the same transmission priority scores, and the target dimension parameters are dimension parameters with the largest weight values in the multidimensional parameters;
and determining the initial transmission task as a transmission task in the target task list, determining the dimension parameters except the target dimension parameter in the multidimensional parameter as the target dimension parameter, repeatedly executing the second sorting step until the transmission task in the target task list does not contain the initial transmission task, and updating the initial sorting result by utilizing the intermediate sorting result to obtain the sorting result.
Step S108 is described below:
cloud tenants among different levels or network domains create a key pair, and when the key pair is used for data transmission, the data communication header file is encrypted and decrypted.
And the middleware of the source end encrypts the data communication header file by using the public key in the key pair. The middleware adopts a national encryption SM2 algorithm, SM2 is asymmetric encryption and is based on ECC. The algorithm is disclosed. Because the algorithm is based on ECC, the signature speed and the key generation speed are faster than RSA. The security intensity of the ECC 256 bits (SM 2 is one of the 256 bits of the ECC) is higher than that of RSA 2048 bits, and the operation speed is faster than that of RSA.
In the embodiment of the present invention, step S110 includes the following steps:
if the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of the same network domain and of different grades, sending the encrypted header file and the data packet of the current transmission task to the middleware of the target end corresponding to the current transmission task through the middleware of the source end;
if the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains, sending the encrypted header file and the data packet of the current transmission task to middleware of the target end corresponding to the current transmission task through a network gate;
after receiving the encrypted header file and the data packet of the current transmission task, the middleware of the target end processes the data packet of the current transmission task by utilizing the encrypted header file to obtain transmission data of the current transmission task, and writes the transmission data of the current transmission task into a database for the target end corresponding to the current transmission task.
Specifically, the encrypted header file is used for processing the data packet of the current transmission task to obtain the transmission data of the current transmission task, and the method comprises the following steps:
Decrypting the encrypted header file to obtain the header file of the current transmission task;
based on the header file of the current transmission task, checking the integrity of the data packet of the current transmission task;
if the data packet passing the test and the current transmission task comprises a plurality of sub-compression packets, the data packet of the current transmission task is combined and decompressed to obtain the transmission data of the current transmission task.
In the embodiment of the invention, the data packet corresponding to the source task list and the encrypted header file are sent to the target local disk according to the sequence. When the source end and the target end are in different grades in the same network domain, the data transmission interfaces of the middleware are used, and when the source end and the target end are in different network domains, transmission is carried out through a network gate. In order to facilitate management and maintenance, the to-be-transmitted directory of the same network domain and the trans-network-domain transmission directory are two different folders.
And checking the target node before starting transmission, confirming whether the target node is reachable, starting transmission if the target node is normal, otherwise, searching again every 10 minutes, and sending an alarm if the target node is not found yet after the maximum retry number is exceeded.
And starting transmission according to the task list sequence, if the transmission of the data packet of the current transmission task fails, automatically retrying, wherein the time interval of each retry is 5 minutes, and if the retry still fails for more than 5 times, alarming. The transmission process is executed by a plurality of threads in parallel, and the number of threads can be adjusted through configuration.
After the data packet of one data transmission task is transmitted, the state is updated to the header file in the shared disk, and after the transmission is finished, the header state code and log information of the source end are updated.
And monitoring the shared disk root directory of the target end by adopting a polling mechanism, and polling every 5 seconds. When a new data communication task folder is found, searching the encrypted header file, decrypting by adopting a private key corresponding to the source end encryption public key after receiving the encrypted header file, and if the decryption fails, indicating that the file transmission fails or is tampered, sending an alarm and terminating the data transmission process.
If decryption is successful, after the decrypted header file is obtained, checking whether the data packet is received completely according to the data packet information in the header, if the data packet is incomplete, executing the step circularly once every 5 seconds until all the data packets are obtained completely, if the data packet is not received completely for more than 30 minutes, sending out alarm information, terminating the data communication flow, and synchronizing the task communication state back to the source end;
If the data packet is received, verifying whether the md5 code of each data packet is consistent with the information in the header;
if all md5 codes are consistent, starting to combine all sub-compression packets;
after merging, checking the compressed packet again, and if the md5 code of the merged compressed packet is still the same as the stored information in the header, starting a decompression process;
after decompression is finished, a receiver of the target system is judged according to the dimension information in the header, the target receiving system is informed to start receiving data, and the target system receives the data and writes the data into a corresponding database.
In the embodiment of the invention, under the condition of cross-domain transmission, compared with a method for sharing through each system interface, the network gate only needs to be provided with an output port and an input port respectively at a source end and a target end to be in butt joint with the middleware, and a data distribution task is accepted by the middleware, so that the management of the network gate is more standard, and meanwhile, the operation and maintenance work of the network gate is lightened;
under the condition of cross-grade transmission of the same network domain, compared with a method for sharing through various system interfaces, the maximum complexity of the database structure investigation is reduced to M+N, and each system only needs to be in butt joint with the middleware;
when a new system construction requirement exists and data sharing is involved, other related systems do not need to be studied, only the middleware is needed to be in butt joint, and repeated workload is saved;
The data transmission can be checked, the whole link can be tracked, and the safety and the reliability of the data are fully ensured.
Embodiment two:
the embodiment of the invention also provides a cross-grade cross-network domain data transmission device, which is used for executing the cross-grade cross-network domain data transmission method provided by the embodiment of the invention, and the following is a specific introduction of the cross-grade cross-network domain data transmission device provided by the embodiment of the invention.
As shown in fig. 2, fig. 2 is a schematic diagram of the above-mentioned cross-class cross-domain data transmission device, where the cross-class cross-domain data transmission device includes:
the acquiring unit 10 is configured to acquire data to be transmitted sent by a source end, and construct a task code of a target transmission task based on multidimensional parameters of the data to be transmitted, where the target transmission task is a task for transmitting the data to be transmitted, and the multidimensional parameters include: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter;
the construction unit 20 is configured to construct a data packet of the target transmission task based on the data to be transmitted, and construct a header file based on the task code, the data packet of the target transmission task, and a preset header file template;
The sorting unit 30 is configured to add the target transmission task to a task list to obtain a target task list, and sort the transmission tasks in the target task list based on a heap sorting algorithm to obtain a sorting result;
an encryption unit 40, configured to determine a current transmission task based on the sorting result, encrypt a header file of the current transmission task, and obtain an encrypted header file;
the transmission unit 50 is configured to send the encrypted header file and the data packet of the current transmission task to the target end based on a correspondence between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, where the correspondence between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task includes: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different levels of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains.
In the embodiment of the invention, task codes of target transmission tasks are constructed by acquiring data to be transmitted sent by a source terminal and based on multidimensional parameters of the data to be transmitted, wherein the target transmission tasks are tasks for transmitting the data to be transmitted, and the multidimensional parameters comprise: the system comprises a grade dimension parameter, a network dimension parameter, a system dimension parameter, a space dimension parameter, a service dimension parameter, a data type dimension parameter, a data update dimension parameter, a role dimension parameter and a time dimension parameter; constructing a data packet of the target transmission task based on the data to be transmitted, and constructing a header file based on the task code, the data packet of the target transmission task and a preset header file template; adding the target transmission task to a task list to obtain a target task list, and sequencing the transmission tasks in the target task list based on a heap sequencing algorithm to obtain a sequencing result; determining a current transmission task based on the sequencing result, encrypting a header file of the current transmission task, and obtaining an encrypted header file; based on the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task, sending the encrypted header file and the data packet of the current transmission task to the target end, wherein the corresponding relation between the source end corresponding to the current transmission task and the target end corresponding to the current transmission task comprises the following steps: the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different grades of the same network domain, and the source end corresponding to the current transmission task and the target end corresponding to the current transmission task are two ends of different network domains, so that the aim of cross-grade cross-domain data transmission by utilizing middleware is fulfilled, the technical problem that the existing cross-grade cross-domain data transmission method is low in efficiency is solved, and the technical effect of improving the cross-grade cross-domain data transmission efficiency is achieved.
Embodiment III:
an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory is configured to store a program that supports the processor to execute the method described in the first embodiment, and the processor is configured to execute the program stored in the memory.
Referring to fig. 3, an embodiment of the present invention further provides an electronic device 100, including: a processor 60, a memory 61, a bus 62 and a communication interface 63, the processor 60, the communication interface 63 and the memory 61 being connected by the bus 62; the processor 60 is arranged to execute executable modules, such as computer programs, stored in the memory 61.
The memory 61 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is achieved via at least one communication interface 63 (which may be wired or wireless), and may use the internet, a wide area network, a local network, a metropolitan area network, etc.
Bus 62 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 3, but not only one bus or type of bus.
The memory 61 is configured to store a program, and the processor 60 executes the program after receiving an execution instruction, and the method executed by the apparatus for flow defining disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 60 or implemented by the processor 60.
The processor 60 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in the processor 60. The processor 60 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a digital signal processor (Digital Signal Processing, DSP for short), application specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 61 and the processor 60 reads the information in the memory 61 and in combination with its hardware performs the steps of the method described above.
Embodiment four:
the embodiment of the invention also provides a computer readable storage medium, and a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the method in the first embodiment are executed.
In addition, in the description of embodiments of the present invention, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.