Message import method and device based on one-way gatekeeper

By analyzing and converting the received messages on the intranet end of the one-way gate, the problem that traditional one-way gate cannot realize message import between different types of message processing systems is solved, and the effective import and transmission of messages is realized.

CN119172436APending Publication Date: 2024-12-20QI AN XIN TECHNOLOGY GROUP INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310729530.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Traditional one-way secure isolation gate cannot achieve protocol compatibility and cluster compatibility between different types of message processing systems, resulting in the inability to implement message import between different types of message processing systems through one-way gate.

Method used

By receiving target messages sent by different types of message processing systems on the external network end of the one-way gate, and parsing and format conversion are performed on the intranet end, the message is converted into a second target message in a preset format, and finally it is sent to a message processing system that supports this format.

Benefits of technology

It realizes message import between different types of message processing systems, solves the problems of protocol compatibility and cluster compatibility, and ensures that messages can be transmitted smoothly to the target message cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172436A_ABST
    Figure CN119172436A_ABST
Patent Text Reader

Abstract

The invention provides a message import method and device based on a one-way gatekeeper, the extranet end of the one-way gatekeeper is connected with a first message processing system, the intranet end of the one-way gatekeeper is connected with a second message processing system, and the first message processing system and the second message processing system support different message types; the method comprises the following steps: receiving a first target message sent by the first message processing system through the extranet end, and sending the first target message to the intranet end; analyzing the first target message through the internal network end, and converting the format of the first target message into a preset format according to an analysis result to obtain a second target message; wherein the second message processing system supports the preset format; and sending the second target message to the second message processing system through the internal network end. Through the method provided by the invention, the process of importing the messages among different types of message processing systems can be completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information data technology, and in particular to a message import method and device based on a one-way network gate. Background Art

[0002] As the process of informatization construction continues to accelerate, big data technology has very important application value in the technical and business levels of many fields, such as finance, medical care, autonomous driving, etc. Usually, in big data applications in these fields, it is necessary to exchange the collected big data in a secure isolation or import secure data.

[0003] In the prior art, a network gate is usually used for secure isolation exchange or secure data import. The traditional one-way secure isolation network gate cannot achieve protocol compatibility and cluster compatibility between two different types of message processing systems, and thus cannot achieve message import between different types of message processing systems through a one-way network gate.

[0004] Therefore, how to implement the import of messages between different types of message processing systems through a one-way gateway is a technical problem that needs to be solved at present. Summary of the invention

[0005] The present invention provides a message import method and device based on a one-way network gate, which is used to solve the defect that the protocol compatibility and cluster compatibility between two different message processing systems cannot be achieved in the prior art, and realize the import of messages between different types of message processing systems.

[0006] The present invention provides a message import method based on a one-way network gate, wherein the external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types;

[0007] The method comprises:

[0008] Receiving a first target message sent by the first message processing system through the external network end, and sending the first target message to the internal network end;

[0009] Parsing the first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, to obtain a second target message; wherein the second message processing system supports the preset format;

[0010] The second target message is sent to the second message processing system through the intranet terminal.

[0011] According to a message import method based on a one-way network gate provided by the present invention, the first message processing system includes a data collection service;

[0012] The receiving, through the external network end, the first target message sent by the first message processing system includes:

[0013] A first target message sent by the data collection service is received through the external network terminal; wherein the first target message is generated by the data collection service by encapsulating the collected original data message according to an initial preset format.

[0014] According to a message import method based on a one-way network gate provided by the present invention, sending the first target message to the intranet terminal includes:

[0015] Each of the first target messages is split through the external network end to generate a message packet, and the message packet is sent to the internal network end.

[0016] According to a message import method based on a one-way network gate provided by the present invention, the second message processing system includes a plurality of message clusters, each of the message clusters having a corresponding topic type;

[0017] The step of parsing the first target message through the intranet terminal and converting the format of the first target message into a preset format according to the parsing result to obtain the second target message includes:

[0018] Restore the message packet through the intranet end to obtain a restored first target message; wherein the first target message carries a corresponding topic type;

[0019] The restored first target message is parsed through the intranet terminal, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message; wherein the second target message carries the same subject type as the first target message;

[0020] The sending the second target message to the second message processing system through the intranet terminal includes:

[0021] According to the topic type, the second target message is sent to a target message cluster corresponding to the topic type through the intranet terminal.

[0022] According to a message import method based on a one-way network gate provided by the present invention, before sending the second target message to the target message cluster corresponding to the topic type through the intranet terminal, the method further includes:

[0023] The intranet terminal performs identity authentication with the intranet server according to the preloaded certificate file. If the authentication is successful, an intranet session channel is established between the intranet terminal and the message cluster.

[0024] According to a message import method based on a one-way network gate provided by the present invention, each of the first target messages also carries a corresponding message length and a message body;

[0025] The step of parsing the restored first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, and obtaining the second target message includes:

[0026] Parsing the restored first target message through the intranet end to obtain a parsing result, wherein the parsing result includes a subject type, a message length, and a message body carried by the first target message;

[0027] Generate a second target message header according to the topic type and the message length;

