One-way shutter deterministic data transmission method and system

By introducing dynamic weighting and time slot scheduling mechanisms into the unidirectional optical shutter hardware, combined with XDP technology, the deterministic and reliable data transmission issues of the unidirectional optical shutter were solved, achieving low-latency and low-jitter data transmission and improving transmission efficiency and reliability.

CN121547119BActive Publication Date: 2026-04-07SHANDONG ZHONGWANG YUNAN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing one-way optical gate data transmission technology is insufficient in terms of determinism, cost, flexibility and reliability, and cannot meet the data exchange needs between high-security and low-security networks.

Method used

By building a mechanism based on dynamic weights and time slot scheduling on standard hardware, using multiple memory pipes for data mapping and time slot allocation, and combining XDP technology to send data frames, custom header information is introduced to support data transmission in a feedback-free environment.

Benefits of technology

It achieves deterministic data transmission with low latency and low jitter, avoids starvation of low-priority services, reduces CPU load and transmission latency, and improves the reliability and throughput of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121547119B_ABST
    Figure CN121547119B_ABST
Patent Text Reader

Abstract

The present application relates to the field of digital information transmission, and relates to a one-way optical gate deterministic data transmission method and system.The method comprises: establishing a memory pipeline mapping, including: receiving source data and mapping the source data into a plurality of memory pipelines; performing a dynamic weight calculation step; performing a time slot allocation step; calculating the utilization rate according to the number of transmission time slots and the number of used time slots allocated to each memory pipeline; performing a pipeline selection and time slot scheduling step, including: when the current transmission time slot arrives, selecting the pipeline with the highest score from the plurality of memory pipelines as the best service pipeline; performing a data encapsulation and sending step, including: obtaining data from the best service pipeline, constructing a data frame by adding custom header information containing a nanosecond timestamp, and sending the data frame to the receiving end through XDP technology.The method for transmitting information according to the present application can realize low-delay, low-jitter deterministic transmission.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of digital information transmission. More particularly, the present application relates to a one-way optical gate deterministic data transmission method and system. BACKGROUND

[0002] With the rapid development of real-time businesses such as industrial internet, high-frequency trading in finance, cloud computing, and remote medical treatment, the requirement for determinism of data transmission is increasingly high, i.e., the network transmission is required to have a bounded latency and a very low jitter. In many network isolation scenarios, the one-way optical gate, as a physical layer one-way transmission security device, is widely used in data exchange between high-security level networks and low-security level networks.

[0003] However, the existing data transmission technology for the one-way optical gate mainly has the following significant problems:

[0004] Firstly, although the traditional hardware time-sensitive network (TSN) technology can provide nanosecond-level deterministic transmission, it depends on dedicated switch and network card hardware, which is costly and complex to deploy, and the hardware configuration is rigid, making it difficult to adapt to the dynamic changes of business traffic.

[0005] Secondly, the traditional software network scheme implemented on the standard hardware of general-purpose computers is limited by the kernel protocol stack of the operating system, and there is frequent memory copying and interrupt processing, resulting in an end-to-end delay usually in the range of 800-1500 μs, and a delay jitter as high as 200-500 μs, which cannot meet the microsecond-level deterministic requirement. Although the existing software-defined network (SDN) scheme optimizes the control plane, the data plane still cannot completely break through the performance bottleneck of the traditional protocol stack.

[0006] Especially crucially, in the specific application scenario of the one-way optical gate, due to the one-way nature of the physical link, the receiving end cannot return an acknowledgement (ACK) signal to the sending end, which makes the TCP protocol unable to work normally, and usually only the UDP protocol can be used. In the absence of a feedback mechanism, if different priority traffics compete at the optical gate entrance, the traditional UDP transmission is extremely easy to cause the "channel starvation" phenomenon of low-priority services, or to cause uncontrollable packet loss under burst traffic, which seriously affects the quality of service (QoS) and reliability of data transmission.

[0007] Therefore, there is an urgent need for a data transmission method that can achieve near hardware TSN deterministic performance on standard one-way optical gate hardware through software level, to solve the problem that the existing technology cannot balance between determinism, cost, flexibility, and one-way transmission reliability. SUMMARY

