A message processing method, apparatus, storage medium, and device

By dynamically adjusting the frame gap value in a one-way transmission system, the problems of packet loss and low reliability in a one-way transmission system are solved, and higher transmission reliability is achieved.

CN116016359BActive Publication Date: 2025-06-24BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211601433.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2025-06-24
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

One-way transmission systems are prone to packet loss during data transmission, resulting in low reliability of one-way transmission.

Method used

By obtaining the message type and message size of the message to be sent, the deviation gap value is determined, which is negatively correlated with the message size. Then, based on the deviation gap value and the base frame gap value, the dynamic frame gap value is determined, and the value is set in the protocol field of the message to cause the one-way transmission isolation card to send the message according to the dynamic frame gap value.

Benefits of technology

By dynamically adjusting the frame gap value, reasonably controlling the message sending speed, reducing the risk of loss caused by uncertain message size or mixing multiple types of messages, effectively improving the reliability of one-way transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016359B_ABST
    Figure CN116016359B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a message processing method, apparatus, storage medium, and device. In this method, a deviation gap value is determined according to the message type and message size of the message to be sent. The deviation gap value has a negative correlation with the message size. Then, a dynamic frame gap value is determined based on the deviation gap value and the basic frame gap value, and is set in the protocol field of the message to be sent, so that after the unidirectional isolation sending card obtains the message to be sent, the message is sent according to the dynamic frame gap value. In this way, since the dynamic frame gap is obtained by dynamically adjusting the basic frame gap in combination with the message type and message size, the message sending speed controlled by this dynamic frame gap value is more reasonable, reducing the risk of message loss caused by uncertain message sizes or a mixture of multiple types of messages, thereby effectively improving the reliability of unidirectional transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data transmission. Specifically, it relates to a message processing method, apparatus, storage medium, and device. Background Art

[0002] A unidirectional transmission system is a tool for realizing the unidirectional transmission of data from a low-security domain to a high-security domain. Its hardware architecture usually consists of an external machine, an internal machine, and a unidirectional isolation component. Among them, the unidirectional isolation component is composed of a unidirectional sending isolation card and a unidirectional receiving isolation card. Since the unidirectional transmission system follows a unidirectional non-feedback data transmission method, it is difficult to ensure no packet loss during the data transmission process, and the reliability of data transmission is difficult to guarantee.

[0003] Currently, the solutions adopted in the related art mainly use general traffic control technologies in application software or drivers, such as the leaky bucket algorithm or the token bucket algorithm, etc., to control the traffic of the external machine sending messages. When the size of the data message is constant, this method can better control the sending speed, thereby improving the reliability of unidirectional transmission. However, when the message size is not fixed, the traffic is not stable, and there is easily a phenomenon of a very high number of messages sent within a short period of time. This phenomenon will cause pressure on the unidirectional receiving isolation card of the internal machine, resulting in lost messages and a decrease in the reliability of unidirectional transmission. Summary of the Invention

[0004] The purpose of the embodiments of this application is to provide a message processing method, apparatus, storage medium, and device, aiming to solve the problem of easy packet loss and low reliability of unidirectional transmission existing in the related art.

[0005] In a first aspect, a message processing method provided by the embodiments of this application includes:

[0006] Obtain a message to be sent, and determine a deviation gap value according to the message type and message size of the message to be sent. The deviation gap value has a negative correlation with the message size;

[0007] Based on the deviation gap value and a basic frame gap value, determine a dynamic frame gap value;

[0008] After setting the dynamic frame gap value in the protocol field of the message to be sent, transmit the message to be sent to a unidirectional sending isolation card, so that the unidirectional sending isolation card sends the message according to the dynamic frame gap value.