[0028] Generate the message content of the second target message based on the second target message header and the message body, convert the message content of the second target message into a preset format supported by the second message processing system, and obtain the second target message;

[0029] The sending, according to the topic type, through the intranet end, the second target message to a target message cluster corresponding to the topic type includes:

[0030] According to the second target message header, the second target message is sent to the target message cluster corresponding to the second target message header through the target intranet session channel.

[0031] According to a message import method based on a one-way network gate provided by the present invention, each of the first target messages is split by the external network end to generate a message packet, including:

[0032] Splitting each of the first target messages into at least one message packet according to a preset size through the external network end;

[0033] Adding a subpacket protocol header to each of the message subpackets through the external network end;

[0034] Each of the message packets and the corresponding packet protocol header are encapsulated through the external network end to generate the corresponding message packet.

[0035] According to a message import method based on a one-way network gate provided by the present invention, the subpacket protocol header at least includes: a subpacket identifier and a subpacket index number; wherein the subpacket identifiers of the message packets split from the same first target message are the same, and the subpacket index number is used to indicate the order of the message packets with the same subpacket identifier in the same first target message;

[0036] The restoring the message packet through the intranet terminal to obtain the restored first target message includes:

[0037] Dividing the message packets having the same subpacket identifier by the intranet end;

[0038] Sort the message packets having the same sub-packet identifier by the intranet terminal according to the sub-packet index number;

[0039] The sorted message packets are split into the packet protocol header and the message packets through the intranet end, and the message packets are reassembled to obtain the restored first target message.

[0040] According to a message import method based on a one-way network gate provided by the present invention, after restoring the message packet through the intranet end to obtain the restored first target message, the method further includes:

[0041] Verifying the restored first target message through the intranet end, and if the verification passes, executing the step of parsing the restored first target message through the intranet end;

[0042] If the verification fails, the restored first target message is discarded.

[0043] The present invention also provides a message import device based on a one-way network gate, wherein the external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types;

[0044] The device comprises:

[0045] A receiving module, configured to receive a first target message sent by the first message processing system through the external network end, and send the first target message to the internal network end;

[0046] A parsing module, used to parse the first target message through the intranet terminal, and convert the format of the first target message into a preset format according to the parsing result to obtain a second target message; wherein the second message processing system supports the preset format;

[0047] A sending module is used to send the second target message to the second message processing system through the intranet terminal.

[0048] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the message import method based on a one-way network gate as described above is implemented.

[0049] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the message import method based on a one-way network gate as described above is implemented.

[0050] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned message importing methods based on a one-way network gate.

[0051] The present invention provides a message import method and device based on a one-way network firewall, wherein a first message processing system is connected to the external network end of the one-way network firewall, and a second message processing system is connected to the internal network end of the one-way network firewall, and the message types supported by the first message processing system and the second message processing system are different; firstly, a first target message sent by the first message processing system is received through the external network end, and the first target message is sent to the internal network end; secondly, the first target message is parsed through the internal network end, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message; finally, the second target message is sent to the second message processing system through the internal network end to complete the message import process between different types of message processing systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 This is one of the flow diagrams of the message import method based on the one-way network gate provided by the present invention;

[0054] Figure 2 It is a schematic diagram of the interactive environment of the message import method based on the one-way network gate provided by the present invention;

[0055] Figure 3 This is the second flow chart of the message import method based on the one-way network gate provided by the present invention;

[0056] Figure 4 It is a schematic diagram of generating a second target message of the message import method based on a one-way network gate provided by the present invention;

[0057] Figure 5 This is the third flow chart of the message import method based on the one-way network gate provided by the present invention;

[0058] Figure 6It is a schematic diagram of splitting the first target message of the message import method based on the one-way network gate provided by the present invention;

[0059] Figure 7 This is the fourth flow chart of the message import method based on the one-way network gate provided by the present invention;

[0060] Figure 8 It is a schematic diagram of restoring the first target message of the message import method based on the one-way network gate provided by the present invention;

[0061] Fig. 9 This is the fifth flow chart of the message import method based on the one-way network gate provided by the present invention;

[0062] Fig.10 It is a structural schematic diagram of a message import device based on a one-way network gate provided by the present invention;

[0063] Fig.11 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0065] First, the terms involved in this embodiment are explained schematically.

[0066] Kafka: is an open source stream processing platform developed by the Apache Software Foundation, written in Scala and Java. Kafka is a high-throughput distributed publish-subscribe messaging system that can handle all action stream data of consumers on the website. This action (web browsing, search and other user actions) is a key factor in many social functions on the modern network. This data is usually solved by processing logs and log aggregation due to throughput requirements. For log data and offline analysis systems like Hadoop, which have real-time processing requirements, this is a viable solution. The purpose of Kafka is to unify online and offline message processing through Hadoop's parallel loading mechanism, and to provide real-time messages through clusters.

