Message transmission control method and device in cross-physical isolation environment and electronic equipment
By acquiring and parsing the byte length, timestamp, and sequence number of the message at the receiving end, calculating the sequence number jump range and transmission delay, and generating fine-grained control instructions, the problem of message out-of-order recovery and single control strategy in cross-physical isolation environments is solved, and highly accurate message transmission control is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRIC POWER RES INST OF GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-01
AI Technical Summary
Existing message transmission control schemes lack a dynamic benchmark based on the actual processing status of the receiving end in cross-physical isolation environments. This makes it impossible to accurately determine the jump range of message sequence numbers and transmission delay, resulting in difficulties in out-of-order recovery and a single control strategy.
By obtaining the byte length, timestamp, and sequence number of the previous message of the message to be transmitted, and combining them with a preset step increment to determine the sequence number, the receiving end parses the sequence number and timestamp, calculates the sequence number jump range and physical transmission delay, and generates fine-grained transmission control instructions to achieve orderly message recovery and packet loss management.
It improves the accuracy of message control in physically isolated environments, solves the problems of difficult out-of-order recovery and single control strategy, and ensures the reliability and orderliness of message transmission.
Smart Images

Figure CN121967395A_ABST
Abstract
Description
A message transmission control method, apparatus and electronic device for physical isolation environments Technical Field
[0001] This invention relates to the field of data communication technology, and more specifically to a message transmission control method, apparatus, and electronic device in a physically isolated environment. Background Technology
[0002] In data exchange scenarios across physically isolated environments, business data typically needs to be encapsulated into files and transmitted to the receiving end via a one-way transfer through a forward isolation device. This file transfer mode disrupts the original connection persistence and automatic ordering mechanisms of the traditional TCP network protocol, making it highly susceptible to out-of-order, delayed, or even lost data files upon arrival at the receiving end. If the receiving end cannot effectively control and restore the order of these out-of-order messages, the business system will be unable to reconstruct the data according to the correct time logic, leading to data processing errors or business interruptions. Therefore, establishing a reliable message transmission control mechanism is particularly important.
[0003] However, existing message transmission control schemes have significant shortcomings in physically isolated environments, often lacking accuracy. Current technologies typically simply compare the sequence numbers of received filenames for continuity or mechanically sort them by filename. The fundamental problem with this approach is the lack of a dynamic benchmark based on the actual messages processed by the receiver; it focuses only on the surface order of files while ignoring the sequence number logic and time dimension of the message content itself. Because existing technologies cannot accurately calculate the sequence number jump of newly arriving messages based on the receiver's local benchmark, nor can they quantify the transmission latency of messages on the physical link using local time, they cannot use these two key indicators to determine whether a minor jitter or severe packet loss has occurred. This lack of a basis for judgment prevents existing technologies from generating fine-grained transmission control commands, limiting them to a single blocking or dropping strategy, making them ill-suited for complex cross-isolation transmission requirements. Summary of the Invention
[0004] This invention provides a message transmission control method, apparatus, and electronic device in a physically isolated environment, which can solve the problem of inaccurate message transmission control in the prior art.
[0005] An embodiment of the present invention provides a message transmission control method in a cross-physical isolation environment, comprising: obtaining the byte length of the message to be transmitted, the timestamp of the message to be transmitted, and the sequence number of the previous message of the message to be transmitted; determining the sequence number of the message to be transmitted based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and a preset step increment; encapsulating the sequence number of the message to be transmitted, the timestamp of the message to be transmitted, and the message to be transmitted to generate a file to be transmitted; transmitting the file to be transmitted to the message receiving end through a forward physical isolation interface; and parsing the message to be transmitted from the file when the file to be transmitted arrives at the message receiving end. The process involves: transmitting the sequence number of the message to be transmitted and the timestamp of the message to be transmitted; obtaining the local physical time when the file to be transmitted arrives at the message receiving end and the local receiving pointer of the message receiving end; wherein the local receiving pointer is used to represent the sequence number of the most recently output message by the message receiving end; determining the sequence number jump range based on the sequence number of the message to be transmitted and the local receiving pointer; determining the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted; determining the transmission control command based on the sequence number jump range and the physical transmission delay; and performing transmission control on the message to be transmitted based on the transmission control command, the sequence number of the message to be transmitted, and the local receiving pointer.
[0006] Furthermore, the sequence number of the message to be transmitted is determined based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and the preset step size increment. This includes: calculating and generating a basic position offset based on the sequence number of the previous message of the message to be transmitted and the byte length of the message to be transmitted; and calculating and generating the sequence number of the message to be transmitted based on the basic position offset and the preset step size increment.
[0007] Furthermore, the sequence number of the message to be transmitted, the timestamp of the message to be transmitted, and the message to be transmitted are encapsulated to generate a file to be transmitted, including: constructing a preset fixed-length message header based on the sequence number of the message to be transmitted and the timestamp of the message to be transmitted; and concatenating the message header to the beginning of the message to be transmitted to generate a file to be transmitted.
[0008] Furthermore, when the file to be transmitted arrives at the message receiving end, the sequence number and timestamp of the message to be transmitted are parsed from the file to be transmitted, including: taking the beginning of the file to be transmitted as the starting point, extracting a byte stream of a preset fixed length from the file to be transmitted as the parsing object; and extracting the sequence number and timestamp of the message to be transmitted from the parsing object.
[0009] Furthermore, based on the sequence number of the message to be transmitted and the local receive pointer, the sequence number jump range is determined, including: obtaining the byte length of the message pointed to by the local receive pointer; using the byte length of the message pointed to by the local receive pointer as the base byte length; using the local receive pointer as the base sequence number; calculating and generating the expected sequence number based on the base byte length, the base sequence number, and a preset step increment; calculating the difference between the sequence number of the message to be transmitted and the expected sequence number to generate a sequence number difference; and determining the sequence number difference as the sequence number jump range.
[0010] Furthermore, the physical transmission delay is determined based on the local physical time and the timestamp of the message to be transmitted, including: calculating the difference between the local physical time and the timestamp of the message to be transmitted, generating a time difference; and determining the time difference as the physical transmission delay.
[0011] Furthermore, based on the sequence number jump magnitude and physical transmission delay, a transmission control command is determined, including: determining whether the sequence number jump magnitude does not exceed a preset sequence number tolerance threshold; if so, constructing a transmission control command containing a preset normal transmission status identifier; if not, if the sequence number jump magnitude does not exceed a preset sequence number transition threshold, determining a reassembly waiting parameter based on the physical transmission delay and a preset buffer ratio coefficient; constructing a transmission control command containing a preset reordering status identifier and the reassembly waiting parameter based on the reassembly waiting parameter; and constructing a transmission control command containing a preset packet loss status identifier if the sequence number jump magnitude exceeds a preset sequence number transition threshold.
[0012] Furthermore, based on the transmission control command, the sequence number of the message to be transmitted, and the local receive pointer, transmission control is performed on the message to be transmitted, including: parsing the transmission control command and identifying the status identifier contained in the transmission control command; if the status identifier contained in the transmission control command is a normal transmission status identifier, outputting the message to be transmitted; if the status identifier contained in the transmission control command is a reordering status identifier, determining the missing sequence number interval based on the sequence number of the message to be transmitted and the local receive pointer; extracting the reassembly waiting parameter from the transmission control command; storing the message to be transmitted in a preset reordering buffer, and setting and starting the receiving process for the message to be transmitted based on the reassembly waiting parameter. The receiving wait window is configured as follows: If all messages with sequence numbers in the missing sequence number range are received before the receiving wait window expires, the receiving wait window is closed, and all messages with sequence numbers in the missing sequence number range are reassembled in order with the messages to be transmitted in the reordering buffer to generate and output an ordered message sequence; if no messages with sequence numbers in the missing sequence number range are received before the receiving wait window expires, a retransmission request message for the missing sequence number range is generated; if the status identifier included in the transmission control instruction is a packet loss status identifier, the missing sequence number range is determined based on the sequence number of the message to be transmitted and the local receiving pointer; and a retransmission request message for the missing sequence number range is generated based on the missing sequence number range.
[0013] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.
[0014] An embodiment of the present invention provides a message transmission control device in a cross-physical isolation environment, comprising: a data acquisition module, a message transmission module, and a transmission control module; the data acquisition module is used to acquire the byte length of the message to be transmitted, the timestamp of the message to be transmitted, and the sequence number of the previous message of the message to be transmitted; the message transmission module is used to determine the sequence number of the message to be transmitted based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and a preset step increment; encapsulate the sequence number of the message to be transmitted, the timestamp of the message to be transmitted, and the message to be transmitted to generate a file to be transmitted; and transmit the file to be transmitted to the message receiving end through a forward physical isolation interface; the transmission control module is used to... When the file to be transmitted arrives at the message receiving end, the sequence number and timestamp of the message to be transmitted are parsed from the file; the local physical time when the file to be transmitted arrives at the message receiving end and the local receiving pointer of the message receiving end are obtained; wherein, the local receiving pointer is used to represent the sequence number of the most recently output message of the message receiving end; the sequence number jump range is determined according to the sequence number of the message to be transmitted and the local receiving pointer; the physical transmission delay is determined according to the local physical time and the timestamp of the message to be transmitted; the transmission control command is determined according to the sequence number jump range and the physical transmission delay; and the transmission control of the message to be transmitted is performed based on the transmission control command, the sequence number of the message to be transmitted, and the local receiving pointer.
[0015] Based on the above method embodiments, the present invention provides corresponding electronic device embodiments.
[0016] An embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the message transmission control method in any of the above-described method embodiments in a physically isolated environment.
[0017] Compared with existing technologies, the present invention has the following beneficial effects: The embodiments of the present invention provide a message transmission control method, apparatus, electronic device, and storage medium in a cross-physical isolation environment. The method obtains the byte length, timestamp, and sequence number of the previous message of the message to be transmitted, and determines the sequence number of the message to be transmitted based on the byte length, the sequence number of the previous message, and a preset step increment; encapsulates the sequence number, timestamp, and message to be transmitted to generate a transmission file, and transmits it to the message receiving end through a forward physical isolation interface. The sequence number and timestamp of the message to be transmitted are parsed to obtain the local physical time at arrival and the local receiving pointer used to characterize the sequence number of the most recent output message; the sequence number jump range is determined based on the sequence number of the message to be transmitted and the local receiving pointer, and the physical transmission delay is determined based on the local physical time and timestamp; a transmission control command is generated by combining the sequence number jump range and the physical transmission delay, and transmission control is implemented for the message to be transmitted accordingly.
[0018] To address the technical problems of existing solutions lacking a dynamic benchmark based on the actual processing status of the receiving end and failing to distinguish between network jitter and severe packet loss due to neglecting the time dimension, this application introduces a local receive pointer at the receiving end, representing the sequence number of the most recently output message, and combines it with local physical time to accurately calculate the sequence number jump and physical transmission delay of the message to be transmitted relative to the local benchmark. This mechanism moves the judgment criteria from the simple surface order of filenames to the logical sequence and time dimension of message content, thereby enabling the generation of refined transmission control instructions based on these two key quantitative indicators. This effectively solves the problems of difficulty in out-of-order recovery and the lack of a single control strategy caused by the inability to accurately determine the transmission status in cross-physical isolation environments, and improves the accuracy of message control in cross-physical environments. Attached Figure Description
[0019] Figure 1 is a flowchart illustrating a message transmission control method in a physically isolated environment according to an embodiment of the present invention.
[0020] Figure 2 is a schematic diagram of a message transmission control device in a physically isolated environment according to an embodiment of the present invention. Detailed Implementation
[0021] 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 embodiments of the present invention, and not all embodiments. 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.
[0022] As shown in Figure 1, to address the problem of inaccurate message transmission control in existing technologies, an embodiment of the present invention provides a message transmission control method in a cross-physical isolation environment, comprising at least the following steps: Step S1, obtaining the byte length of the message to be transmitted, the timestamp of the message to be transmitted, and the sequence number of the previous message of the message to be transmitted; specifically, when executing the message transmission control process in a cross-physical isolation environment, the electronic device as the sending end first needs to collect and extract basic parameters for the message to be transmitted generated at the current moment, in order to build the data foundation for subsequent ordered reassembly and delay calculation. The processor reads the message content to be sent from the message queue and defines it as the message to be transmitted. The processor accurately obtains the byte length of the message to be transmitted by reading metadata from the memory buffer or executing a length calculation function. The byte length of the message to be transmitted represents the actual size of the message to be transmitted in the storage space. In this embodiment, the byte length of the message to be transmitted is marked as... ,in, A positive integer, in bytes.
[0023] Simultaneously, the processor reads the current local system clock of the sending end and records the physical time when the message to be transmitted enters the transmission processing flow as the timestamp of the message to be transmitted. The timestamp of the message to be transmitted is used subsequently to calculate the physical transmission delay at the receiving end and reflects the time-dimensional attributes of the message to be transmitted. In this embodiment, the timestamp of the message to be transmitted is marked as... ,in, The accuracy can be set to milliseconds or nanoseconds according to actual business needs.
[0024] To maintain the continuity of the message sequence, the processor also needs to read the sequence number of the previous message of the message to be transmitted from its local status register or persistent storage. The sequence number of the previous message refers to the sequence number of the most recently encapsulated and sent message before processing the message to be transmitted. In this embodiment, the sequence number of the previous message of the message to be transmitted is marked as... It should be noted that if the message to be transmitted is the first message sent after the sending end starts, or if the status register is reset, then there is no previous message that has already been sent. The processor will then use the sequence number of the previous message of the message to be transmitted. Initialize to a preset initial value, for example, set to The value is assigned to 0. The length of the message to be transmitted in bytes is obtained. Timestamp of the message to be transmitted and the sequence number of the previous message of the message to be transmitted. This provides the necessary computational variables for accurately calculating the sequence position of the message to be transmitted and quantifying the transmission delay, thus solving the problem in existing technologies where fine-grained transmission control is impossible due to the lack of reference data for the logical and temporal dimensions of message content.
[0025] Step S2: Determine the sequence number of the message to be transmitted based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and a preset step size increment. In a preferred embodiment, determining the sequence number of the message to be transmitted based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and a preset step size increment includes: calculating and generating a basic position offset based on the sequence number of the previous message of the message to be transmitted and the byte length of the message to be transmitted; and calculating and generating the sequence number of the message to be transmitted based on the basic position offset and the preset step size increment.
[0026] Specifically, in determining the sequence number of the message to be transmitted, to establish a precise data alignment mechanism in connectionless transmission mode across physically isolated environments, the message transmission module or processor needs to generate a unique identifier based on the actual data capacity and transmission timing. The processor first reads the byte length of the message to be transmitted and the sequence number of the previous message, which were obtained in the previous step. The byte length of the message to be transmitted objectively reflects the payload size of the current data packet, while the sequence number of the previous message provides the logical endpoint position of the previous node in the transmission stream. By combining these two parameters, the system can map discrete message files to a continuous linear byte stream coordinate system, thereby providing a quantitative benchmark for subsequent accurate packet loss detection and out-of-order reordering at the receiving end.
[0027] In a specific implementation, the process of determining the sequence number of the message to be transmitted is divided into two logical operation stages. First, the processor performs an accumulation operation on the base position based on the sequence number of the previous message and the byte length of the message to be transmitted, to generate the base position offset. In this embodiment, the sequence number of the previous message is marked as... Mark the length of the message to be transmitted in bytes as Mark the base position offset as The processor executes the first arithmetic formula. Obtain the base position offset. Base position offset Logically, it represents the theoretical byte boundary value that the current transmission stream should reach if the current message to be transmitted is seamlessly spliced after the previous message.
[0028] Subsequently, to reserve processing buffer space or identify protocol header overhead in the continuous data stream, the processor needs to introduce a preset step increment to correct the base position offset. The processor obtains the preset step increment pre-stored in the configuration register and marks the preset step increment as... . The frame header length can be set to a fixed constant according to the communication protocol, or it can be dynamically adjusted according to network congestion. The processor calculates and generates the sequence number of the message to be transmitted using the base position offset and the preset step increment, and marks the sequence number of the message to be transmitted as... The specific calculation process follows the second operational formula. The sequence number of the message to be transmitted is generated in this way. It not only includes the time series information of the current data, but also through The participation of [the entity] encodes the message's content length attribute into the sequence number itself.
[0029] Using the above-mentioned technical means, the sequence number of the message to be transmitted can dynamically reflect the actual filling status of the data stream. When the receiving end parses the sequence number, it can not only determine the order of the messages, but also infer whether there is any data loss in the middle and the specific number of lost bytes by the increase of the sequence number value. This solves the technical defect of the existing technology that cannot perceive the integrity of the data content by relying solely on the file name sorting.
[0030] Step S3: Encapsulate the sequence number, timestamp, and message to be transmitted to generate a file to be transmitted; and transmit the file to be transmitted to the message receiving end through a forward physical isolation interface; in a preferred embodiment, encapsulating the sequence number, timestamp, and message to be transmitted to generate a file to be transmitted includes: constructing a preset fixed-length message header based on the sequence number and timestamp of the message to be transmitted; and appending the message header to the beginning of the message to be transmitted to generate the file to be transmitted.
[0031] Specifically, after determining the sequence number of the message to be transmitted, the message transmission module or processor performs an encapsulation operation of the sequence number, timestamp, and message to be transmitted to generate a carrier file capable of transmission across physically isolated environments. The processor first obtains the sequence number of the message to be transmitted generated in the previous step and the collected timestamp. Based on the sequence number and timestamp, the processor constructs a message header of a preset fixed length according to a preset binary encoding format. In this embodiment, the sequence number of the message to be transmitted is marked as... Mark the timestamp of the message to be transmitted as Mark the message header as And mark the preset fixed length as Message header The fixed-length design is used to ensure that the message receiver can accurately extract the control parameters based on the preset byte offset.
[0032] In a preferred embodiment, the processor constructs the message header. At that time, the sequence number of the message to be transmitted will be... Place in message header The specific offset position, and the timestamp of the message to be transmitted. Place in message header Another specific offset position. If the sequence number of the message to be transmitted... timestamp of the message to be transmitted The total number of bytes is less than the preset fixed length. The processor then in the message header The remaining free space is filled with a preset padding character to ensure the message header is filled with the preset padding character. The actual length strictly conforms to The processor then adds the message header. The data is spliced to the beginning of the message to be transmitted to generate the file to be transmitted. In this embodiment, the original data payload of the message to be transmitted is marked as... Mark the generated file to be transferred as The processor generates the file to be transmitted by performing data concatenation operations. The file to be transmitted The logical structure follows the formula .
[0033] File to be transferred After generation, the message transmission module transmits the file to be transmitted through the forward physical isolation interface. Transmitted to the message receiving end. Forward physically isolated interfaces are typically deployed between two independent networks with different security levels, achieving unidirectional data transfer through physical switch switching or storage medium transfer. The processor will transfer the file to be transmitted. The file is sent to the transmit buffer of the forward physical isolation interface, which then transmits the file according to a preset transfer period. The process is migrated to the message receiving end. Through the aforementioned encapsulation and transmission mechanisms, in physically isolated, connectionless scenarios, metadata used for transmission control is strongly coupled and bound to the business payload. This ensures the synchronous arrival of control information and message content in both time and space dimensions, providing a standardized file carrier for subsequent accurate parsing and status judgment at the receiving end.
[0034] Step S4: When the file to be transmitted arrives at the message receiving end, parse the sequence number and timestamp of the message to be transmitted from the file to be transmitted; obtain the local physical time when the file to be transmitted arrives at the message receiving end and the local receiving pointer of the message receiving end; wherein, the local receiving pointer is used to represent the sequence number of the message most recently output by the message receiving end; in a preferred embodiment, when the file to be transmitted arrives at the message receiving end, parse the sequence number and timestamp of the message to be transmitted from the file to be transmitted includes: taking the beginning of the file to be transmitted as the starting point, extracting a byte stream of length equal to a preset fixed length from the file to be transmitted as the parsing object; extracting the sequence number and timestamp of the message to be transmitted from the parsing object.
[0035] Specifically, after the file to be transmitted is transmitted to the message receiving end through the forward physical isolation interface, the transmission control module of the message receiving end immediately starts the parsing program for the file to be transmitted to recover the control information of the message to be transmitted. The transmission control module first decapsulates the received file to be transmitted, separating and parsing the sequence number and timestamp of the message to be transmitted from the file. The sequence number of the message to be transmitted represents the logical position of the message to be transmitted in the transmission sequence, while the timestamp of the message to be transmitted records the physical time when the message to be transmitted is processed at the sending end.
[0036] Meanwhile, to construct a local benchmark for evaluating transmission quality, the transmission control module needs to collect the current operating status data of the message receiver. The transmission control module accesses the message receiver's local high-precision clock to obtain the local physical time at the moment the file to be transmitted arrives at the message receiver. In this embodiment, the local physical time is marked as... Furthermore, the transmission control module reads the local receive pointer stored in a local register or status buffer. The local receive pointer is a status variable used to dynamically represent the sequence number of the message most recently output by the message receiver to subsequent service systems. In this embodiment, the local receive pointer is marked as... If the message receiver is in a newly started state and has not yet output any messages, then the local receive pointer... It is initialized to a preset starting value (e.g., 0).
[0037] In one specific implementation, to accurately extract control information from continuous binary data, the transmission control module employs a fixed-length truncation method for parsing. The transmission control module uses the beginning of the binary stream of the file to be transmitted as the starting anchor point and truncates a byte stream of a specific length from the file. The length of the truncated byte stream is strictly equal to a preset fixed length. The preset fixed length is the protocol header length pre-agreed between the sending end and the message receiving end. In this embodiment, the preset fixed length is marked as... .
[0038] Subsequently, the transmission control module uses the intercepted byte stream of a preset fixed length as the parsing object. Following a preset protocol format, the transmission control module reads the parsing object bit-level or byte-level, extracting the sequence number of the message to be transmitted. and the timestamp of the message to be transmitted Through the above steps, the message receiver not only restores the timing and logical location information carried by the message to be transmitted, but also simultaneously obtains the local time and local processing progress used as a comparison benchmark, thus providing sufficient data support for subsequent accurate calculation of sequence number jump amplitude and physical transmission delay using the local benchmark.
[0039] Step S5: Determine the sequence number jump range based on the sequence number of the message to be transmitted and the local receive pointer; determine the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted; in a preferred embodiment, determining the sequence number jump range based on the sequence number of the message to be transmitted and the local receive pointer includes: obtaining the byte length of the message pointed to by the local receive pointer; using the byte length of the message pointed to by the local receive pointer as the base byte length; using the local receive pointer as the base sequence number; calculating and generating the desired sequence number based on the base byte length, the base sequence number, and a preset step increment; calculating the difference between the sequence number of the message to be transmitted and the desired sequence number to generate a sequence number difference; and determining the sequence number difference as the sequence number jump range.
[0040] In a preferred embodiment, determining the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted includes: calculating the difference between the local physical time and the timestamp of the message to be transmitted to generate a time difference; and determining the time difference as the physical transmission delay.
[0041] Specifically, after obtaining the key parameters of the message to be transmitted and the local status data of the message receiver, the transmission control module begins to perform a two-dimensional quantitative analysis, that is, to accurately characterize the real-time quality status of the current cross-physical isolation transmission through sequence comparison in the spatial dimension and delay calculation in the temporal dimension.
[0042] In a preferred embodiment, the process of determining the sequence number jump range aims to quantify the logical deviation between the newly arrived message and the expected received message. The transmission control module first obtains the byte length of the message pointed to by the local receive pointer and uses this byte length as the base byte length, while simultaneously using the local receive pointer as the base sequence number. The base byte length represents the storage space occupied by the message most recently successfully processed and output by the message receiver, while the base sequence number establishes the logical origin of the current processing progress. Subsequently, the transmission control module generates the expected sequence number through an accumulation operation based on the base byte length, the base sequence number, and a preset step increment. In this embodiment, the expected sequence number is marked as... Mark the baseline serial number as Mark the base byte length as Mark the preset step size increment as The formula for calculating the expected sequence number is: Based on this, the transmission control module calculates the difference between the sequence number of the message to be transmitted and the expected sequence number, generates a sequence number difference, and determines the sequence number difference as the sequence number jump range. In this embodiment, the sequence number jump range is marked as... The sequence number of the message to be transmitted, parsed from the file to be transmitted, is marked as... The formula for calculating the sequence number jump range is: Serial number jump range The numerical value can intuitively reflect whether there are byte-level missing or redundant bytes in the message stream.
[0043] In a preferred embodiment, the process of determining the physical transmission delay aims to quantify the transit time of the message to be transmitted within the physical link and isolation device. The transmission control module performs a time-difference operation, that is, calculates the difference between the local physical time of the message receiver and the timestamp of the message to be transmitted, generates a time difference, and determines the time difference as the physical transmission delay. In this embodiment, the physical transmission delay is marked as... Mark the local physical time as Mark the timestamp of the message to be transmitted as The formula for calculating physical transmission delay is: .
[0044] Through the above steps, we have achieved accurate measurement of message transmission status from two dimensions: logical sequence deviation and time consumption, providing a quantitative basis for distinguishing between minor network jitter and severe packet loss.
[0045] Step S6: Determine the transmission control command based on the sequence number jump range and physical transmission delay; perform transmission control on the message to be transmitted based on the transmission control command, the sequence number of the message to be transmitted, and the local receive pointer.
[0046] In a preferred embodiment, determining the transmission control command based on the sequence number jump magnitude and physical transmission delay includes: determining whether the sequence number jump magnitude does not exceed a preset sequence number tolerance threshold; if so, constructing a transmission control command containing a preset normal transmission status identifier; if not, if the sequence number jump magnitude does not exceed a preset sequence number transition threshold, determining a reassembly waiting parameter based on the physical transmission delay and a preset buffer ratio coefficient; constructing a transmission control command containing a preset reordering status identifier and the reassembly waiting parameter based on the reassembly waiting parameter; and constructing a transmission control command containing a preset packet loss status identifier if the sequence number jump magnitude exceeds the preset sequence number transition threshold.
[0047] In a preferred embodiment, transmission control of the message to be transmitted is performed based on a transmission control command, the sequence number of the message to be transmitted, and a local receive pointer. This includes: parsing the transmission control command to identify a status identifier contained within it; outputting the message to be transmitted if the status identifier in the transmission control command is a normal transmission status identifier; determining a missing sequence number interval based on the sequence number of the message to be transmitted and the local receive pointer if the status identifier in the transmission control command is a reordering status identifier; extracting a reassembly waiting parameter from the transmission control command; storing the message to be transmitted in a preset reordering buffer; and setting and initiating a reordering process for the message to be transmitted based on the reordering waiting parameter. The system receives a waiting window. If all messages with sequence numbers within the missing sequence number range are received before the waiting window expires, the waiting window is closed, and all messages with sequence numbers within the missing sequence number range are reassembled in order with the messages to be transmitted in the reordering buffer to generate and output an ordered message sequence. If no messages with sequence numbers within the missing sequence number range are received before the waiting window expires, a retransmission request message for the missing sequence number range is generated. If the status flag included in the transmission control command is a packet loss status flag, the missing sequence number range is determined based on the sequence number of the message to be transmitted and the local receive pointer. A retransmission request message for the missing sequence number range is generated based on the missing sequence number range.
[0048] Specifically, after obtaining the sequence number jump range and physical transmission delay through the aforementioned steps, the transmission control module generates refined transmission control instructions by comprehensively evaluating the logical position deviation and time flow status, and implements differentiated control strategies for the currently arriving messages based on the transmission control instructions.
[0049] In a preferred embodiment, the process of determining the transmission control command reflects a quantitative classification of the status of the message to be transmitted. The transmission control module first determines whether the sequence number jump range does not exceed a preset sequence number tolerance threshold. In this embodiment, the preset sequence number tolerance threshold is marked as... Preset serial number tolerance threshold Used to identify minute offsets caused by slight network jitter. (If the sequence number jumps by a certain amount...) satisfy Then the transmission control module constructs a transmission control command containing a preset normal transmission status identifier. If Exceeded Then, the transmission control module further determines whether the sequence number jump amplitude does not exceed a preset sequence number jump threshold. In this embodiment, the preset sequence number jump threshold is marked as... .
[0050] If the sequence number jump does not exceed the preset sequence number jump threshold, then the condition is met. At this point, the transmission control module determines that the system is in a state requiring out-of-order reordering. The transmission control module then determines the reordering wait parameter based on the physical transmission delay and a preset buffer ratio. In this embodiment, the reordering wait parameter is marked as... Mark the preset buffer ratio coefficient as Mark the physical transmission delay as The transmission control module uses a third calculation formula. Calculate and generate recombination waiting parameters By dynamically adjusting the reassembly wait parameter by incorporating actual physical transmission delay, the wait time can be matched to the true performance of the current physical link. Subsequently, the transmission control module adjusts the reassembly wait parameter accordingly. Construct a system that includes preset reordering status identifiers and reorganization wait parameters. The transmission control command. And when the sequence number jump exceeds the preset sequence number jump threshold, that is, when the transmission control command is satisfied... When this occurs, it indicates a severe break in the sequence number, and the transmission control module constructs a transmission control instruction containing a preset packet loss status identifier.
[0051] In a preferred embodiment, the transmission control process based on the transmission control command, the sequence number of the message to be transmitted, and the local receive pointer achieves a precise closed-loop control strategy. The transmission control module first parses the transmission control command associated with the message to be transmitted, identifying the status identifier contained within the command. If the status identifier in the transmission control command is a normal transmission status identifier, it indicates that the message to be transmitted conforms to the expected logical order, and the message receiver directly outputs the message to be transmitted.
[0052] When the transmission control command includes a reordering status flag, the transmission control module first determines the missing sequence number interval based on the sequence number of the message to be transmitted and the local receive pointer. The missing sequence number interval refers to the unreceived data segment from the current position pointed to by the local receive pointer to the starting position of the sequence number of the message to be transmitted. Simultaneously, the transmission control module extracts the reassembly wait parameter from the transmission control command. The message to be transmitted is stored in a preset reordering buffer, and based on the reordering wait parameter... Set up and start a receive wait window for messages to be transmitted. The receive wait window is an asynchronous capture mechanism based on a time limit. If the message receiver receives all messages with sequence numbers in the missing sequence number range before the receive wait window expires, the transmission control module closes the receive wait window and reassembles all messages with sequence numbers in the missing sequence number range with the messages to be transmitted in the reordering buffer in order, generating and outputting an ordered message sequence. Conversely, if all messages with sequence numbers in the missing sequence number range are not completed before the receive wait window expires, the transmission control module generates a retransmission request message for the missing sequence number range to trigger the retransmission process.
[0053] When the status identifier included in the transmission control command is a packet loss status identifier, the transmission control module determines the sequence number missing interval based on the sequence number of the message to be transmitted and the local receive pointer, and immediately generates a retransmission request message for the sequence number missing interval, without setting a waiting window, thereby speeding up the response speed to severe packet loss.
[0054] Through the above steps, fine-grained control of messages to be transmitted is achieved based on quantitative indicators of message logical position and time dimension. This effectively solves the problems of low accuracy of out-of-order recovery and single control strategy caused by the lack of dynamic benchmarks and time references in cross-physical isolation environments, and significantly improves the reliability and orderliness of message transmission.
[0055] Based on the above method embodiments, the present invention provides corresponding apparatus embodiments.
[0056] As shown in Figure 2, an embodiment of the present invention provides a message transmission control device in a cross-physical isolation environment, including: a data acquisition module, a message transmission module, and a transmission control module; the data acquisition module is used to acquire the byte length of the message to be transmitted, the timestamp of the message to be transmitted, and the sequence number of the previous message of the message to be transmitted; the message transmission module is used to determine the sequence number of the message to be transmitted based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and a preset step increment; encapsulate the sequence number of the message to be transmitted, the timestamp of the message to be transmitted, and the message to be transmitted to generate a file to be transmitted; and transmit the file to be transmitted to the message receiving end through a forward physical isolation interface; the transmission control module... This block is used to, when a file to be transmitted arrives at the message receiving end, parse the sequence number and timestamp of the message to be transmitted from the file to be transmitted; obtain the local physical time when the file to be transmitted arrives at the message receiving end and the local receiving pointer of the message receiving end; wherein, the local receiving pointer is used to represent the sequence number of the most recently output message of the message receiving end; determine the sequence number jump range based on the sequence number of the message to be transmitted and the local receiving pointer; determine the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted; determine the transmission control command based on the sequence number jump range and the physical transmission delay; and perform transmission control on the message to be transmitted based on the transmission control command, the sequence number of the message to be transmitted, and the local receiving pointer.
[0057] It should be noted that the embodiments of the apparatus described above correspond to the embodiments of the present invention described above, and can realize the message transmission control method in any of the above-described physical isolation environments of the present invention. Furthermore, the embodiments of the apparatus described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Additionally, in the accompanying drawings of the apparatus embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without creative effort.
[0058] Based on the above-described method embodiments of the present invention, a corresponding embodiment of an electronic device is provided.
[0059] An embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the message transmission control method in any of the physical isolation environments described in the present invention, or, when the processor executes the computer program, it implements the functions of each module in the above-described device embodiments.
[0060] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the terminal device.
[0061] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0062] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0063] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0064] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0065] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A message transmission control method for environments with cross-physical isolation, characterized in that, include: Get the byte length of the message to be transmitted, the timestamp of the message to be transmitted, and the sequence number of the previous message of the message to be transmitted; The sequence number of the message to be transmitted is determined based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and the preset step increment. The sequence number, timestamp, and message to be transmitted are encapsulated to generate a file to be transmitted. The file to be transmitted is transmitted to the message receiving end through the forward physical isolation interface; when the file to be transmitted arrives at the message receiving end, the sequence number and timestamp of the message to be transmitted are parsed from the file to be transmitted. Obtain the local physical time when the file to be transmitted arrives at the message receiving end and the local receiving pointer of the message receiving end; wherein, the local receiving pointer is used to represent the sequence number of the message most recently output by the message receiving end; determine the sequence number jump range based on the sequence number of the message to be transmitted and the local receiving pointer; determine the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted. Based on the sequence number jump range and physical transmission delay, the transmission control command is determined; based on the transmission control command, the sequence number of the message to be transmitted, and the local receive pointer, the transmission control of the message to be transmitted is performed.
2. The message transmission control method in a cross-physical isolation environment as described in claim 1, characterized in that, The sequence number of the message to be transmitted is determined based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and the preset step size increment. This includes: calculating and generating a basic position offset based on the sequence number of the previous message of the message to be transmitted and the byte length of the message to be transmitted; and calculating and generating the sequence number of the message to be transmitted based on the basic position offset and the preset step size increment.
3. The message transmission control method in a cross-physical isolation environment as described in claim 2, characterized in that, The sequence number, timestamp, and message to be transmitted are encapsulated to generate a file to be transmitted. This includes: constructing a pre-defined fixed-length message header based on the sequence number and timestamp of the message to be transmitted; and appending the message header to the beginning of the message to be transmitted to generate the file to be transmitted.
4. The message transmission control method in a cross-physical isolation environment as described in claim 3, characterized in that, When the file to be transmitted arrives at the message receiving end, the sequence number and timestamp of the message to be transmitted are parsed from the file to be transmitted, including: taking the beginning of the file to be transmitted as the starting point, extracting a byte stream of a preset fixed length from the file to be transmitted as the parsing object; and extracting the sequence number and timestamp of the message to be transmitted from the parsing object.
5. The message transmission control method in a cross-physical isolation environment as described in claim 4, characterized in that, Based on the sequence number of the message to be transmitted and the local receive pointer, the sequence number jump range is determined, including: obtaining the byte length of the message pointed to by the local receive pointer; using the byte length of the message pointed to by the local receive pointer as the base byte length; using the local receive pointer as the base sequence number; calculating and generating the expected sequence number based on the base byte length, the base sequence number, and the preset step increment; calculating the difference between the sequence number of the message to be transmitted and the expected sequence number, generating the sequence number difference; and determining the sequence number difference as the sequence number jump range.
6. The message transmission control method in a cross-physical isolation environment as described in claim 5, characterized in that, Determine the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted, including: calculating the difference between the local physical time and the timestamp of the message to be transmitted, generating a time difference; and determining the time difference as the physical transmission delay.
7. The message transmission control method in a cross-physical isolation environment as described in claim 6, characterized in that, Based on the sequence number jump range and physical transmission delay, a transmission control command is determined, including: determining whether the sequence number jump range does not exceed a preset sequence number tolerance threshold; if so, constructing a transmission control command containing a preset normal transmission status identifier; if not, if the sequence number jump range does not exceed a preset sequence number transition threshold, determining a reassembly waiting parameter based on the physical transmission delay and a preset buffer ratio coefficient; constructing a transmission control command containing a preset reordering status identifier and the reassembly waiting parameter based on the reassembly waiting parameter; and constructing a transmission control command containing a preset packet loss status identifier if the sequence number jump range exceeds a preset sequence number transition threshold.
8. The message transmission control method in a cross-physical isolation environment as described in claim 7, characterized in that, Based on the transmission control command, the sequence number of the message to be transmitted, and the local receive pointer, transmission control is performed on the message to be transmitted, including: parsing the transmission control command and identifying the status identifier contained in the transmission control command; if the status identifier contained in the transmission control command is a normal transmission status identifier, outputting the message to be transmitted; if the status identifier contained in the transmission control command is a reordering status identifier, determining the missing sequence number interval based on the sequence number of the message to be transmitted and the local receive pointer; extracting the reassembly waiting parameter from the transmission control command; storing the message to be transmitted in a preset reordering buffer, and setting and starting a receive waiting window for the message to be transmitted based on the reassembly waiting parameter. If all messages with sequence numbers in the missing sequence number range are received before the receive waiting window expires, the receive waiting window is closed, and all messages with sequence numbers in the missing sequence number range are reassembled in order with the messages to be transmitted in the reordering buffer to generate and output an ordered message sequence. If no messages with sequence numbers in the missing sequence number range are received before the receive waiting window expires, a retransmission request message for the missing sequence number range is generated. If the status flag included in the transmission control command is a packet loss status flag, the missing sequence number range is determined based on the sequence number of the message to be transmitted and the local receive pointer. A retransmission request message for the missing sequence number range is generated based on the missing sequence number range.
9. A message transmission control device for environments with cross-physical isolation, characterized in that, include: Data acquisition module, message transmission module, and transmission control module; The data acquisition module is used to acquire the byte length of the message to be transmitted, the timestamp of the message to be transmitted, and the sequence number of the previous message of the message to be transmitted; the message transmission module is used to determine the sequence number of the message to be transmitted based on the byte length of the message to be transmitted, the sequence number of the previous message of the message to be transmitted, and a preset step increment. The sequence number, timestamp, and message to be transmitted are encapsulated to generate a file to be transmitted. The file to be transmitted is transmitted to the message receiving end through a forward physical isolation interface; the transmission control module is used to parse the sequence number and timestamp of the message to be transmitted from the file to be transmitted when the file to be transmitted arrives at the message receiving end. Obtain the local physical time when the file to be transmitted arrives at the message receiving end and the local receiving pointer of the message receiving end; wherein, the local receiving pointer is used to represent the sequence number of the message most recently output by the message receiving end; determine the sequence number jump range based on the sequence number of the message to be transmitted and the local receiving pointer; determine the physical transmission delay based on the local physical time and the timestamp of the message to be transmitted. Based on the sequence number jump range and physical transmission delay, the transmission control command is determined; based on the transmission control command, the sequence number of the message to be transmitted, and the local receive pointer, the transmission control of the message to be transmitted is performed.
10. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the message transmission control method for a cross-physical isolation environment as described in any one of claims 1 to 8.