[0009] In the above implementation process, the deviation gap value is determined according to the message type and message size of the message to be sent. The deviation gap value has a negative correlation with the message size. Then, based on the deviation gap value and the basic frame gap value, the dynamic frame gap value is determined and set in the protocol field of the message to be sent, so that after the unidirectional isolation sending card obtains the message to be sent, the message is sent according to the dynamic frame gap value. In this way, since the dynamic frame gap is obtained by dynamically adjusting the basic frame gap in combination with the message type and message size, the message sending speed controlled by this dynamic frame gap value is more reasonable, reducing the risk of message loss caused by uncertain message sizes or a mixture of multiple types of messages, thus effectively improving the reliability of unidirectional transmission.

[0010] Further, in some embodiments, the determining the deviation gap value according to the message type and message size of the message to be sent includes:

[0011] Determining a first deviation gap value according to the message type of the message to be sent;

[0012] Determining a second deviation gap value based on the ratio of the message size to a preset value;

[0013] Adding the first deviation gap value and the second deviation gap value to obtain the deviation gap value.

[0014] In the above implementation process, a specific method for dynamically adjusting the frame gap according to the message type and message size is provided, that is, when dynamically adjusting the frame gap, a deviation value is determined according to the message type, another deviation value is determined according to the message size, and the sum of the two deviation values is used as the deviation gap value.

[0015] Further, in some embodiments, the determining the first deviation gap value according to the message type of the message to be sent includes:

[0016] If the message to be sent is a file transfer type message, determining the first deviation gap value as a first value;

[0017] If the message to be sent is a mail transfer type message, determining the first deviation gap value as a second value;

[0018] If the message to be sent is a database transfer type message, determining the first deviation gap value as a third value;

[0019] If the message to be sent is a UDP type message, determining the first deviation gap value as a fourth value;

[0020] Wherein, the first value is greater than the second value, the second value is greater than the third value, and the third value is greater than the fourth value.

[0021] In the above implementation process, different first deviation gap values are set according to the influence degrees of different message types, thereby effectively reducing the risk of lost messages caused by mixed messages.

[0022] Further, in some embodiments, determining the second deviation gap value based on the ratio of the message size to a preset value includes:

[0023] If the ratio of the message size to the preset value is less than 1, determine the second deviation gap value as the preset maximum value.

[0024] In the above implementation process, the value range of the second deviation gap value is set from 0 to the preset maximum value. As long as the total length of the message is less than the preset value, the second deviation gap value is the preset maximum value. In this way, the smoothness of the CPU of the inner terminal when processing small messages is ensured.

[0025] Further, in some embodiments, the preset maximum value is determined based on the target performance parameters of the receiving-end device of the message to be sent, and the target performance parameters include CPU throughput and average latency duration.

[0026] In the above implementation process, the maximum positive deviation value of the message size is set according to the device performance of the inner terminal, so as to more reasonably dynamically adjust the frame gap, thereby effectively improving the reliability of message transmission.

[0027] Further, in some embodiments, determining the dynamic frame gap value based on the deviation gap value and the basic frame gap value includes:

[0028] Add the deviation gap value and the basic frame gap value to obtain the dynamic frame gap value.

[0029] In the above implementation process, a specific method for determining the dynamic frame gap value is provided, that is, the frame gap value is dynamically adjusted by direct addition.

[0030] Further, in some embodiments, the one-way sending isolation card sends messages according to the dynamic frame gap value, including:

[0031] The one-way sending isolation card transmits the message to be sent to the one-way receiving isolation card, and after waiting for the duration corresponding to the dynamic frame gap value, transmits the next message to the one-way receiving isolation card.

[0032] In the above implementation process, the unidirectional sending isolation card uses the dynamic frame gap value set in the message protocol field as the time interval between sending the current message and the next message. Since this time interval is dynamically adjusted according to the message type and message size, the sending speed of the unidirectional sending isolation card is more reasonable, reducing the risk of message loss caused by variable message sizes or mixed messages, and improving the reliability of unidirectional transmission.

[0033] In a second aspect, a message processing device provided by an embodiment of the present application includes:

[0034] An acquisition module, configured to acquire a message to be sent, and determine a deviation gap value according to the message type and message size of the message to be sent, where the deviation gap value has a negative correlation with the message size;