[0008] To address the problems of poor determinism, high cost, poor flexibility, and poor reliability of unidirectional transmission in the data transmission technology of existing unidirectional optical shutters, this invention provides solutions in the following aspects.

[0009] In a first aspect, the present invention provides a deterministic data transmission method for a one-way optical gate, comprising the following steps: receiving source data and mapping the source data to multiple memory channels, wherein the multiple memory channels correspond to different static priorities;

[0010] The dynamic weight of each memory pipe is calculated based on the static priority and real-time status of the multiple memory pipes.

[0011] The dynamic weight is used to determine the weight ratio of each active memory pipe in the total transmission resources, and the number of transmission slots to be allocated to each memory pipe is calculated based on the weight ratio and then allocated to the corresponding memory pipe.

[0012] Calculate the corresponding utilization rate based on the number of transmission time slots allocated to the memory pipeline and the number of time slots already used;

[0013] The process of selecting a pipeline and scheduling a time slot includes: when the current transmission time slot arrives, calculating the corresponding score based on the utilization rate of each memory pipeline, and then selecting the pipeline with the highest score from multiple memory pipelines as the best service pipeline; the score is negatively correlated with the utilization rate of the memory pipeline;

[0014] Data is obtained from the optimal service pipeline, a data frame is constructed by appending custom header information containing nanosecond-level timestamps, and the data frame is sent to the receiving end via XDP technology.

[0015] Preferably, the custom header information structure includes: a magic word field for identifying the legitimacy of the data packet; a pipe identifier field for indicating the memory pipe ID of the data source; a priority field for indicating the service level of the data; a sequence number field for recording the incrementing count value of the data to support out-of-order detection; and a timestamp field, including a high-order and low-order timestamp bits, for recording the nanosecond-level time when the data was sent.

[0016] Preferably, calculating the dynamic weight of each memory pipeline includes: calculating the starvation value of each memory pipeline, wherein the starvation value is obtained by adding the backlog factor and the time factor;

[0017] A dynamic weight is calculated based on the hunger value. This dynamic weight is limited by a maximum dynamic weight value. The expression for calculating the dynamic weight is as follows:

[0018] ;

[0019] In the formula, This represents the dynamic weight of the i-th memory pipe. Let represent the starvation value of the i-th memory pipe, and D represent the dynamic weighting factor.

[0020] Preferably, calculating the starvation value of each memory pipe includes: obtaining the current backlog of bytes and the maximum transfer unit (MTU) in the memory pipe, and then calculating the backlog factor, the corresponding calculation expression being:

[0021] ;

[0022] In the formula, This represents the build-up factor of the i-th memory pipe. Describes the minimum value function. This represents the current backlog of bytes in the i-th memory pipe. Indicates the number of bytes in the maximum transmission unit. Indicates the maximum backpacking factor;

[0023] Obtain the idle time in milliseconds of the memory pipe, and then calculate the time factor. The calculation expression is:

[0024] ;

[0025] In the formula, This represents the time factor of the i-th memory pipeline. This represents the idle time in milliseconds for the i-th memory pipe. Indicates the maximum time factor;

[0026] The corresponding hunger value is obtained by adding the backlog factor of the memory pipeline to the time factor.

[0027] Preferably, the calculation of the number of transmission time slots to be allocated to each memory pipe includes: counting the number of active pipes with currently backlogged data to be sent, and summing the dynamic weights of all active pipes to obtain the total weight;

[0028] If the number of active pipelines is not equal to 0, then the minimum number of time slots is calculated using the following expression:

[0029]

[0030] In the formula, Indicates the minimum number of time slots. Represents the maximum value function. Indicates the total number of time slots. Indicates the number of active pipelines;

[0031] Calculate the remaining number of time slots based on the minimum number of time slots. The calculation expression is:

[0032] ;

[0033] The overall weight is calculated based on the base weight of each memory pipeline. The calculation expression is as follows:

[0034] ;

[0035] In the formula, This represents the overall weight of the i-th memory pipeline; This represents the base weight of the i-th memory pipe;

[0036] The number of allocated time slots is calculated based on the combined weight of each memory pipeline. The calculation expression is as follows:

[0037]