[0067] Kerberos: is a network authentication protocol designed to provide strong authentication services for client / server applications through a key system. The implementation of this authentication process does not rely on the authentication of the host operating system, does not require trust based on the host address, does not require the physical security of all hosts on the network, and assumes that data packets transmitted on the network can be arbitrarily read, modified, and inserted. In the above case, Kerberos, as a trusted third-party authentication service, performs authentication services through traditional cryptographic techniques (such as shared keys).

[0068] ZeroMQ (also known as 0MQ or ZMQ): Looks like an embeddable network library, but behaves like a concurrency framework. It provides sockets for transmitting atomic messages across various protocols such as intra-process, inter-process, TCP, and multicast. Multipoint-to-multipoint sockets can be connected using push, publish-subscribe, task distribution, and request-reply patterns. It is fast enough to be part of a cluster product. It has many language APIs and runs on most operating systems.

[0069] Cluster: Cluster technology is a relatively new technology. Through cluster technology, relatively high benefits in performance, reliability, and flexibility can be obtained at a relatively low cost. Its task scheduling is the core technology in cluster systems. A cluster is a group of independent computers connected by a high-speed network. They form a group and are managed in a single system mode. When a client interacts with the cluster, the cluster acts like an independent server. Cluster configuration is used to improve availability and scalability.

[0070] TLV: ASN.1 is an ISO / ITU-T standard. One of the codes, BER (Basic Encoding Rules), is simple and easy to use. It uses triple encoding, referred to as TLV encoding. It is a group of data messages consisting of the data type Tag (T), the data length Length (L), and the data value Value (V). TLV is based on binary encoding, encoding the data as a byte array in the form of (TLV), that is, TLV is a data transmission protocol for byte streams. It specifies the first byte or bytes of a frame of data to indicate the data type, followed by one or more bytes to indicate the data length, and finally the content of the data.

[0071] Combine the following Figure 1-Figure 11 The present invention describes a message import method and device based on a one-way network gate.

[0072] It should be noted that the network gate is used for secure isolation exchange or secure data import. The traditional one-way secure isolation network gate can usually only realize the information import between the same message processing systems, and cannot realize the protocol compatibility and cluster compatibility between two different message processing systems. Therefore, this embodiment provides a message import method based on a one-way network gate to realize the import of messages between different types of message processing systems inside and outside the network gate.

[0073] Figure 1 FIG. 1 is one of the flow charts of the message import method based on the one-way network gate provided in this embodiment. Figure 1 As shown, the message import method based on a one-way network gate provided in this embodiment, the external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types.

[0074] Specifically, in this embodiment, the external network end of the one-way network gate is connected to the first message processing system, and the internal network end of the one-way network gate is connected to the second message processing system. The first message processing system and the second message processing system support different message types. Based on the one-way network gate, the import of messages between two different types of message systems can be realized.

[0075] Furthermore, the first message processing system includes a data collection service, which is used to collect original data messages; the intranet end of the one-way network gate is also connected to multiple message clusters, each message cluster has a corresponding topic type, and is used to receive messages of the corresponding topic type from the external network end. The message cluster can be rabbitMQ, activeMQ, zeroMQ, Kafka, etc., and this embodiment does not make any special limitations on this.

[0076] The method comprises:

[0077] Step 100: Receive a first target message sent by the first message processing system through the external network end, and send the first target message to the internal network end.

[0078] It should be noted that Figure 2 Schematic diagram of the interactive environment of the message import method based on the one-way network gate provided in this embodiment. Figure 2 As shown, before the data collection service collects the original data message, the external network end of the network gate starts the service and constructs the external network end message processing task to create an external network session channel between the data collection service and the one-way network gate. For example, the external network end service can be a ZeroMQ service, and a ZeroMQ session channel is established between the data collection service and the network gate to transmit messages to the internal network end.

[0079] Specifically, the data collection service collects raw data messages. In order to clarify the data message type and facilitate the import of data messages into the corresponding message cluster on the intranet side, the data collection service encapsulates the raw data messages into the first target message in TLV format. TLV is a group of data packets consisting of the data type Tag (T), the data length Length (L), and the data value Value (V). Based on binary encoding, the data is encoded as a byte array in the form of (TLV), which specifies the first byte or bytes of a frame of data to indicate the subject type, followed by one or several bytes to indicate the data length, and finally the content of the data. In this embodiment, each first target message encapsulated in TLV format carries the corresponding subject type, which facilitates the subsequent import of messages based on the subject type.

[0080] Step 200: Parse the first target message through the intranet terminal, convert the format of the first target message into a preset format according to the parsing result, and obtain a second target message; wherein, the second message processing system supports the preset format.

[0081] It should be noted that at the external end of the unidirectional network gate, the reception of data messages needs to be limited and controlled. Specifically, a safety line is set according to the data ferrying capacity of the unidirectional isolation switch card of the network gate and the actual consumption capacity of the intranet message cluster, and the rate cap is configured for the data flow to ensure that the rate of data sent to the intranet end of the network gate is below the safety line, which can minimize the risk of message loss.

[0082] Specifically, each first target message encapsulated by the data collection service needs to be parsed, and the message content of the second target message is generated based on the parsed content of the first target message, and then converted into a preset format supported by the second message processing system to generate the second target message.