[0035] A determination module, configured to determine a dynamic frame gap value based on the deviation gap value and a basic frame gap value;

[0036] A setting module, configured to set the dynamic frame gap value in the protocol field of the message to be sent, and then transmit the message to be sent to the unidirectional sending isolation card, so that the unidirectional sending isolation card sends the message according to the dynamic frame gap value.

[0037] In a third aspect, an electronic device provided by an embodiment of the present application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method according to any one of the first aspects are implemented.

[0038] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present application has instructions stored thereon. When the instructions are run on a computer, the computer is caused to execute the method according to any one of the first aspects.

[0039] In a fifth aspect, a computer program product provided by an embodiment of the present application, when run on a computer, causes the computer to execute the method according to any one of the first aspects.

[0040] Other features and advantages disclosed in the present application will be described in the subsequent specification, or some features and advantages can be inferred from the specification without doubt, or can be known by implementing the above technologies disclosed in the present application.

[0041] To make the above objects, features, and advantages of the present application more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings

[0042] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0043] Figure 1 It is a flowchart of a message processing method provided by an embodiment of the present application;

[0044] Figure 2 It is a schematic diagram of a solution for controlling the sending speed of an isolation card based on dynamic frame gap parameters provided by an embodiment of the present application;

[0045] Figure 3 It is a block diagram of a message processing device provided by an embodiment of the present application;

[0046] Figure 4 It is a block diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0047] The following will describe the technical solutions in the embodiments of the present application in combination with the accompanying drawings in the embodiments of the present application.

[0048] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, terms such as "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0049] As recorded in the background art, there are problems of easy packet loss and low reliability of unidirectional transmission in the related art. Based on this, the embodiments of the present application provide a message processing solution to solve the above problems.

[0050] Next, the embodiments of the present application will be introduced:

[0051] As Figure 1 shown, Figure 1It is a flowchart of a message processing method provided by an embodiment of the present application. The method can be applied to an external machine of a unidirectional transmission system. Here, the unidirectional transmission system can be a unidirectional optical switch, which is a unidirectional isolation software and hardware system developed on the basis of a security isolation gateway and based on the unidirectionality of light. When the unidirectional transmission system is deployed between an internal network and an external network, the external machine here can refer to a device deployed in the external network and having independent storage and computing units, such as a business system, a database server, a file server, etc. Correspondingly, the internal machine can be a device deployed in the internal network and having independent storage and computing units. The internal and external machines are connected by a physical unidirectional isolation component to provide security for the system. When implemented, the method can be embedded in the application software or driver of the external machine in the form of a component.

[0052] The method includes:

[0053] In step 101, obtain a message to be sent, and determine a deviation gap value according to the message type and message size of the message to be sent. The deviation gap value has a negative correlation with the message size;

[0054] The message to be sent mentioned in this step can refer to an application message collected from the external network and to be sent to the internal network. When the unidirectional sending isolation card sends a message, it will ensure that there is a certain time gap between messages, that is, a frame gap. The solution of this embodiment calculates the most reliable message frame gap according to the message type and message size, so as to solve the problem of data loss of the internal machine caused by the message burst speed.

[0055] Specifically, when implemented, first determine the deviation gap value according to the message type and message size. This deviation gap value can be considered as the deviation value used by the external machine for dynamically adjusting the basic frame gap. Among them, this deviation gap value has a negative correlation with the message size. The message size can refer to the total length of the message. That is to say, the smaller the total length of the message to be sent, the larger the deviation gap value. In the related art, when the traffic control speed is constant, the smaller the total length of the sent message, the larger the number of messages sent per second, and the smaller the frame gap. In actual applications, the processing logic of the unidirectional receiving isolation card generally does not check the frame gap and batches and receives messages at the limit. This leads to the situation that when the messages sent by the external machine are all relatively small messages, the CPU (Central Processing Unit) of the internal machine processes services unstably, and it is easy to fail to receive the messages of the unidirectional receiving isolation card in time, resulting in message loss. Therefore, in the solution of this embodiment, when the external machine is dealing with relatively small messages, a larger deviation gap value can be set, so that the unidirectional sending isolation card controls the message sending speed based on a larger frame gap value, thereby reducing the risk of message loss.