[0038] This represents the number of allocation slots for the i-th memory pipe. This represents the total weight.

[0039] Preferably, the base weight of the memory pipeline is calculated based on the static priority of the memory pipeline, and the calculation expression is:

[0040] ;

[0041] In the formula, This represents the base weight of the i-th memory pipe. Indicates the maximum priority value. Let represent the static priority of the i-th memory pipe, and C represent the base weight factor.

[0042] Preferably, the scoring based on the utilization rate of each memory pipe includes:

[0043] The memory pipe utilization penalty value is calculated based on the memory pipe utilization rate. The calculation expression is as follows:

[0044] ;

[0045] In the formula, This represents the utilization penalty value of the i-th memory pipe. This represents the utilization rate of the i-th memory pipe;

[0046] The memory pipeline score is calculated based on the utilization penalty value. The calculation expression is as follows:

[0047] ;

[0048] In the formula, This represents the score of the i-th memory pipe. represents the maximum priority value, and F represents the static priority value.

[0049] Preferably, the execution pipeline selection and time slot scheduling step further includes empty time slot processing logic, including: initializing a continuous empty time slot counter; if no best service pipeline is selected under the current transmission time slot index, incrementing the current transmission time slot index and the continuous empty time slot counter; determining whether the continuous empty time slot counter has reached the maximum continuous empty time slot threshold; if the maximum continuous empty time slot threshold has not been reached, continuing to select pipelines for the next time slot; if the threshold has been reached, resetting the counter.

[0050] Preferably, the system further includes a status update step, comprising: if the data frame is successfully sent via XDP technology, incrementing the number of used time slots of the optimal service channel by one; recording the current timestamp as the last service time of the optimal service channel; decrementing the hunger value of the optimal service channel by one; and incrementing the transmission sequence number of the optimal service channel by one.

[0051] In a second aspect, the present invention provides a one-way optical shutter deterministic data transmission system, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the one-way optical shutter deterministic data transmission method of the present invention is implemented.

[0052] The beneficial effects of this invention are as follows: By constructing a mechanism based on "dynamic weighting" and "time slot scheduling" on standard hardware, this invention simulates the deterministic behavior of dedicated hardware TSN. By mapping source data to memory pipelines of different priorities and performing microsecond-level time slot scheduling based on utilization and dynamic weights, low-latency, low-jitter deterministic transmission is achieved, effectively solving the problem that standard hardware cannot provide bounded latency. Furthermore, unlike traditional scheduling based solely on static priorities, this invention introduces a "dynamic weighting" and "utilization" scoring mechanism. Even low-priority pipelines will receive higher weights as backlog and waiting time increase, ensuring that all services have a transmission opportunity and avoiding the "starvation" phenomenon where low-priority services cannot be sent for a long time in a one-way optical gate without feedback environment. Moreover, combined with XDP (eXpress Data Path) technology, zero-copy forwarding of data at the kernel layer is achieved, avoiding redundant processing in the operating system kernel protocol stack and significantly reducing CPU load and transmission latency. Attached Figure Description

[0053] Figure 1 This is a schematic flowchart illustrating a deterministic data transmission method for a unidirectional optical shutter according to an embodiment of the present invention;

[0054] Figure 2 This is a schematic diagram illustrating a custom header information structure according to an embodiment of the present invention;

[0055] Figure 3This is a schematic diagram illustrating the complete structure of a data frame according to an embodiment of the present invention;

[0056] Figure 4 This is a schematic diagram illustrating the structure of a unidirectional optical shutter deterministic data transmission system according to an embodiment of the present invention. Detailed Implementation

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0059] Example of a deterministic data transmission method for one-way optical shutters:

[0060] like Figure 1 As shown, the unidirectional optical shutter deterministic data transmission method of the present invention includes:

[0061] S101. Establishing a memory pipe mapping specifically includes: receiving source data and mapping the source data to multiple memory pipes, wherein the multiple memory pipes correspond to different static priorities;

[0062] A TCP server can be established at the sending end to receive the source data.

[0063] S102. Perform the dynamic weight calculation step, which specifically includes: calculating the dynamic weight of each memory pipe based on the static priority and real-time status of the plurality of memory pipes.