[0083] Step 300: Send the second target message to the second message processing system through the intranet terminal.

[0084] It should be noted that before the intranet end transmits messages, it is necessary to first authenticate the identity of the intranet server to establish an intranet session channel between the one-way network gate and the message cluster. For details, see Figure 2 .

[0085] Specifically, the second target message is sent to the target message cluster corresponding to the subject type through the intranet terminal based on the intranet session channel to complete the target message import process.

[0086] The above is a description of the steps of the message import method based on the one-way network gate provided by the present invention. From the description of the above steps, it can be seen that according to the message import method based on the one-way network gate provided by the present invention, the first message processing system is connected to the external network end of the one-way network gate, and the second message processing system is connected to the internal network end of the one-way network gate, and the message types supported by the first message processing system and the second message processing system are different; first, the first target message sent by the first message processing system is received through the external network end, and the first target message is sent to the internal network end; secondly, the first target message is parsed through the internal network end, and the format of the first target message is converted into a preset format according to the parsing result to obtain the second target message; finally, the second target message is sent to the second message processing system through the internal network end to complete the message import process between different types of message processing systems.

[0087] Based on the above embodiment, in this embodiment, the first message processing system includes a data collection service; receiving the first target message sent by the first message processing system through the external network terminal in step 100 includes:

[0088] A first target message sent by the data collection service is received through the external network terminal; wherein the first target message is generated by the data collection service by encapsulating the collected original data message according to an initial preset format.

[0089] Specifically, the above embodiment has mentioned that the data collection service in the first message processing system collects the original data message. In order to clarify the data message type and facilitate the import of the data message into the corresponding message cluster on the intranet, the original data message is encapsulated into the first target message in TLV format through the data collection service. In this embodiment, each first target message encapsulated in TLV format carries the corresponding topic type, which facilitates the subsequent import of messages based on the topic type.

[0090] The message import method based on a one-way network firewall provided in this embodiment receives the first target message encapsulated and sent by the data acquisition service through the external network end. Each first target message encapsulated in TLV format carries a corresponding subject type, which facilitates subsequent message import based on the subject type.

[0091] Based on the above embodiment, in this embodiment, sending the first target message to the intranet terminal in step 100 includes:

[0092] Each of the first target messages is split through the external network end to generate a message packet, and the message packet is sent to the internal network end.

[0093] Specifically, each first target message encapsulated by the data collection service needs to be split, and several message packets are generated according to the data ferrying capability of the gatekeeper unidirectional isolation switch card. The size of each message packet can be equal to the maximum number of bytes of data allowed to pass through the gatekeeper unidirectional isolation switch card each time, or it can be less than the maximum number of bytes of data allowed to pass through the gatekeeper unidirectional isolation switch card each time, so as to ensure that the message packet can be sent to the intranet end to the greatest extent and reduce the risk of message loss.

[0094] The message import method based on the one-way network gate provided in this embodiment splits each first target message through the external network end to generate a message packet to ensure that the message packet can be sent to the internal network end to the greatest extent, reducing the risk of message loss.

[0095] Based on the above embodiment, in this embodiment, the second message processing system includes multiple message clusters, and each of the message clusters has a corresponding topic type.

[0096] In step 200, the first target message is parsed by the intranet terminal, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message, including:

[0097] Restore the message packet through the intranet end to obtain a restored first target message; wherein the first target message carries a corresponding topic type;

[0098] The restored first target message is parsed through the intranet terminal, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message; wherein the second target message carries the same subject type as the first target message.

[0099] Specifically, the external network end splits the first target message and sends the message packets generated after the splitting to the internal network end through the network switch. The internal network end needs to restore the message packets and reassemble them to obtain the original first target message in order to parse the first target message.

[0100] Optionally, each restored first target message needs to be parsed, and based on the parsed content of the first target message, the message content of the second target message is generated, and then converted into a preset format supported by the second message processing system to generate the second target message. The second target message finally generated carries the same subject type as the first target message.

[0101] In step 300, sending the second target message to the second message processing system through the intranet terminal includes:

[0102] According to the topic type, the second target message is sent to a target message cluster corresponding to the topic type through the intranet terminal.

[0103] Specifically, the format of the second target message is adapted to the second message processing system, and based on the topic type that has been specified in the first message processing system, the second target message is sent to the target message cluster corresponding to the topic type.

[0104] The message import method based on a one-way network firewall provided in this embodiment receives a first target message sent by a first message processing system through an external network end, and sends the first target message to an internal network end; parses the first target message through the internal network end, and converts the format of the first target message into a preset format according to the parsing result to obtain a second target message; sends the second target message to a target message cluster through the internal network end to complete the message import process between different types of message processing systems.

[0105] Based on the above embodiment, in this embodiment, before sending the second target message to the target message cluster corresponding to the topic type through the intranet terminal according to the topic type, the method further includes:

[0106] The intranet terminal performs identity authentication with the intranet server according to the preloaded certificate file. If the authentication is successful, an intranet session channel is established between the intranet terminal and the message cluster.