[0056] In some embodiments, determining the deviation gap value according to the message type and message size of the message to be sent in this step may include: determining a first deviation gap value according to the message type of the message to be sent; determining a second deviation gap value based on the ratio of the message size to a preset value; adding the first deviation gap value and the second deviation gap value to obtain the deviation gap value. That is to say, when dynamically adjusting the frame gap, a deviation value is determined according to the message type, and another deviation value is determined according to the message size, and the sum of the two deviation values is used as the deviation gap value.

[0057] Specifically, when dynamically adjusting the frame gap according to the message type, different message types may correspond to different first deviation gap values, because the time consumed by the inner terminal to process the services of different message types is different. Therefore, such a setting can, to a certain extent, reduce the risk of message loss. The function of this first deviation gap value is to add a positive deviation of the message type to the basic frame gap. Further, in some embodiments, if the message to be sent is a file transfer message, the first deviation gap value is determined to be a first value; if the message to be sent is an email transfer message, the first deviation gap value is determined to be a second value; if the message to be sent is a database transfer message, the first deviation gap value is determined to be a third value; if the message to be sent is a UDP message, the first deviation gap value is determined to be a fourth value; among them, these four values are sorted in descending order of magnitude as: the first value, the second value, the third value, and the fourth value. It has been found through research that I / O (Input / Output) congestion is likely to occur when processing file transfer messages. Therefore, if the one-way sending isolation card sends file transfer messages based on a larger frame gap value, the reliability of message transmission can be improved. By analogy, according to the influence degree of different message types, setting the positive deviation of file transfer messages to be greater than the positive deviation of email transfer messages, the positive deviation of email transfer messages to be greater than the positive deviation of database transfer messages, and the positive deviation of database transfer messages to be greater than the positive deviation of UDP messages can effectively reduce the risk of lost messages caused by mixed messages. Optionally, the first value may be 10, the second value may be 6, the third value may be 5, and the fourth value may be 1. Here, the unit of the first deviation gap value is the parameter value corresponding to the frame gap field of the message header, and the parameter value range is 0 to 255. The one-way sending isolation card will convert it into the unit of microseconds or nanoseconds according to the pre-set conversion logic during processing. And through experiments, it is confirmed that by setting the above values, the message loss rate can be effectively reduced.

[0058] When dynamically adjusting the frame gap according to the message size, the second deviation gap value is determined based on the ratio of the message size to a preset value. The function of this second deviation gap value is to add a positive deviation of the message size to the basic frame gap. Here, the preset value can be considered as the order of magnitude to control this positive deviation. Further, in some embodiments, if the ratio of the message size to the preset value is less than 1, the second deviation gap value is determined to be the preset maximum value. That is to say, the value range of the second deviation gap value is from 0 to the preset maximum value. As long as the total length of the message is less than the preset value, the second deviation gap value is the preset maximum value. In this way, the smoothness of the CPU of the inner terminal when processing small messages is ensured. In addition, if the ratio of the message size to the preset value is greater than the preset ratio, the second deviation gap value can be determined to be zero. For example, if the preset value is 100 bytes and the preset ratio is 15.14, then when the message size exceeds 1514 bytes, the positive deviation of the message size is 0.

[0059] Furthermore, the preset maximum value can be determined based on the target performance parameters of the receiving device of the message to be sent, and the target performance parameters include CPU throughput and average latency. That is to say, the maximum value of the positive deviation of the message size is set according to the device performance of the inner terminal. For example, when it is determined that the inner terminal is a high-end device based on the CPU throughput and average latency of the inner terminal, at this time, the inner terminal has a strong processing ability for a large number of small messages. Therefore, the maximum value of the positive deviation of the message size can be reduced. And when it is determined that the inner terminal is a low-end device based on the CPU throughput and average latency of the inner terminal, at this time, the inner terminal has a poor processing ability for a large number of small messages. Therefore, the maximum value of the positive deviation of the message size can be increased. In this way, by reasonably dynamically adjusting the frame gap, the reliability of message transmission is effectively improved. Of course, in other embodiments, other performance parameters can also be used to reflect the device performance of the inner terminal.