[0064] S103. Perform the time slot allocation step, which specifically includes: using the dynamic weight to determine the weight ratio of each active memory pipe in the total transmission resources, and calculating the number of transmission time slots to be allocated to each memory pipe according to the weight ratio and allocating them to the corresponding memory pipe.

[0065] S104. Calculate the corresponding utilization rate based on the number of transmission time slots allocated to each memory pipe and the number of time slots used;

[0066] In this embodiment, the utilization rate is equal to the number of used time slots divided by the number of transmission time slots allocated to the memory pipeline.

[0067] S105. Perform the pipeline selection and time slot scheduling steps, including: when the current transmission time slot arrives, calculate the corresponding score based on the utilization rate of each memory pipeline, and then select the pipeline with the highest score from multiple memory pipelines as the best service pipeline; the score is negatively correlated with the utilization rate of the memory pipeline.

[0068] S106. Perform the data encapsulation and transmission steps, specifically including: obtaining data from the best service pipeline, attaching custom header information containing nanosecond-level timestamps to construct a data frame, and sending the data frame to the receiving end through XDP technology.

[0069] In this embodiment, as Figure 2 As shown, the custom header information structure includes: a magic word field to identify the legitimacy of the data packet; a pipe identifier field to indicate the memory pipe ID from which the data originates; a priority field to indicate the service level of the data; a sequence number field to record the incrementing count value of the data to support out-of-order detection; and a timestamp field, including a high-order and low-order timestamp bits, to record the nanosecond-level time when the data was sent.

[0070] Introducing a custom header containing magic words, pipe ID, priority, sequence number, and nanosecond-level timestamps into one-way UDP transmission enables the receiver to: (1) effectively identify illegal data packets (magic words); (2) detect packet loss and out-of-order delivery by sequence number in the absence of TCP ACK, and support application layer reassembly; and (3) accurately calculate one-way delay and jitter by nanosecond-level timestamps, providing data support for system optimization.

[0071] Among them, the magic word field is 2 bytes long, the pipe identifier field (pipe ID) is 1 byte long, the priority field is 1 byte long, the sequence number field is 4 bytes long, and the high byte and low byte of the timestamp are both 4 bytes long.

[0072] The method in this embodiment has the following beneficial effects:

[0073] Achieving Software TSN (Time-Sensitive Networking) Performance: This invention simulates the deterministic behavior of dedicated hardware TSN by constructing a mechanism based on "dynamic weights" and "time slot scheduling" on standard hardware. By mapping source data to memory pipelines of different priorities and performing microsecond-level time slot scheduling based on utilization and dynamic weights, low-latency, low-jitter deterministic transmission is achieved, effectively solving the problem that standard hardware cannot provide bounded latency.

[0074] To address the channel starvation problem in unidirectional transmission: Unlike traditional scheduling based solely on static priorities, this invention introduces a "dynamic weight" and "utilization" scoring mechanism. Even low-priority channels will receive higher weights as backlog and waiting time increase, ensuring that all services have a transmission opportunity and avoiding the "starvation" phenomenon where low-priority services cannot be sent for extended periods in a unidirectional optical gate environment without feedback.

[0075] Improved throughput and reduced latency: By combining XDP (eXpress Data Path) technology, zero-copy forwarding of data at the kernel level is achieved, avoiding redundant processing in the operating system kernel protocol stack and significantly reducing CPU load and transmission latency.

[0076] In one embodiment, calculating the dynamic weights of each memory pipeline includes:

[0077] S201. Calculate the starvation value of each memory pipe, wherein the starvation value is obtained by adding the backlog factor and the time factor;

[0078] S202. Calculate the dynamic weight based on the hunger value. The dynamic weight is limited by the maximum value of the dynamic weight. The calculation expression for the dynamic weight is:

[0079] ;

[0080] In the formula, This represents the dynamic weight of the i-th memory pipe. Let represent the starvation value of the i-th memory pipe, and D represent the dynamic weighting factor.

[0081] In this embodiment, the dynamic weighting factor is set to 5 to prevent excessive amplification of pipeline starvation.