[0107] Specifically, the above embodiments have mentioned that before the message is transmitted on the intranet side, it is necessary to first authenticate the identity of the intranet server to establish an intranet session channel between the one-way network gate and the message cluster.

[0108] Specifically, see Figure 2 , the intranet end authenticates the intranet server according to the preloaded certificate file. If the authentication is successful, an intranet session channel is established between the one-way network gate and the message cluster through the intranet end. Since there are message clusters of multiple topic types, a corresponding intranet session channel needs to be established between the one-way network gate and each message cluster. The identity authentication service can be a Kerberos authentication service, which is not particularly limited in this embodiment.

[0109] The message import method based on a one-way network gate provided in this embodiment can ensure the smooth import of the target message based on the intranet session channel by pre-authenticating the target message and establishing an intranet session channel before sending the target message to the target message cluster.

[0110] Based on the above embodiment, in this embodiment, each of the first target messages also carries a corresponding message length and a message body;

[0111] Figure 3 This is a second flow chart of the message import method based on the one-way network gate provided in this embodiment. Figure 3 As shown, the restored first target message is parsed by the intranet end, and the format of the first target message is converted into a preset format according to the parsing result to obtain the second target message, including:

[0112] Step 310: Parse the restored first target message through the intranet end to obtain a parsing result, wherein the parsing result includes a subject type, a message length and a message body carried by the first target message.

[0113] It should be noted that, since the first target message is a message in TLV format, each first target message carries a corresponding topic type (T), message length (L), and message body (V).

[0114] Specifically, in this embodiment, the restored first target message is parsed by the intranet end according to the TLV format to obtain the subject type, message length and message body carried by the first target message.

[0115] Step 320: Generate a second target message header according to the topic type and the message length.

[0116] It should be noted that when calling the intranet message cluster interface, the subject type and message length of the second target message need to be specified. Therefore, the second target message header is generated according to the subject type and message length parsed from the first target message.

[0117] Step 330: Generate the message content of the second target message based on the second target message header and the message body, convert the message content of the second target message into a preset format supported by the second message processing system, and obtain the second target message.

[0118] Specifically, Figure 4 FIG. 4 is a schematic diagram of generating a second target message of the message import method based on a one-way network gate provided in this embodiment. Figure 4 As shown, based on the second target message header and message body, the message content of the second target message is generated, and then converted into a preset format supported by the second message processing system to generate the second target message, and the second target message is written into the intranet message queue, waiting to be sent to the target message cluster.

[0119] The sending, according to the topic type, through the intranet end, the second target message to a target message cluster corresponding to the topic type includes:

[0120] According to the second target message header, the second target message is sent to the target message cluster corresponding to the second target message header through the target intranet session channel.

[0121] Specifically, according to the subject type included in the second target message header, a target message cluster of the corresponding subject type is selected, and the second target message is sent to the target message cluster through the intranet session channel between the one-way gateway and the target message cluster.

[0122] The message import method based on a one-way network firewall provided in this embodiment generates the message content of a second target message by parsing the first target message, converts it into a preset format supported by the second message processing system, and sends the second target message to the target message cluster corresponding to the second target message header through the target intranet session channel, so as to realize the message import process between different message processing systems.

[0123] Based on the above embodiments, in this embodiment, Figure 5 This is a flow chart of the message import method based on the one-way network gate provided in this embodiment. Figure 5 As shown, the process of splitting each of the first target messages through the external network end to generate a message packet includes:

[0124] Step 510: Split each of the first target messages into at least one message packet according to a preset size through the external network.

[0125] Step 520: Add a subpacket protocol header to each of the message subpackets through the external network end.

[0126] It should be noted that since the first target message is usually larger in bytes, in order to adapt to the data ferrying capability of the network gate's one-way isolation switching card, the first target message needs to be split into several message packets. In order to clarify the size of each message packet, its order in the original first target message, etc., it is necessary to add a packet protocol header to each message packet to identify each data packet.

[0127] Specifically, the calculation formula for the number of message subpackets split from a first target message is: the number of bytes of the first target message / preset size. If the calculation result has a remainder, the number of packets is increased by 1, and the size of the last message subpacket is the remainder. The size of the last message packet is the remainder plus the number of bytes of the subpacket protocol header length. Among them, the preset size of the message subpacket can be the difference between the maximum number of bytes of a single packet allowed by the network gate and the number of bytes of the subpacket protocol header length, or it can be less than the difference, and both can adapt to the data ferrying capability of the network gate's unidirectional isolation switch card.

[0128] Step 530: Encapsulate each of the message packets and the corresponding packet protocol header through the external network end to generate the corresponding message packet.

[0129] Specifically, Figure 6 Schematic diagram of splitting the first target message of the message import method based on the one-way network gate provided in this embodiment. Figure 6 As shown, the message is packetized and the packetization protocol header is encapsulated through the external network end to generate several message packets.

[0130] For example, the size of the first target message is n bytes, the maximum number of bytes in a single packet allowed by the network gate is a bytes, and the length of the added subpacket protocol header is b bytes. The preset size of the message subpacket is (ab) bytes, and the number of message subpackets is n / (ab). If there is a remainder, the number of message subpackets is n / (ab)+1. The number of message packets generated after encapsulating the message subpacket and the subpacket protocol header is the same as the number of message subpackets.