[0060] After obtaining the first deviation gap value and the second deviation gap value, adding these two values can obtain the deviation gap value. Of course, in other embodiments, the deviation gap value can also be calculated according to the requirements of the specific scenario. For example, converting the first deviation gap value into a weight and multiplying it by the second deviation gap value to obtain the deviation gap value.

[0061] In step 102, based on the deviation gap value and the basic frame gap value, determine the dynamic frame gap value;

[0062] The basic frame gap value mentioned in this step can be determined by the outer terminal according to the traditional frame gap setting method. In actual applications, after a device receives a frame, it needs a short period of time to recover and prepare for receiving the next frame. Different media and different hardware clocks and other factors cause differences in the value of the frame gap. The value of the frame gap adjusted by the device through these factors is used as the basic frame gap value.

[0063] In the solution of this embodiment, based on the base frame gap value, dynamic adjustment is performed according to the message type and message size of the message to be sent. In some embodiments, this step may include: adding the deviation gap value and the base frame gap value to obtain the dynamic frame gap value. That is to say, the frame gap value is dynamically adjusted by direct addition. For example, if the deviation gap value is 16 and the base frame gap value is 120, the obtained dynamic frame gap value after adjustment is 136. Of course, in other embodiments, other methods may also be used to obtain the dynamic frame gap value, such as multiplying the deviation gap value and the base frame gap value by their respective weights and then adding them, etc.

[0064] In step 103, after setting the dynamic frame gap value in the protocol field of the message to be sent, the message to be sent is transmitted to the unidirectional sending isolation card, so that the unidirectional sending isolation card sends the message according to the dynamic frame gap value.

[0065] The protocol field mentioned in this step may refer to the protocol header field of the unidirectional private protocol. In practical applications, the protocol header of the message's unidirectional private protocol includes key fields such as batch number field, frame gap field, application type field, message field, data length field, etc. Among them, the batch number field is used to describe the sending batch; the frame gap field is used to describe the frame gap parameter; the application type field is used to describe the business message type of unidirectional transmission, which is set by the application software; the message field is used to describe the communication message of the unidirectional private protocol; the data length is used to describe the data size of unidirectional transmission, which is also set by the application software. In the solution of this embodiment, after the external machine calculates the dynamic frame gap value according to the message type and message size, the dynamic frame gap value is set in the message's unidirectional private protocol. In addition, the external machine can also set other fields. For example, when there are one million messages waiting to be sent in the queue, the external machine dynamically selects a certain number according to the budget value and sets an accumulated batch number in the protocol field.

[0066] After setting the dynamic frame gap value in the protocol field of the message to be sent, the external terminal transmits the message to be sent to the unidirectional transmission isolation card. After the FPGA (Field Programmable Gate Array) chip of the unidirectional transmission isolation card obtains the message to be sent through DMA (Direct Memory Access), it detects the dynamic frame gap value in the message to be sent and sends the message according to the dynamic frame gap value. In some embodiments, the unidirectional transmission isolation card sending the message according to the dynamic frame gap value may include: the unidirectional transmission isolation card transmits the message to be sent to the unidirectional reception isolation card, waits for the duration corresponding to the dynamic frame gap value, and then transmits the next message to the unidirectional reception isolation card. That is to say, the unidirectional transmission isolation card uses the dynamic frame gap value set in the unidirectional private protocol as the time interval between sending the current message and the next message. Since this time interval is dynamically adjusted according to the message type and message size, the sending speed of the unidirectional transmission isolation card is more reasonable, reducing the risk of message loss caused by variable message sizes or mixed messages, and improving the reliability of unidirectional transmission.