[0082] In this embodiment, the maximum value of the dynamic weight can be set to 200. When the calculated dynamic weight is greater than 200, the dynamic weight is set to 200. This prevents a single pipeline from monopolizing resources.

[0083] The method in this embodiment introduces a hunger value composed of a backlog factor and a time factor, enabling the scheduling algorithm to have dynamic awareness. By setting a maximum limit on the dynamic weight, it effectively prevents a single pipeline from monopolizing transmission resources due to excessive weight caused by extreme situations (such as prolonged periods without sending), thus ensuring the fairness of scheduling among multiple pipelines.

[0084] In one embodiment, calculating the starvation value for each memory pipeline includes:

[0085] S301. Obtain the current backlog of bytes and the maximum transfer unit (MTU) in the memory pipe, and then calculate the backlog factor. The corresponding calculation expression is:

[0086] ;

[0087] In the formula, This represents the build-up factor of the i-th memory pipe. Describes the minimum value function. This represents the current backlog of bytes in the i-th memory pipe. Indicates the number of bytes in the maximum transmission unit. This represents the maximum backpacking factor.

[0088] S302. Obtain the idle time in milliseconds of the memory pipe, and then calculate the time factor. The calculation expression is:

[0089] ;

[0090] In the formula, This represents the time factor of the i-th memory pipeline. This represents the idle time in milliseconds for the i-th memory pipe. This represents the maximum time factor.

[0091] S303. Add the backlog factor of the memory pipeline to the time factor to obtain the corresponding starvation value.

[0092] In this embodiment, the maximum backlog factor is set to 10 to prevent a single pipeline from affecting the whole, and the maximum time factor is set to 50 to avoid excessive weight due to long waiting times.

[0093] By calculating the backlog factor (based on MTU and backlog bytes) and the time factor (based on idle time) separately, and by introducing limits on the maximum backlog factor and the maximum time factor, the sending demand of each pipeline can be accurately and reasonably quantified. This prevents small packet data from being overwhelmed and also prevents sudden large traffic surges from impacting the scheduling system, making weight calculation smoother and more reasonable.

[0094] In one embodiment, calculating the number of transfer slots that should be allocated to each memory pipeline includes:

[0095] S401. Count the number of active channels with backlog of data to be sent, and summarize the dynamic weights of all active channels to obtain the total weight;

[0096] The specific process is as follows: collect the pipeline status, set the total weight = 0, the number of active pipelines = 0, use the dynamic weight calculation algorithm to update the total weight and the number of active pipelines, update a pipeline and set the total weight = total weight + dynamic weight of this pipeline, if the pipeline is active, set the number of active pipelines = number of active pipelines + 1.

[0097] The method for updating the number of active pipelines using the dynamic weight calculation algorithm is as follows: memory pipelines with a dynamic weight greater than 0 are identified as active pipelines, and the total number of active pipelines is counted and used as the number of active pipelines.

[0098] S402. In response to the number of active pipelines not being equal to 0, the minimum number of time slots is calculated using the following expression:

[0099] ;

[0100] In the formula, Indicates the minimum number of time slots. Represents the maximum value function. Indicates the total number of time slots. This indicates the number of active pipelines.

[0101] S403. Calculate the remaining number of time slots based on the minimum number of time slots. The calculation expression is:

[0102] ;

[0103] S404. Calculate the overall weight based on the base weight of each memory pipe. The calculation expression is as follows:

[0104] ;

[0105] In the formula, This represents the overall weight of the i-th memory pipeline. This represents the base weight of the i-th memory pipe.

[0106] In this embodiment, the base weight of the memory pipeline is calculated based on the static priority of the memory pipeline, and the calculation expression is:

[0107] ;

[0108] In the formula, This represents the base weight of the i-th memory pipe. Indicates the maximum priority value. represents the static priority of the i-th memory pipe, and C represents the base weight factor;

[0109] In this embodiment, the basic weight factor can be set to 10, the maximum priority value can be set to 7, and the static priority value ranges from 0 to 7.

[0110] The basic weight is directly linked to the static priority, ensuring that when the system load is stable, high-level control instructions or critical data (such as priority 7) naturally have a higher resource ratio than ordinary data (such as priority 0), which is in line with the business logic of industrial control and other scenarios.