[0131] The message import method based on a unidirectional network gate provided in this embodiment splits the first target message into message subpackets, adds a subpacket protocol header to each message subpacket to identify the message subpacket, and encapsulates the message subpackets and the subpacket protocol header to generate a message packet. While adapting to the data ferrying capability of the unidirectional isolation switching card of the network gate, it is convenient for the subsequent rapid restoration of the first target message based on the subpacket protocol header.

[0132] Based on the above embodiments, in this embodiment, the subpacket protocol header includes at least: a subpacket identifier and a subpacket index number; wherein, the subpacket identifiers of the message packets split based on the same first target message are the same, and the subpacket index number is used to characterize the order of the message packets with the same subpacket identifier in the same first target message.

[0133] It should be noted that see Figure 6 The packetization protocol header may include: a packetization identifier, which is used to determine the first target message corresponding to the current message packet. The packetization identifiers of the message packets split from the same first target message are the same; a packetization index number, which is used to characterize the order of message packets with the same packetization identifier in the same first target message; a total number of packetizations, which is used to indicate the number of split message packets; and a payload length, which is used to indicate the size of the message packet.

[0134] Figure 7 This is a fourth flow chart of the message import method based on a one-way network gate provided in this embodiment. Figure 7 As shown, the message packet is restored through the intranet end to obtain the restored first target message, including:

[0135] Step 710: Divide the message packets having the same sub-packet identifier through the intranet terminal.

[0136] Step 720: Sort the message packets having the same sub-packet identifier according to the sub-packet index number through the intranet terminal.

[0137] Step 730: split the sorted message packet into the packet protocol header and the message packet through the intranet end, reassemble the message packet to obtain the restored first target message.

[0138] Specifically, the message packets split from the same first target message have the same packet identifier. Figure 8 : is a schematic diagram of restoring the first target message of the message import method based on the one-way network gate provided in this embodiment, such as Figure 8 As shown, the message packets split from the same first target message are classified based on the subpacket identifier through the intranet end, and then the classified message packets are sorted according to the subpacket index number. After sorting, the subpacket protocol header of each message packet is stripped off, and the message subpackets are reassembled according to the sort to obtain the restored first target message.

[0139] The message import method based on a one-way network firewall provided in this embodiment classifies and sorts message packets according to the information carried in the packet protocol header, so as to reorganize the message packets after stripping the packet protocol header, thereby obtaining the restored first target message, thereby avoiding unnecessary loss of data messages.

[0140] Based on the above embodiments, in this embodiment, Fig. 9 FIG. 5 is a flowchart of a message import method based on a one-way network gate provided in this embodiment. Fig. 9 As shown, after restoring the message packet through the intranet end to obtain the restored first target message, the method further includes:

[0141] Step 910: Verify the restored first target message through the intranet terminal.

[0142] It should be noted that after obtaining the restored first target message in the above embodiment, the restored first target message needs to be verified to ensure the integrity and correctness of the first target message.

[0143] Step 920: If the verification passes, the step of parsing the restored first target message through the intranet is executed.

[0144] Step 930: If the verification fails, the restored first target message is discarded.

[0145] Specifically, the restored first target message is verified through the intranet end. If the verification passes, the subsequent steps of parsing the restored first target message can be executed; if the verification fails, it means that the data message is lost or reassembled incorrectly, then the restored first target message is discarded, and a notification message is returned to the external network end to request the data collection service to resend the first target message.

[0146] The message import method based on a one-way network firewall provided in this embodiment restores the message package through the intranet end to obtain the restored first target message, and then verifies the first target message to ensure the integrity and correctness of the first target message and reduce unnecessary data loss.

[0147] The message importing device based on a one-way network gate provided by the present invention is described below. The message importing device based on a one-way network gate described below and the message importing method based on a one-way network gate described above can be referred to each other.

[0148] Fig.10 : is a schematic diagram of the structure of the message import device based on the one-way network gate provided in this embodiment. Fig.10 As shown, the message import device based on the one-way network gate provided in this embodiment, the external network end of the one-way network gate is connected to the first message processing system, the internal network end of the one-way network gate is connected to the second message processing system, and the first message processing system and the second message processing system support different message types;

[0149] The device comprises:

[0150] The receiving module 1001 is used to receive the first target message sent by the first message processing system through the external network end, and send the first target message to the internal network end;

[0151] The parsing module 1002 is used to parse the first target message through the intranet terminal, and convert the format of the first target message into a preset format according to the parsing result to obtain a second target message; wherein the second message processing system supports the preset format;

[0152] The sending module 1003 is used to send the second target message to the second message processing system through the intranet terminal.

[0153] The message importing device based on a one-way network gate provided in this embodiment connects a first message processing system to the external network end of the one-way network gate, and connects a second message processing system to the internal network end of the one-way network gate. The message types supported by the first message processing system and the second message processing system are different. First, a first target message sent by the first message processing system is received through the external network end, and the first target message is sent to the internal network end. Secondly, the first target message is parsed through the internal network end, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message. Finally, the second target message is sent to the second message processing system through the internal network end to complete the message import process between different types of message processing systems.