[0067] It should be noted that when implementing the solution of this embodiment, a network card based on an FPGA chip can also be used to replace the unidirectional transmission isolation card. Specifically, the FPGA logic is set to check the dynamic frame gap value in the protocol field of the message to be sent after obtaining the message to be sent through DMA, and send the message according to the dynamic frame gap value.

[0068] In the embodiment of the present application, the deviation gap value is determined according to the message type and message size of the message to be sent. The deviation gap value has a negative correlation with the message size. Then, based on the deviation gap value and the basic frame gap value, the dynamic frame gap value is determined and set in the protocol field of the message to be sent, so that after the unidirectional isolation transmission card obtains the message to be sent, it sends the message according to the dynamic frame gap value. In this way, since the dynamic frame gap frame is dynamically adjusted by combining the message type and message size on the basis of the basic frame gap, the message sending speed controlled by this dynamic frame gap value is more reasonable, reducing the risk of message loss caused by variable message sizes or a mixture of multiple types of messages, thus effectively improving the reliability of unidirectional transmission.

[0069] To describe the solution of the present application in more detail, a specific embodiment will be introduced next:

[0070] In the field of network information security, a one-way optical gateway is deployed between networks with different security levels. Through a one-way non-feedback transmission physical environment, data is unidirectionally transmitted from a low-security domain to a high-security domain. Since the one-way transmission system follows the one-way non-feedback data transmission method, it is difficult to ensure no packet loss during the data transmission process. Therefore, it is necessary to improve the reliability of one-way data transmission as much as possible and reduce the probability of lost data. In related technologies, traffic control technologies such as the leaky bucket algorithm or the token bucket algorithm are mainly used in application software or drivers to control the traffic of the sending-end device sending packets. However, this method can only achieve good results when the data packet size is constant. In the case of multiple applications, multiple connections, and variable packet sizes, the reliability of its one-way transmission will decrease.

[0071] Through research, it is found that the reason for the low reliability of one-way transmission is as follows: When the one-way isolation card sends packets, it will ensure a certain time interval between packets, that is, the frame gap. As the number of packets sent per second increases, the frame gap will become smaller and smaller. When the device uses a general traffic control technology, if the packet size is variable, the traffic is not stable, and there will be a particularly high number of packets sent in a short period of time. For example, assuming that the traffic control speed is 100 Mbps (megabits per second), when a 1000-byte packet is sent at a certain moment, the number of packets sent per second is 100,000 packets, and when a 100-byte packet is sent at the next moment, the number of packets sent per second increases to 1,000,000 packets. At this time, the frame gap is reduced by 10 times. Especially when two types of packets are mixed, it will cause the number of packets sent per second to fluctuate between 100,000 and 1,000,000. This phenomenon will put pressure on the one-way receiving isolation card of the inner terminal machine, easily cause packet loss, and reduce the reliability.

[0072] Based on this, this embodiment provides a Figure 2 scheme for controlling the sending speed of the isolation card based on dynamic frame gap parameters as shown in the figure. It involves a one-way transmission system composed of an outer terminal machine 21, a one-way sending isolation card 22, a one-way sending isolation card 23, and an inner terminal machine 24. The processing flow of this one-way transmission system includes:

[0073] S201. The outer terminal machine 21 obtains the packets to be sent;

[0074] S202. The outer terminal machine 21 calculates the dynamic frame gap value according to the packet type and packet size of the packets to be sent. Specifically, the dynamic frame gap value = basic frame gap value + packet type deviation value + packet size deviation value, where the basic frame gap value is a value determined by the device according to factors such as the medium and the hardware clock;

[0075] And under the same hardware platform, the positive deviation situations of various application type packets can be:

[0076] If the message to be sent is a file transfer message, the message type deviation value = 10; if the message to be sent is a database transfer message, the message type deviation value = 5; if the message to be sent is a mail transfer message, the message type deviation value = 6; if the message to be sent is a UDP message, the message type deviation value = 1;