[0111] S405. Calculate the corresponding number of allocated time slots based on the overall weight of each memory pipeline. The calculation expression is as follows:

[0112] ;

[0113] This represents the number of allocation slots for the i-th memory pipe. This represents the total weight.

[0114] In this embodiment, the number of time slots allocated to each pipeline needs to be reset to 0 after the pipeline service ends.

[0115] A two-tiered allocation strategy is adopted: "minimum time slot guarantee" + "proportional allocation of remaining time slots". First, it ensures that each active channel has a minimum number of transmission opportunities (minimum number of time slots). Then, based on a comprehensive weighting, remaining resources are allocated to high-demand channels. This mechanism maximizes the utilization of the optical gateway bandwidth while guaranteeing basic connectivity for all services.

[0116] In one embodiment, after calculating the number of transfer time slots to be allocated to each memory pipe and allocating them to the corresponding memory pipes, the method further includes:

[0117] Calculate the remaining time slots based on the number of time slots allocated to each memory pipe and the total number of time slots;

[0118] In response to a remaining slot count greater than zero, the active pipeline with the highest hunger value is identified, and a new slot is allocated to it.

[0119] In one embodiment, the scoring based on the utilization of each memory pipe includes:

[0120] S501. Calculate the memory pipe utilization penalty value based on the memory pipe utilization rate. The calculation expression is as follows:

[0121] ;

[0122] In the formula, This represents the utilization penalty value of the i-th memory pipe. This represents the utilization rate of the i-th memory pipe.

[0123] S502. Calculate the memory pipeline score based on the utilization penalty value. The calculation expression is as follows:

[0124] ;

[0125] In the formula, This represents the score of the i-th memory pipe. represents the maximum priority value, and F represents the static priority value. The maximum priority value is 7, and the static priority value ranges from 0 to 7.

[0126] Introducing a utilization penalty into the pipeline selection scoring model lowers the score of pipelines with excessive utilization (i.e., those occupying a large number of time slots). This creates a negative feedback mechanism, forcing the system to poll among multiple high-load pipelines instead of continuously serving the same pipeline, thereby reducing the transmission jitter of a single flow and smoothing out the output traffic.

[0127] In one embodiment, the pipeline selection and time slot scheduling steps further include empty time slot processing logic, including: initializing a continuous empty time slot counter; if no best service pipeline is selected under the current transmission time slot index, incrementing the current transmission time slot index and the continuous empty time slot counter; determining whether the continuous empty time slot counter has reached the maximum continuous empty time slot threshold; if the maximum continuous empty time slot threshold has not been reached, continuing to select the pipeline for the next time slot; if the threshold has been reached, resetting the counter.

[0128] The empty time slot processing logic ensures that the system's time slot index continues to advance according to predetermined logic even when no data is being sent or the optimal pipeline is not selected. This guarantees that the "clock" of the time slot scheduling system will not stop, and at the same time, resetting through the maximum consecutive empty time slot threshold prevents the program from entering an infinite loop or logical error in an extremely idle state, thus enhancing the robustness of the system.

[0129] In one embodiment, a state update step is further included, comprising: if the data frame is successfully sent via XDP technology, incrementing the number of used time slots of the best service channel by one; recording the current timestamp as the last service time of the best service channel; decrementing the starvation value of the best service channel by one; and incrementing the transmission sequence number of the best service channel by one.

[0130] Upon successful transmission, the used time slots, service time, starvation value, and sequence number are updated immediately, forming a complete closed-loop control. Reducing the starvation value (starvation value - 1) is a key step, as it means that the demand of the pipeline has been partially met, thereby dynamically reducing its competitiveness in the next round of scheduling, giving opportunities to other pipelines, and further ensuring the dynamic balance of scheduling.

[0131] In one embodiment, such as Figure 3 As shown, the complete structure of the data frame includes, in sequence: Ethernet header, IP header, UDP header, the custom header information, and application data payload; wherein the custom header information is located between the UDP header and the application data payload, and its length is fixed at 16 bytes.

[0132] The application data payload has a variable length. Application data includes raw TCP payload or application layer data. The maximum length is limited by MTU. Under a typical MTU of 1500 bytes: 1500 - 58 = 1442 bytes of payload.