[0154] Based on the above embodiment, in this embodiment, the first message processing system includes a data collection service; the receiving module 1001 is specifically used for:

[0155] A first target message sent by the data collection service is received through the external network terminal; wherein the first target message is generated by the data collection service by encapsulating the collected original data message according to an initial preset format.

[0156] Based on the above embodiment, in this embodiment, the receiving module 1001 is specifically used for:

[0157] Each of the first target messages is split through the external network end to generate a message packet, and the message packet is sent to the internal network end.

[0158] Based on the above embodiment, in this embodiment, the second message processing system includes a plurality of message clusters, each of which has a corresponding topic type;

[0159] The analysis module 1002 is specifically used for:

[0160] Restore the message packet through the intranet end to obtain a restored first target message; wherein the first target message carries a corresponding topic type;

[0161] The restored first target message is parsed through the intranet terminal, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message; wherein the second target message carries the same subject type as the first target message;

[0162] The sending module 1003 is specifically used for:

[0163] According to the topic type, the second target message is sent to a target message cluster corresponding to the topic type through the intranet terminal.

[0164] Based on the above embodiment, in this embodiment, the device further includes a verification module, which is specifically used to:

[0165] Before sending the second target message to the target message cluster corresponding to the topic type through the intranet end, the intranet end performs identity authentication on the intranet server according to the preloaded certificate file. If the authentication is successful, an intranet session channel is established between the intranet end and the message cluster.

[0166] Based on the above embodiment, in this embodiment, each of the first target messages also carries a corresponding message length and a message body;

[0167] The analysis module 1002 is specifically used for:

[0168] Parsing the restored first target message through the intranet end to obtain a parsing result, wherein the parsing result includes a subject type, a message length, and a message body carried by the first target message;

[0169] Generate a second target message header according to the topic type and the message length;

[0170] Generate the message content of the second target message based on the second target message header and the message body, convert the message content of the second target message into a preset format supported by the second message processing system, and obtain the second target message;

[0171] The sending module 1003 is specifically used for:

[0172] According to the second target message header, the second target message is sent to the target message cluster corresponding to the second target message header through the target intranet session channel.

[0173] Based on the above embodiment, in this embodiment, the device further includes a splitting module, which is specifically used for:

[0174] Splitting each of the first target messages into at least one message packet according to a preset size through the external network end;

[0175] Adding a subpacket protocol header to each of the message subpackets through the external network end;

[0176] Each of the message packets and the corresponding packet protocol header are encapsulated through the external network end to generate the corresponding message packet.

[0177] Based on the above embodiment, in this embodiment, the subpacket protocol header at least includes: a subpacket identifier and a subpacket index number; wherein the subpacket identifiers of the message packets split from the same first target message are the same, and the subpacket index number is used to indicate the order of the message packets with the same subpacket identifier in the same first target message;

[0178] The device also includes a restoration module, which is specifically used for:

[0179] Dividing the message packets having the same subpacket identifier by the intranet end;

[0180] Sort the message packets having the same sub-packet identifier by the intranet terminal according to the sub-packet index number;

[0181] The sorted message packets are split into the packet protocol header and the message packets through the intranet end, and the message packets are reassembled to obtain the restored first target message.

[0182] Based on the above embodiment, in this embodiment, the device further includes a verification module, which is specifically used to:

[0183] After restoring the message packet through the intranet end to obtain the restored first target message, verifying the restored first target message through the intranet end, and if the verification passes, executing the step of parsing the restored first target message through the intranet end;

[0184] If the verification fails, the restored first target message is discarded.

[0185] Fig.11 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.11 As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120 and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 may call the logic instructions in the memory 1130 to execute a message import method based on a one-way network gate, wherein the external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types;

[0186] The method comprises:

[0187] Receiving a first target message sent by the first message processing system through the external network end, and sending the first target message to the internal network end;

[0188] Parsing the first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, to obtain a second target message; wherein the second message processing system supports the preset format;

[0189] The second target message is sent to the second message processing system through the intranet terminal.

[0190] In addition, the logic instructions in the above-mentioned memory 1130 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0191] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the message import method based on the one-way network gate provided by the above methods, the external network end of the one-way network gate is connected to a first message processing system, the internal network end of the one-way network gate is connected to a second message processing system, the first message processing system and the second message processing system support different message types;

[0192] The method comprises:

[0193] Receiving a first target message sent by the first message processing system through the external network end, and sending the first target message to the internal network end;

[0194] Parsing the first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, to obtain a second target message; wherein the second message processing system supports the preset format;

[0195] The second target message is sent to the second message processing system through the intranet terminal.

[0196] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the message import method based on a one-way network gate provided by the above methods is implemented, wherein the external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types;

[0197] The method comprises:

[0198] Receiving a first target message sent by the first message processing system through the external network end, and sending the first target message to the internal network end;

[0199] Parsing the first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, to obtain a second target message; wherein the second message processing system supports the preset format;

