Data cross-network transmission method and device based on MQ message queue, and medium
Through data encapsulation and encryption processing based on MQ message queue, the problems of low efficiency, poor stability and security risks in traditional data transmission methods are solved, and efficient, reliable and secure data transmission across networks is achieved.
Patent Information
- Application Number
- CN202410387910.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2024-08-30
AI Technical Summary
Traditional data transmission methods are inefficient and unstable in scenarios with large amounts of data and high concurrency, and lack effective error handling and security mechanisms, resulting in unstable data transmission and security risks.
Using the data cross-network transmission method based on MQ message queue, the data is encapsulated into MQ messages through preset data encapsulation rules and encryption rules, and is encrypted and decrypted in the MQ server to achieve identity authentication and integrity verification. Ensure the security and stability of data during transmission.
It improves the efficiency and stability of data transmission, reduces system waiting time and resource consumption, enhances data security, and avoids data loss and security risks.
Smart Images

Figure CN118573391A
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, and medium for cross-network data transmission based on an MQ message queue. Background Art
[0002] In computer networks, data transmission plays a vital role as a bridge for information exchange between systems. However, while traditional data transmission methods, such as Socket programming and HTTP requests, meet basic information exchange needs to a certain extent, their limitations are becoming increasingly apparent in the face of increasingly complex and diverse network environments.
[0003] First, let's consider the issue of transmission efficiency. Traditional data transmission methods are often limited by the design and implementation of underlying protocols, resulting in significant transmission efficiency degradation in scenarios with large data volumes and high concurrency. This not only prolongs data transmission time but also increases system latency and resource consumption, impacting overall system performance. Secondly, stability is also a major challenge facing traditional data transmission methods. Complex and volatile network environments, such as network latency, packet loss, and jitter, can lead to unstable data transmission. Traditional data transmission methods often lack effective error handling and retransmission mechanisms. Network issues can lead to data loss or transmission failures, disrupting normal business operations. Finally, security is also a critical issue. With the increasing number of network security threats, data security is becoming increasingly important. Traditional data transmission methods often lack data encryption and authentication mechanisms, making data vulnerable to theft or tampering during transmission, posing serious security risks to businesses. Therefore, effectively addressing the inefficiency, poor stability, and security risks inherent in traditional data transmission methods has become a pressing technical challenge. Summary of the Invention
[0004] The embodiments of the present application provide a method, device and medium for cross-network data transmission based on MQ message queues to solve the following technical problems: how to solve the problems of low efficiency, poor stability and security risks in traditional data transmission methods.
[0005] In the first aspect, an embodiment of the present application provides a method for cross-network data transmission based on an MQ message queue, characterized in that the method includes: based on a preset data encapsulation rule, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server; based on a preset encryption rule, the MQ server encrypts the MQ message to be transmitted, and sends a data reception verification request to the data receiver; based on the data reception verification request, the data receiver sends a decryption request to the MQ server, and sends an identity authentication request to the data sender; if the verification is passed, the MQ server sends the MQ message to be transmitted to the data receiver.
[0006] In one implementation of the present application, the MQ message to be transmitted includes: data packet header information, database operation header information, file data header information, return information, and database table header information; the data packet header information includes: data type, checksum, sender code, receiver code, center code, data ID, and data length; the database operation header information includes: indicating the database operation mode, table number, and spare field; the file data header information includes: file name, file data, data length, and spare field; the return information includes: return type, flag, file name, and table code; the database table header information includes: table code, data length, number of records, and number of fields.
[0007] In one implementation of the present application, based on a preset encryption rule, the MQ server encrypts the MQ message to be transmitted, specifically including: based on a preset key length, generating a key to be applied through a preset key generation algorithm, and storing the key to be applied; filling the MQ message to be transmitted with plaintext based on a preset filling function, and encrypting the data to be transmitted in the MQ message to be transmitted after filling the plaintext through the key to be applied.
[0008] In one implementation of the present application, a data sender is connected to an MQ server through a first network; sending an MQ message to be transmitted to the MQ server specifically includes: the data sender sends the MQ message to be transmitted to a designated port of the MQ server based on a preset first transmission protocol through the first network; the MQ server listens to the designated port, and when the MQ message to be transmitted is listened to, the MQ message to be transmitted is stored in a local MQ message queue.
[0009] In one implementation of the present application, after the data recipient sends a decryption application to the MQ server based on the data reception verification request, the method also includes: the MQ server decrypts the encrypted MQ message to be transmitted based on the key to be applied, specifically including: the MQ server parses the decryption application to determine the receiver code of the data recipient, and matches the MQ message to be transmitted in the local MQ message queue based on the receiver code; based on the MQ message to be transmitted, queries the corresponding key to be applied in the MQ server to decrypt the encrypted MQ message to be transmitted based on the key to be applied.
[0010] In one implementation of the present application, the data sender and the data receiver are connected via a second network; after sending an identity authentication request to the data sender, the method further includes: based on the identity authentication request, the data sender authenticates the data receiver through preset identity authentication rules, specifically including: the data sender receives the identity authentication request and parses the identity information of the data receiver; based on the identity information and the preset identity authentication rules, authenticates the data receiver; if the verification is successful, sends an identity authentication success response to the data receiver, otherwise sends an identity authentication failure response.
[0011] In one implementation of the present application, the data recipient is connected to the MQ server via a third network; the MQ server sends the MQ message to be transmitted to the data recipient, specifically including: the MQ server sends the MQ message to be transmitted to the designated receiving port of the data recipient based on a preset second transmission protocol via the third network connection; the data recipient listens to the designated receiving port, and when the MQ message to be transmitted is listened to, reads the MQ message to be transmitted.
[0012] In one implementation of the present application, after the MQ server sends the MQ message to be transmitted to the data recipient, the method also includes: the data recipient performs an integrity check on the received MQ message to be transmitted to confirm whether the MQ message to be transmitted has been tampered with during the transmission process; if the MQ message to be transmitted passes the integrity check, a successful reception feedback is sent to the data sender and / or the MQ server; if the MQ message to be transmitted fails to pass the integrity check, the data recipient discards the MQ message to be transmitted and sends an error feedback to the data sender and / or the MQ server.
[0013] In the second aspect, an embodiment of the present application also provides a data cross-network transmission device based on an MQ message queue, characterized in that the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can: based on preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server; based on preset encryption rules, the MQ server encrypts the MQ message to be transmitted, and sends a data reception verification request to the data recipient; based on the data reception verification request, the data recipient sends a decryption request to the MQ server, and sends an identity authentication request to the data sender; if the verification is passed, the MQ server sends the MQ message to be transmitted to the data recipient.
[0014] On the third aspect, an embodiment of the present application also provides a non-volatile computer storage medium for cross-network transmission of data based on an MQ message queue, which stores computer executable instructions, and is characterized in that the computer executable instructions are set to: based on preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server; based on preset encryption rules, the MQ server encrypts the MQ message to be transmitted, and sends a data reception verification request to the data recipient; the data recipient sends a decryption request to the MQ server based on the data reception verification request, and sends an identity authentication request to the data sender; if the verification is passed, the MQ server sends the MQ message to be transmitted to the data recipient.
[0015] The embodiments of the present application provide a data cross-network transmission method, device and medium based on MQ message queue, which realizes efficient, reliable and secure data transmission between different network nodes by using MQ technology. The method includes the steps of sending, receiving, processing and feedback of messages, and can effectively solve the problems of low efficiency, poor stability and security risks in traditional data transmission methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 A flow chart of a data cross-network transmission method based on MQ message queues provided in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of the internal structure of a data cross-network transmission device based on an MQ message queue provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0020] The embodiments of the present application provide a method, device and medium for cross-network data transmission based on MQ message queues to solve the following technical problems: how to solve the problems of low efficiency, poor stability and security risks in traditional data transmission methods.
[0021] The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0022] Figure 1 The present invention provides a flow chart of a data cross-network transmission method based on MQ message queue. Figure 1 As shown, the embodiment of the present application provides a data cross-network transmission method based on MQ message queue, which specifically includes the following steps:
[0023] Step 101: Based on a preset data encapsulation rule, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server.
[0024] In one embodiment of the present application, in order to realize cross-network data transmission, the present application first encapsulates the data to be transmitted into an MQ message to be transmitted based on a preset data encapsulation rule when the data sender sends the data to be transmitted to the data receiver.
[0025] It should be noted that the MQ message to be transmitted obtained after encapsulation based on the preset data encapsulation rules in this application includes: data packet header information, database operation header information, file data header information, return information, and database table header information.
[0026] The data packet header includes: data type, checksum, sender code, receiver code, center code, data ID, and data length. The data type identifies the specific type or purpose of the data; the checksum verifies data integrity and prevents errors during transmission; the sender code uniquely identifies the device or system sending the data; the receiver code identifies the device or system to which the data should be sent; the center code identifies the data center code; the data ID uniquely identifies the data; and the data length indicates the total length of the data.
[0027] The database operation header information includes: an indication of the database operation mode, a table number, and a spare field. The indication of the database operation mode is used to indicate the database operation mode (such as read, write, update, etc.); the table number is used to identify the table in the database; and the spare field is used to store some additional, currently unused information.
[0028] The file data header includes: file name, file data, data length, and spare field. The file name identifies the file name corresponding to this data block; the file data contains the actual file content; the data length indicates the length of the file data; and the spare field is used to store some additional, currently unused information.
[0029] The returned information includes: return type, flag, file name, and table code. The return type identifies the specific type or purpose of the returned data; the flag indicates the status of the returned data (such as success, failure, error, etc.); the table code identifies the database table associated with the returned data; and the file name is the file name associated with the returned data.
[0030] The database table header includes: table code, data length, number of records, and number of fields. The table code is similar to the tablecode in DATARETURN, but here it is used to identify the table itself; the data length is the total length of the data in the table; the number of fields indicates how many fields in the table; and the number of records indicates how many records in the table.
[0031] Furthermore, after the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, the MQ message to be transmitted is sent to the MQ server. It should be noted that the data sender of this application is connected to the MQ server via a first network.
[0032] In one embodiment of the present application, sending the MQ message to be transmitted to the MQ server specifically includes: the data sender sends the MQ message to be transmitted to the designated port of the MQ server based on a preset first transmission protocol through a first network; the MQ server listens to the designated port, and when the MQ message to be transmitted is listened to, the MQ message to be transmitted is stored in the local MQ message queue.
[0033] In one embodiment, in the cross-network data transmission implementation scheme of the present application, communication between the data sender and the MQ server is achieved through a secure and reliable first network connection. The first network can be an internal enterprise LAN, WAN, or virtual private network (VPN), ensuring the security and stability of data during transmission.
[0034] Before data transmission begins, the data sender needs to send the MQ message to be transmitted to the MQ server. The specific steps are as follows:
[0035] The data sender first prepares the MQ message to be transmitted. The message is formatted according to the system's preset data encapsulation rules and contains the necessary data packet header information, database operation information, file data information, etc.
[0036] The data sender starts a communication session with the MQ server via the first network connection. In this session, the data sender uses a preset first transmission protocol, such as TCP / IP protocol, to ensure reliable transmission and sequentiality of the data.
[0037] The data sender sends the MQ message to be transmitted to the port pre-specified by the MQ server. This port is specially opened for receiving MQ messages, and only the data sender with the corresponding permission can send data to it.
[0038] The MQ server has been listening to the specified port, waiting for the connection and data transmission request from the data sender. When it detects the arrival of an MQ message to be transmitted, the MQ server will immediately respond and receive the message.
[0039] The received MQ messages to be transmitted are securely stored by the MQ server in its local MQ message queue.
[0040] In this way, the data sender can successfully send the MQ messages to the MQ server, and the MQ server can accurately receive these messages and store them in a local queue for subsequent processing and forwarding. The entire transmission process complies with the preset first transmission protocol specifications, ensuring the accuracy and reliability of data transmission.
[0041] Step 102: Based on a preset encryption rule, the MQ server encrypts the MQ message to be transmitted and sends a data reception verification request to the data recipient.
[0042] In one embodiment of the present application, after the data sender sends the MQ message to be transmitted to the MQ server, the MQ server encrypts the MQ message to be transmitted based on a preset encryption rule.
[0043] Specifically, based on the preset key length, a key to be applied is generated through a preset key generation algorithm and stored; the MQ message to be transmitted is plaintext filled based on a preset filling function, and the data to be transmitted in the MQ message to be transmitted after the plaintext is filled is encrypted through the key to be applied.
[0044] In one embodiment, consider a cross-network data transmission system based on MQ message queues. A data sender needs to securely transmit important business data to a data receiver via an MQ server. To ensure data security during transmission, an encryption method based on pre-defined encryption rules is employed.
[0045] First, before receiving an MQ message to be transmitted, the MQ server generates a key based on a preset key length (for example, 256 bits) using a secure and efficient key generation algorithm (such as the AES key generation algorithm). This key will be used for subsequent encryption operations and is securely stored in the MQ server's key management system to ensure its confidentiality.
[0046] Next, when the data sender sends the MQ message to the MQ server, the server receives it and prepares to encrypt it. Before encryption, the MQ server pads the plaintext portion of the message using a pre-defined padding function (such as PKCS#7 padding). The purpose of padding is to ensure that the plaintext data meets the encryption algorithm's requirements and can be correctly identified and removed during decryption.
[0047] After padding is complete, the MQ server encrypts the padded plaintext data using the previously generated key to be applied. We can use the AES symmetric encryption algorithm, which provides strong data encryption protection. During the encryption process, the key to be applied is combined with the plaintext data through the encryption algorithm to generate ciphertext data.
[0048] Finally, the MQ server stores and transmits the encrypted ciphertext data as part of the MQ message to be transmitted. During this process, even if someone intercepts the MQ message in transit, they cannot directly obtain the original plaintext data because they do not have the correct decryption key.
[0049] In this way, we ensure the security and confidentiality of MQ messages to be transmitted in the MQ server, providing strong protection for data transmission across the network.
[0050] In one embodiment of the present application, after the MQ server encrypts the MQ message to be transmitted, it also sends a data reception verification request to the data recipient to notify the data recipient that there is corresponding data to be transmitted that needs to be received.
[0051] Step 103: The data receiver sends a decryption request to the MQ server based on the data reception verification request, and sends an identity verification request to the data sender.
[0052] In one embodiment of the present application, after the MQ server sends a data reception verification request to the data recipient, the data recipient sends a decryption request to the MQ server based on the data reception verification request.
[0053] In one embodiment of the present application, after the data recipient sends a decryption application to the MQ server based on the data reception verification request, the method also includes: the MQ server decrypts the encrypted MQ message to be transmitted based on the key to be applied, specifically including: the MQ server parses the decryption application to determine the receiver code of the data recipient, and matches the MQ message to be transmitted in the local MQ message queue based on the receiver code; based on the MQ message to be transmitted, queries the corresponding key to be applied in the MQ server to decrypt the encrypted MQ message to be transmitted based on the key to be applied.
[0054] In one embodiment, after receiving a data receipt verification request, the data recipient confirms that it has the authority and conditions to receive the data and then sends a decryption request to the MQ server. This request includes the data recipient's identification information, such as a recipient code, enabling the MQ server to accurately authenticate and match messages. Upon receiving the decryption request, the MQ server first parses it. Through parsing, the MQ server extracts the recipient code, which is critical information for subsequent operations. Next, the MQ server searches its local MQ message queue for a matching MQ message to be transmitted based on the recipient code. This process compares the recipient field of each message in the message queue with the recipient code, ensuring that only the intended recipient receives the corresponding message. Upon finding a matching MQ message to be transmitted, the MQ server further queries the key to be applied used to encrypt the message. This key, generated and securely stored by the MQ server during the message encryption phase, is now used for decryption. The MQ server uses the retrieved key to decrypt the encrypted MQ message to be transmitted. The decryption algorithm corresponds to the algorithm used for encryption. For example, if the AES algorithm is used for encryption, the same AES algorithm and key will be used for decryption. After decryption is completed, the MQ server obtains the original MQ message to be transmitted.
[0055] In one embodiment of the present application, a data sender and a data receiver are connected via a second network; after sending an identity authentication request to the data sender, the method further includes: based on the identity authentication request, the data sender authenticates the data receiver through preset identity authentication rules, specifically including: the data sender receives the identity authentication request and parses the identity information of the data receiver; based on the identity information and the preset identity authentication rules, authenticates the data receiver; if the verification is successful, sends an identity authentication success response to the data receiver, otherwise sends an identity authentication failure response.
[0056] In one embodiment, communication between the data sender and the data receiver is achieved via a second network connection. This second network can be the Internet, a public communication network, or another type of wide area network. Its characteristics are openness and publicity, so special attention must be paid to the identity verification of both communicating parties to ensure the security of data transmission.
[0057] In one embodiment, before a data recipient prepares to receive data, the data sender sends it an identity verification request to ensure the recipient's identity and data receiving authority. The following are the detailed steps for implementing this identity verification process: The data sender first constructs an identity verification request, which includes the type of identity information required from the data recipient, such as a username, password, or digital certificate. The data sender then sends the identity verification request to the data recipient via a second network connection. Upon receiving the request, the data recipient provides the required identity information. After receiving the identity information returned by the data recipient, the data sender begins parsing it. The purpose of this parsing is to extract key identification data for subsequent identity verification. Next, the data sender verifies the identity information provided by the data recipient based on pre-set identity verification rules. These rules may include password complexity requirements, digital certificate validity checks, and username uniqueness matching. If the identity information provided by the data recipient meets the pre-set identity verification rules, the data sender determines that the identity verification is successful and sends an authentication success response to the data recipient. This response indicates that the data recipient has been confirmed as a legitimate data recipient and can proceed with subsequent data transmission operations. If the identity information provided by the data recipient does not meet the pre-set authentication rules, the data sender will determine that the authentication has failed and send an authentication failure response to the data recipient. This response will inform the data recipient of the reason for the authentication failure and require them to re-authenticate or contact the system administrator for resolution.
[0058] Through this example, we can see that the cross-network data transmission system ensures the legitimacy of the data recipient's identity and data receiving authority through a strict identity verification process before data transmission. This not only improves the security of data transmission, but also reduces the risk of data leakage and unauthorized access.
[0059] Step 104: If the verification is successful, the MQ server sends the MQ message to be transmitted to the data recipient.
[0060] It should be noted that the data recipient of this application is connected to the MQ server through a third network.
[0061] In one embodiment of the present application, if the verification is passed, the MQ server sends the MQ message to be transmitted to the data recipient, specifically including: the MQ server sends the MQ message to be transmitted to the designated receiving port of the data recipient based on the preset second transmission protocol through a third network connection; the data recipient listens to the designated receiving port, and reads the MQ message to be transmitted when it hears the MQ message to be transmitted.
[0062] In one embodiment, after confirming that the data recipient has passed authentication, the MQ server prepares to send the MQ message to the data recipient. First, the MQ server ensures that the third network connection between the data recipient and the server is unobstructed. This third network can be of the same or different type as the first and second networks, but it must meet the security and stability requirements for data transmission. Next, the MQ server performs the necessary encapsulation and formatting of the MQ message to be transmitted according to a preset second transmission protocol. This second transmission protocol can be the same or different from the first transmission protocol, such as TCP / IP or UDP. The specific protocol selected depends on the actual system requirements and network environment. After processing is complete, the MQ server sends the encapsulated MQ message to the data recipient's designated receiving port via the third network connection. This receiving port is specifically designated for receiving MQ messages by the data recipient, and only MQ servers with appropriate permissions can send data to it. The data recipient continuously listens to this designated receiving port, awaiting data transmission from the MQ server. When a pending MQ message is detected, the data recipient immediately responds and begins reading the message. During the reading process, the data receiver decapsulates and parses the received MQ message according to the specifications of the second transmission protocol to restore the original data to be transmitted. Finally, the data receiver stores the read data to be transmitted in a local database or file system for subsequent business logic processing.
[0063] In one embodiment of the present application, after the MQ server sends the MQ message to be transmitted to the data recipient, the method also includes: the data recipient performs an integrity check on the received MQ message to be transmitted to confirm whether the MQ message to be transmitted has been tampered with during the transmission process; if the MQ message to be transmitted passes the integrity check, a successful reception feedback is sent to the data sender and / or the MQ server; if the MQ message to be transmitted fails to pass the integrity check, the data recipient discards the MQ message to be transmitted and sends an error feedback to the data sender and / or the MQ server.
[0064] In one embodiment, after successfully receiving an MQ message to be transmitted from an MQ server, the data receiver does not immediately perform subsequent processing. Instead, it first performs an integrity check on the message. The purpose of the integrity check is to confirm whether the message has been illegally tampered with during transmission, thereby ensuring the authenticity and reliability of the data. The data receiver uses a preset integrity check algorithm, such as a hash algorithm like MD5 or SHA-1, to verify the MQ message to be transmitted. During this process, the data receiver calculates a hash value for the received message and compares it with the original hash value calculated and appended by the sender before sending the message. If the calculated hash value matches the original hash value, the MQ message to be transmitted has not been tampered with during transmission, and the data receiver determines that the message has passed the integrity check. If the MQ message to be transmitted passes the integrity check, the data receiver sends a successful receipt response to the data sender and / or the MQ server. This response indicates that the data has successfully and securely arrived at the intended recipient and has not been tampered with. If the calculated hash value does not match the original hash value, the MQ message to be transmitted may have been tampered with or damaged during transmission, and the data receiver determines that the message has failed the integrity check. If the MQ message to be transmitted fails the integrity check, the data receiver will immediately discard the message and send an error feedback to the data sender and / or MQ server. This feedback informs the sender and server that there may be a problem during data transmission and that appropriate measures need to be taken to resolve it. After receiving the feedback from the data receiver, the data sender and MQ server will take appropriate subsequent actions based on the type of feedback (success or error). For example, if a successful feedback is received, the data transmission task can be considered completed; if an error feedback is received, the data may need to be resent or other error recovery operations may need to be performed.
[0065] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, this application embodiment also provides a data cross-network transmission device based on MQ message queue, whose structure is as follows: Figure 2 shown.
[0066] Figure 2This is a schematic diagram of the internal structure of a data cross-network transmission device based on an MQ message queue provided in an embodiment of the present application. Figure 2 As shown, the equipment includes:
[0067] at least one processor 201;
[0068] and, a memory 202 communicatively coupled to the at least one processor;
[0069] The memory 202 stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to:
[0070] Based on the preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server;
[0071] Based on the preset encryption rules, the MQ server encrypts the MQ message to be transmitted and sends a data reception verification request to the data recipient;
[0072] Based on the data reception verification request, the data receiver sends a decryption request to the MQ server and sends an identity verification request to the data sender;
[0073] If the verification is successful, the MQ server sends the MQ message to be transmitted to the data recipient.
[0074] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium for data cross-network transmission based on an MQ message queue, storing computer executable instructions, wherein the computer executable instructions are set to:
[0075] Based on the preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server;
[0076] Based on the preset encryption rules, the MQ server encrypts the MQ message to be transmitted and sends a data reception verification request to the data recipient;
[0077] Based on the data reception verification request, the data receiver sends a decryption request to the MQ server and sends an identity verification request to the data sender;
[0078] If the verification is successful, the MQ server sends the MQ message to be transmitted to the data recipient.
[0079] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from the other embodiments. In particular, the IoT device and media embodiments are generally similar to the method embodiments, so their description is relatively simple. For relevant portions, refer to the description of the method embodiments.
[0080] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to their corresponding methods. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0081] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0083] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0085] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0086] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0087] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0088] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0089] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A data cross-network transmission method based on MQ message queue, characterized in that: The method comprises: Based on the preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server; Based on the preset encryption rules, the MQ server encrypts the MQ message to be transmitted and sends a data reception verification request to the data recipient; The data receiver receives the verification request based on the data, sends a decryption request to the MQ server, and sends an identity verification request to the data sender; If the verification is successful, the MQ server sends the MQ message to be transmitted to the data recipient.
2. According to the method for data transmission across networks based on MQ message queues according to claim 1, it is characterized in that: The MQ message to be transmitted includes: data packet header information, database operation header information, file data header information, return information, and database table header information; The data packet header information includes: data type, checksum, sender code, receiver code, center code, data ID, data length; The database operation header information includes: indicating the database operation mode, table number, and spare fields; The file data header information includes: file name, file data, data length, and spare fields; The returned information includes: return type, flag, file name, table code; The database table header information includes: table code, data length, number of records, and number of fields.
3. According to the method of data cross-network transmission based on MQ message queue in claim 1, it is characterized in that: Based on the preset encryption rules, the MQ server encrypts the MQ message to be transmitted, specifically including: Based on a preset key length, a key to be applied is generated by a preset key generation algorithm, and the key to be applied is stored; The MQ message to be transmitted is filled with plain text based on a preset filling function, and the data to be transmitted in the MQ message to be transmitted after the plain text is filled is encrypted by the key to be applied.
4. According to the method of data cross-network transmission based on MQ message queue in claim 3, it is characterized in that: The data sender is connected to the MQ server via a first network; Sending the MQ message to be transmitted to the MQ server specifically includes: The data sender sends the MQ message to be transmitted to a designated port of the MQ server based on a preset first transmission protocol through the first network; The MQ server monitors the designated port, and when the MQ message to be transmitted is monitored, the MQ server stores the MQ message to be transmitted in a local MQ message queue.
5. The method for cross-network data transmission based on MQ message queue according to claim 4 is characterized in that: After the data receiver sends a decryption request to the MQ server based on the data reception verification request, the method further includes: The MQ server decrypts the encrypted MQ message to be transmitted based on the key to be applied, specifically including: The MQ server parses the decryption request to determine the receiver code of the data receiver, and matches the MQ message to be transmitted in the local MQ message queue based on the receiver code; Based on the MQ message to be transmitted, the corresponding key to be applied is queried in the MQ server, so as to decrypt the encrypted MQ message to be transmitted based on the key to be applied.
6. The method for cross-network data transmission based on MQ message queue according to claim 1, characterized in that: The data sender is connected to the data receiver via a second network; After sending the identity authentication request to the data sender, the method further includes: Based on the identity authentication request, the data sender performs identity authentication on the data receiver through a preset identity authentication rule, specifically including: The data sender receives the identity authentication request and parses the identity information of the data receiver; Authentication of the data recipient based on the identity information and preset identity authentication rules; If the verification is successful, an identity verification success response is sent to the data recipient, otherwise an identity verification failure response is sent.
7. The method for cross-network data transmission based on MQ message queue according to claim 1, characterized in that: The data receiver is connected to the MQ server via a third network; The MQ server sends the MQ message to be transmitted to the data recipient, specifically including: The MQ server sends the MQ message to be transmitted to the designated receiving port of the data receiver based on the preset second transmission protocol through the third network connection; The data receiver monitors the designated receiving port, and reads the MQ message to be transmitted when the MQ message to be transmitted is monitored.
8. The method for cross-network data transmission based on MQ message queue according to claim 1, characterized in that: After the MQ server sends the MQ message to be transmitted to the data recipient, the method further includes: The data receiver performs integrity check on the received MQ message to be transmitted to confirm whether the MQ message to be transmitted has been tampered with during the transmission process; If the MQ message to be transmitted passes the integrity check, sending a successful reception feedback to the data sender and / or the MQ server; If the MQ message to be transmitted fails the integrity check, the data receiver discards the MQ message to be transmitted and sends an error feedback to the data sender and / or the MQ server.
9. A data cross-network transmission device based on MQ message queue, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Based on the preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server; Based on the preset encryption rules, the MQ server encrypts the MQ message to be transmitted and sends a data reception verification request to the data recipient; The data receiver receives the verification request based on the data, sends a decryption request to the MQ server, and sends an identity verification request to the data sender; If the verification is successful, the MQ server sends the MQ message to be transmitted to the data recipient.
10. A non-volatile computer storage medium for data cross-network transmission based on MQ message queues, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Based on the preset data encapsulation rules, the data sender encapsulates the data to be transmitted into an MQ message to be transmitted, and sends the MQ message to be transmitted to the MQ server; Based on the preset encryption rules, the MQ server encrypts the MQ message to be transmitted and sends a data reception verification request to the data recipient; The data receiver receives the verification request based on the data, sends a decryption request to the MQ server, and sends an identity verification request to the data sender; If the verification is successful, the MQ server sends the MQ message to be transmitted to the data recipient.