[0133] By fixing the custom header to 16 bytes and placing it after the UDP header, the data packets are guaranteed to conform to the standard Ethernet / IP protocol specifications and can pass through standard switching devices. At the same time, it is easy for the XDP program to quickly locate and parse the header information in kernel mode with very low overhead, thus improving the efficiency of data packet processing.

[0134] In one embodiment, the method further includes: after receiving a data frame, the receiving end classifies and redirects it based on custom header information; performs sequence number checking and out-of-order reassembly on the received data frame; and forwards the reassembled data to the target application via a TCP connection.

[0135] In this embodiment, performing sequence number checking and out-of-order reordering on the received data frames includes:

[0136] Remove the IP and UDP headers from the data frame, retaining the custom header and the actual data; parse the custom header, extract the sequence number, and if the sequence numbers are consecutive, send them sequentially to the target application and update the expected sequence number; if the current sequence number is the same as the expected sequence number, discard it; if the current sequence number is less than the expected sequence number, it may be an attack or replay packet and discard it directly; if the current sequence number is greater than the expected sequence number, cache the packet data and attempt to reassemble consecutive data in the cache; if it can be reassembled successfully, send the reassembled data packet sequentially and update the expected sequence number.

[0137] In one embodiment, it further includes: an XDP-based zero-copy memory data pipeline mapping mechanism that binds multiple ring cache pipelines to XDP transmit / receive sockets and maps them to the kernel XDP subsystem (UMEM), thereby avoiding the memory copy overhead caused by data passing through the kernel protocol stack.

[0138] Example of a one-way optical shutter deterministic data transmission system:

[0139] This invention also provides a unidirectional optical shutter deterministic data transmission system. For example... Figure 4 As shown, the unidirectional optical shutter deterministic data transmission system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a unidirectional optical shutter deterministic data transmission method according to the first aspect of the present invention.

[0140] The unidirectional optical gate deterministic data transmission system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces. Their settings and functions are known in the art and will not be described in detail here.

[0141] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.

Claims

1. A method for deterministic data transmission via a one-way optical shutter, characterized in that, Includes the following steps: Receive source data and map the source data to multiple memory pipes, each of which corresponds to a different static priority; The dynamic weight of each memory pipe is calculated based on the static priority and real-time status of the multiple memory pipes. The dynamic weight is used to determine the weight ratio of each active memory pipe in the total transmission resources, and the number of transmission slots to be allocated to each memory pipe is calculated based on the weight ratio and then allocated to the corresponding memory pipe. Calculate the corresponding utilization rate based on the number of transmission time slots allocated to the memory pipeline and the number of time slots already used; The process of selecting a pipeline and scheduling a time slot includes: when the current transmission time slot arrives, calculating the corresponding score based on the utilization rate of each memory pipeline, and then selecting the pipeline with the highest score from multiple memory pipelines as the best service pipeline; the score is negatively correlated with the utilization rate of the memory pipeline; Data is obtained from the optimal service pipeline, a data frame is constructed by appending custom header information containing nanosecond-level timestamps, and the data frame is sent to the receiving end via XDP technology.

2. The deterministic data transmission method for a one-way optical shutter as described in claim 1, characterized in that, The custom header information structure includes: a magic word field to identify the legitimacy of the data packet; a pipe identifier field to indicate the memory pipe ID from which the data originates; a priority field to indicate the service level of the data; a sequence number field to record the incrementing count value of the data to support out-of-order detection; and a timestamp field, including a high-order and low-order timestamp bits, to record the nanosecond-level time when the data was sent.

3. The deterministic data transmission method for a one-way optical shutter as described in claim 2, characterized in that, Calculating the dynamic weight of each memory pipeline includes: calculating the starvation value of each memory pipeline, which is obtained by adding the backlog factor and the time factor; A dynamic weight is calculated based on the hunger value. This dynamic weight is limited by a maximum dynamic weight value. The expression for calculating the dynamic weight is as follows: ; In the formula, This represents the dynamic weight of the i-th memory pipe. Let represent the starvation value of the i-th memory pipe, and D represent the dynamic weighting factor.