[0077] Under the same hardware platform, the positive deviation situations for various message sizes can be:

[0078] The message size deviation value = f(x), where x is the integer part of the quotient obtained by dividing the message size by 100. If x = 0, the message size deviation value = 15; if x = 1, the message size deviation value = 14; and so on. If x = 15, the message size deviation value = 0; when the message size exceeds 1514 bytes, the message size is confirmed as 1514 bytes during the calculation of x;

[0079] S203. The external terminal 21 sets the dynamic frame gap value in the private protocol field of the message to be sent;

[0080] S204. The external terminal 21 transmits the message to be sent to the unidirectional sending isolation card 22;

[0081] S205. After the FPGA chip of the unidirectional sending isolation card 22 obtains the message to be sent through DMA, it checks the dynamic frame gap value in the message to be sent;

[0082] S206. After the unidirectional sending isolation card 22 passes the message to be sent to the unidirectional receiving isolation card, it waits for the duration corresponding to the dynamic frame gap value and then continues to send the next message;

[0083] S207. The unidirectional receiving isolation card 23 receives messages to the limit;

[0084] S208. The unidirectional receiving isolation card 23 passes the received message to the internal terminal 24 for processing.

[0085] The solution of the embodiment of the present application improves the message transmission smoothness of the unidirectional isolation card and reduces the risk of message loss caused by mixed messages through the technologies of dynamically budgeting the frame gap, setting message protocol sending parameters, and controlling the message sending speed by FPGA, thereby improving the reliability of the unidirectional optical switch in providing services externally and reducing the system operation and maintenance costs at the same time.

[0086] Corresponding to the embodiment of the foregoing method, the present application also provides an embodiment of a message processing device and a terminal to which it is applied:

[0087] As Figure 3 shown, Figure 3 is a block diagram of a message processing device provided by an embodiment of the present application. The device includes:

[0088] An acquisition module 31, configured to acquire a message to be sent, and determine a deviation gap value according to the message type and message size of the message to be sent, where the deviation gap value has a negative correlation with the message size;

[0089] A determination module 32, configured to determine a dynamic frame gap value based on the deviation gap value and a basic frame gap value;

[0090] A setting module 33, configured to set the dynamic frame gap value in the protocol field of the message to be sent, and then transmit the message to be sent to a unidirectional transmission isolation card, so that the unidirectional transmission isolation card sends the message according to the dynamic frame gap value.

[0091] For the implementation processes of the functions and roles of each module in the above device, please refer to the implementation processes of the corresponding steps in the above method for details, which will not be elaborated here.

[0092] This application also provides an electronic device. Please refer to Figure 4 , Figure 4 which is a structural block diagram of an electronic device provided by an embodiment of this application. The electronic device may include a processor 410, a communication interface 420, a memory 430, and at least one communication bus 440. Among them, the communication bus 440 is used to implement direct connection communication between these components. Among them, the communication interface 420 of the electronic device in the embodiment of this application is used to perform signaling or data communication with other node devices. The processor 410 may be an integrated circuit chip with signal processing capabilities.

[0093] The above-mentioned processor 410 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The processor 410 may be a microprocessor, or the processor 410 may also be any conventional processor, etc.

[0094] The memory 430 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. Computer-readable instructions are stored in the memory 430. When the computer-readable instructions are executed by the processor 410, the electronic device can perform the above-mentioned Figure 1 each step involved in the method embodiment.

[0095] Optionally, the electronic device may further include a storage controller and an input / output unit.

[0096] The memory 430, the storage controller, the processor 410, the peripheral interface, and the input / output unit are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 440. The processor 410 is configured to execute an executable module stored in the memory 430, such as a software function module or a computer program included in the electronic device.

[0097] The input / output unit is used to provide the user with the creation of tasks and the creation of a start optional period or a preset execution time for the task to achieve the interaction between the user and the server. The input / output unit can be, but is not limited to, a mouse, a keyboard, etc.