[0200] The second target message is sent to the second message processing system through the intranet terminal.

[0201] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0202] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A message import method based on a one-way network gate, characterized in that: The external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types; The method comprises: Receiving a first target message sent by the first message processing system through the external network end, and sending the first target message to the internal network end; Parsing the first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, to obtain a second target message; wherein the second message processing system supports the preset format; The second target message is sent to the second message processing system through the intranet terminal.

2. The message import method based on a one-way network gate according to claim 1 is characterized in that: The first message processing system includes a data collection service; The receiving, through the external network end, the first target message sent by the first message processing system includes: A first target message sent by the data collection service is received through the external network terminal; wherein the first target message is generated by the data collection service by encapsulating the collected original data message according to an initial preset format.

3. The message import method based on a one-way network gate according to claim 2 is characterized in that: The sending the first target message to the intranet terminal includes: Each of the first target messages is split through the external network end to generate a message packet, and the message packet is sent to the internal network end.

4. The message import method based on a one-way network gate according to claim 3 is characterized in that: The second message processing system includes a plurality of message clusters, each of the message clusters having a corresponding topic type; The step of parsing the first target message through the intranet terminal and converting the format of the first target message into a preset format according to the parsing result to obtain the second target message includes: Restore the message packet through the intranet end to obtain a restored first target message; wherein the first target message carries a corresponding topic type; The restored first target message is parsed through the intranet terminal, and the format of the first target message is converted into a preset format according to the parsing result to obtain a second target message; wherein the second target message carries the same subject type as the first target message; The sending the second target message to the second message processing system through the intranet terminal includes: According to the topic type, the second target message is sent to a target message cluster corresponding to the topic type through the intranet terminal.

5. The message import method based on a one-way network gate according to claim 4 is characterized in that: Before sending the second target message to the target message cluster corresponding to the topic type through the intranet terminal, the method further includes: The intranet terminal performs identity authentication with the intranet server according to the preloaded certificate file. If the authentication is successful, an intranet session channel is established between the intranet terminal and the message cluster.

6. The message import method based on a one-way network gate according to claim 5 is characterized in that: Each of the first target messages also carries a corresponding message length and a message body; The step of parsing the restored first target message through the intranet terminal, converting the format of the first target message into a preset format according to the parsing result, and obtaining the second target message includes: Parsing the restored first target message through the intranet end to obtain a parsing result, wherein the parsing result includes a subject type, a message length, and a message body carried by the first target message; Generate a second target message header according to the topic type and the message length; Generate the message content of the second target message based on the second target message header and the message body, convert the message content of the second target message into a preset format supported by the second message processing system, and obtain the second target message; The sending, according to the topic type, through the intranet end, the second target message to a target message cluster corresponding to the topic type includes: According to the second target message header, the second target message is sent to the target message cluster corresponding to the second target message header through the target intranet session channel.

7. The message import method based on a one-way network gate according to claim 3 is characterized in that: The step of splitting each of the first target messages through the external network end to generate a message packet includes: Splitting each of the first target messages into at least one message packet according to a preset size through the external network end; Adding a subpacket protocol header to each of the message subpackets through the external network end; Each of the message packets and the corresponding packet protocol header are encapsulated through the external network end to generate the corresponding message packet.

8. The message import method based on a one-way network gate according to claim 7 is characterized in that: The subpacket protocol header at least includes: a subpacket identifier and a subpacket index number; wherein the subpacket identifiers of the message packets split from the same first target message are the same, and the subpacket index number is used to indicate the order of the message packets with the same subpacket identifier in the same first target message; The restoring the message packet through the intranet terminal to obtain the restored first target message includes: Dividing the message packets having the same subpacket identifier by the intranet end; Sort the message packets having the same sub-packet identifier by the intranet terminal according to the sub-packet index number; The sorted message packets are split into the packet protocol header and the message packets through the intranet end, and the message packets are reassembled to obtain the restored first target message.

9. The message import method based on a one-way network gate according to claim 4 is characterized in that: After restoring the message packet through the intranet terminal to obtain the restored first target message, the method further includes: Verifying the restored first target message through the intranet end, and if the verification passes, executing the step of parsing the restored first target message through the intranet end; If the verification fails, the restored first target message is discarded.

10. A message import device based on a one-way network gate, characterized in that: The external network end of the one-way network gate is connected to a first message processing system, and the internal network end of the one-way network gate is connected to a second message processing system, and the first message processing system and the second message processing system support different message types; The device comprises: A receiving module, configured to receive a first target message sent by the first message processing system through the external network end, and send the first target message to the internal network end; A parsing module, used to parse the first target message through the intranet terminal, and convert the format of the first target message into a preset format according to the parsing result to obtain a second target message; wherein the second message processing system supports the preset format; A sending module is used to send the second target message to the second message processing system through the intranet terminal.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the message import method based on a one-way firewall as described in any one of claims 1 to 9 is implemented.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the message import method based on a one-way firewall as claimed in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • System and method for realizing unidirectional data transmission by using reverse gatekeeper

    CN114666150A

  • Distributed message distribution system and method supporting cross-network transmission

    CN115459938A