4. The deterministic data transmission method for a one-way optical shutter as described in claim 3, characterized in that, Calculating the starvation value for each memory pipe involves obtaining the current backlog of bytes and the maximum transfer unit (MTU) in bytes for each memory pipe, and then calculating the backlog factor. The corresponding calculation expression is as follows: ; In the formula, This represents the build-up factor of the i-th memory pipe. Describes the minimum value function. This represents the current backlog of bytes in the i-th memory pipe. Indicates the number of bytes in the maximum transmission unit. Indicates the maximum backpacking factor; Obtain the idle time in milliseconds of the memory pipe, and then calculate the time factor. The calculation expression is: ; In the formula, This represents the time factor of the i-th memory pipeline. This represents the idle time in milliseconds for the i-th memory pipe. Indicates the maximum time factor; The corresponding hunger value is obtained by adding the backlog factor of the memory pipeline to the time factor.

5. The deterministic data transmission method for a one-way optical shutter as described in claim 3, characterized in that, The calculation of the number of transmission time slots that should be allocated to each memory pipe includes: counting the number of active pipes with currently backlogged data to be sent, and summing the dynamic weights of all active pipes to obtain the total weight; If the number of active pipelines is not equal to 0, then the minimum number of time slots is calculated using the following expression: In the formula, Indicates the minimum number of time slots. Represents the maximum value function. Indicates the total number of time slots. Indicates the number of active pipelines; Calculate the remaining number of time slots based on the minimum number of time slots. The calculation expression is: ; The overall weight is calculated based on the base weight of each memory pipeline. The calculation expression is as follows: ; In the formula, This represents the overall weight of the i-th memory pipeline; This represents the base weight of the i-th memory pipe; The number of allocated time slots is calculated based on the combined weight of each memory pipeline. The calculation expression is as follows: This represents the number of allocation slots for the i-th memory pipe. This represents the total weight.

6. The deterministic data transmission method for a one-way optical shutter as described in claim 5, characterized in that, The base weight of the memory pipe is calculated based on the static priority of the memory pipe, and the calculation expression is: ; In the formula, This represents the base weight of the i-th memory pipe. Indicates the maximum priority value. Let represent the static priority of the i-th memory pipe, and C represent the base weight factor.

7. The deterministic data transmission method for a one-way optical shutter as described in claim 1, characterized in that, The corresponding score is calculated based on the utilization rate of each memory pipe, including: The memory pipe utilization penalty value is calculated based on the memory pipe utilization rate. The calculation expression is as follows: ; In the formula, This represents the utilization penalty value of the i-th memory pipe. This represents the utilization rate of the i-th memory pipe; The memory pipeline score is calculated based on the utilization penalty value. The calculation expression is as follows: ; In the formula, This represents the score of the i-th memory pipe. represents the maximum priority value, and F represents the static priority value.

8. The deterministic data transmission method for a one-way optical shutter as described in claim 1, characterized in that, The execution pipeline selection and time slot scheduling steps also include empty time slot processing logic, including: initializing a continuous empty time slot counter; if no best service pipeline is selected under the current transmission time slot index, incrementing the current transmission time slot index and the continuous empty time slot counter; determining whether the continuous empty time slot counter has reached the maximum continuous empty time slot threshold; if the maximum continuous empty time slot threshold has not been reached, continuing to select the pipeline for the next time slot; if the threshold has been reached, resetting the counter.

9. The deterministic data transmission method for a unidirectional optical shutter as described in any one of claims 1 to 8, characterized in that, It also includes a status update step, which includes: if the data frame is successfully sent via XDP technology, incrementing the number of used time slots of the best service channel by one; recording the current timestamp as the last service time of the best service channel; decrementing the starvation value of the best service channel by one; and incrementing the transmission sequence number of the best service channel by one.

10. A one-way optical shutter deterministic data transmission system, comprising a processor and a memory, wherein the memory stores computer program instructions, characterized in that, When the computer program instructions are executed by the processor, the deterministic data transmission method for a unidirectional optical shutter as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Computing method, computing system and mapping method for physical frame resource parameters when multi-pipe transmission is carried out

    CN107222289A

  • UDP data transmission method and system based on unidirectional optical shutter

    CN117675410A