[0098] It can be understood that Figure 4 the structure shown is only schematic, and the electronic device may further include more or fewer components than those shown in Figure 4 or have a different configuration from that shown in Figure 4 The components shown in. Figure 4 The components shown in can be implemented by hardware, software, or a combination thereof.

[0099] The embodiment of the present application further provides a storage medium, on which instructions are stored. When the instructions are run on a computer, the computer program is executed by the processor to implement the method described in the method embodiment. To avoid repetition, it will not be elaborated here.

[0100] The present application also provides a computer program product. When the computer program product runs on a computer, the computer is caused to execute the method described in the method embodiment.

[0101] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0102] In addition, the functional modules in each embodiment of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.

[0103] If the described functions are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0104] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application. It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0105] As described above, these are only the specific implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, and all of them should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0106] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

Claims

1. A message processing method, characterized in that, Including: Obtain the message to be sent, and determine a deviation gap value according to the message type and message size of the message to be sent, where the deviation gap value has a negative correlation with the message size; Determine a dynamic frame gap value based on the deviation gap value and a basic frame gap value; After setting the dynamic frame gap value in the protocol field of the message to be sent, transmit the message to be sent to a unidirectional transmission isolation card, so that the unidirectional transmission isolation card sends the message according to the dynamic frame gap value; The determining a deviation gap value according to the message type and message size of the message to be sent includes: Determine a first deviation gap value according to the message type of the message to be sent; Determine a second deviation gap value based on the ratio of the message size to a preset value; Add the first deviation gap value and the second deviation gap value to obtain a deviation gap value.

2. The method according to claim 1, characterized in that The determining a first deviation gap value according to the message type of the message to be sent includes: If the message to be sent is a file transfer message, determine that the first deviation gap value is a first value; If the message to be sent is an email transfer message, determine that the first deviation gap value is a second value; If the message to be sent is a database transfer message, determine that the first deviation gap value is a third value; If the message to be sent is a UDP message, determine that the first deviation gap value is a fourth value; Wherein, the first value is greater than the second value, the second value is greater than the third value, and the third value is greater than the fourth value.

3. The method according to claim 1, wherein The determining a second deviation gap value based on the ratio of the message size to a preset value includes: If the ratio of the message size to the preset value is less than 1, determine that the second deviation gap value is a preset maximum value.

4. The method according to claim 3, wherein The preset maximum value is determined based on the target performance parameters of the receiving device of the message to be sent, and the target performance parameters include CPU throughput and average latency duration.

5. The method according to claim 1, characterized in that The determining a dynamic frame gap value based on the deviation gap value and a basic frame gap value includes: Add the deviation gap value and the basic frame gap value to obtain a dynamic frame gap value.

6. The method according to claim 1, wherein The unidirectional transmission isolation card sending the message according to the dynamic frame gap value includes: The unidirectional transmission isolation card transmits the message to be sent to a unidirectional reception isolation card, waits for the duration corresponding to the dynamic frame gap value, and then transmits the next message to the unidirectional reception isolation card.

7. A message processing device, characterized in that, Including: An obtaining module, configured to obtain the message to be sent, and determine a deviation gap value according to the message type and message size of the message to be sent, where the deviation gap value has a negative correlation with the message size; A determining module, configured to determine a dynamic frame gap value based on the deviation gap value and a basic frame gap value; A setting module, configured to, after setting the dynamic frame gap value in the protocol field of the message to be sent, transmit the message to be sent to a unidirectional transmission isolation card, so that the unidirectional transmission isolation card sends the message according to the dynamic frame gap value; The obtaining module is specifically configured to: determine a first deviation gap value according to the message type of the message to be sent; determine a second deviation gap value based on the ratio of the message size to a preset value; and add the first deviation gap value and the second deviation gap value to obtain a deviation gap value.

8. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored on the memory and executable on the processor. Wherein, when the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Message transmission method and device, electronic equipment and storage medium

    CN115426689A