Data transmission method, apparatus and system
Patent Information
- Application Number
- CN202611309483.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-10-30
AI Technical Summary
然而,服务端由于应答受限,通常无法在应答中携带任何有效载荷或状态信息,一旦发生网络闪断或程序繁忙,数据极易丢失且客户端无法感知,导致服务端出现遥测盲区或遥信误报,影响传输可靠性
[0019]本申请实施例的方案,客户端通过正向隔离装置向服务端发送数据帧,并在已发送且未确认的数据帧数量达到预设阈值K时,根据是否收到服务端返回的用于确认K个数据帧的第一单字节确认信息,来决定继续发送或执行流控操作。该方案能够在满足正向隔离装置对反向应答仅允许单字节的约束下,通过批量确认机制减少反向应答频次,有助于提高信道利用率,进而提升传输效率;同时,通过对已发送未确认帧数的计数和确认,使发送端能够感知服务端的接收状态,并在未收到确认时限制数据帧的发送动作,有利于改善数据传输的可靠性。
Smart Images

Figure CN123020209A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication technology, specifically to a data transmission method, apparatus, and system. Background Technology
[0002] In power dispatching systems, forward isolation devices are typically deployed between the production control area (internal network client) and the management information area (external network server) to ensure unidirectional data transmission from the client to the server, with the reverse channel strictly limited, thus blocking the possibility of external attacks entering the internal network. However, due to limited response capabilities, the server typically cannot carry any payload or status information in its responses. In the event of network outages or program overload, data is easily lost without the client's awareness, leading to telemetry blind spots or false alarms on the server side, affecting transmission reliability. Furthermore, power dispatching requires critical data to be transmitted within milliseconds, placing high demands on the real-time performance of data transmission. Therefore, how to enable the client to effectively perceive the data reception status while maintaining transmission efficiency is a problem that needs to be solved in this field. Summary of the Invention
[0003] A data transmission method, apparatus, and system are provided to enable the client to effectively perceive the data reception status while taking into account transmission efficiency.
[0004] Firstly, a data transmission method is provided, applied to a client, wherein the client communicates with a server through a forward isolation device; the data transmission method includes: Send data frames to the server; In response to the number of data frames that have been sent but not acknowledged reaching a preset threshold K, and upon receiving a first single-byte acknowledgment message returned by the server, the server continues to send the data frames. The first single-byte acknowledgment message is a reply from the server after receiving K data frames and is used to acknowledge the K data frames. In response to the number of data frames that have been sent but not acknowledged reaching a preset threshold K, and the first single-byte acknowledgment information not being received, a flow control operation is performed to restrict the sending of the data frames.
[0005] In some embodiments, performing flow control operations includes: Stop sending the data frame and send a flow control query frame to the server at a first preset interval. The flow control query frame is used to detect the processing status of the server. If no second single-byte confirmation message is received from the server in response to the flow control query frame after a first preset number of consecutive attempts, the connection with the server is disconnected and a new connection is established.
[0006] In some embodiments, the data frame includes telemetry change frames and teleindication change frames; the data transmission method further includes: The current value of each telemetry point is compared with the corresponding previous forwarding value, and if the difference between the current value and the corresponding previous forwarding value exceeds the corresponding preset dead zone, the corresponding telemetry point is marked as a pending transmission state. If a change in the remote signaling point is detected, the change information of the remote signaling point is added to the remote signaling queue; The telemetry change frame and the remote signaling change frame are generated according to the first preset period triggering packet operation.
[0007] In some embodiments, the step of triggering packet assembly operation according to a first preset period to generate the telemetry change frame and the teleindication change frame includes: The remote signaling change frame is generated based on the first preset period and the change information stored in the remote signaling queue; After the remote signaling change frame is generated, the telemetry change frame is generated based on the current value of the telemetry point in the state to be transmitted.
[0008] In some embodiments, the data transmission method further includes: After generating the telemetry change frame, the pending transmission status of the telemetry point is cleared, and the corresponding previous forwarding value is updated with the current value; After generating the remote signaling change frame, the transmitted change information is removed from the remote signaling queue.
[0009] In some embodiments, the data frame includes at least one of full telemetry frames and full teleindication frames; sending the data frame to the server includes: According to the second preset period, at least one of the full telemetry frame and the full teleindication frame is sent to the server. The full telemetry frame includes the current value of all telemetry points, and the full teleindication frame includes the current state of all teleindication points.
[0010] In some embodiments, before sending a data frame to the server, the data transmission method further includes: Establish a TCP connection with the server; Send a handshake frame to the server; Receive the third single-byte confirmation message returned by the server to confirm that the link was successfully established.
[0011] In some embodiments, the data transmission method further includes: If the data frame is not sent within the first preset time period, a heartbeat frame is sent to the server at a second preset interval. If the server returns a fourth single-byte confirmation message for the heartbeat frame within a second consecutive preset number of times, the timer for the first preset period is reset; If the fourth single-byte confirmation message is not received after the second consecutive preset number of attempts, the connection with the server is disconnected and a new connection is established.
[0012] In some embodiments, the data transmission method further includes: The preset threshold K is adjusted according to network quality; wherein, the preset threshold K is decreased when the network quality decreases, and the preset threshold K is increased when the network quality improves.
[0013] In some embodiments, adjusting the preset threshold K according to network quality includes: adjusting the preset threshold K within a preset value range according to network quality, wherein the preset value range is determined based on the chip processing performance of the client.
[0014] Secondly, a data transmission method is also provided, applied to a server, wherein the server communicates with the client through a forward isolation device; the data transmission method includes: In response to the number of data frames received from the client reaching a preset threshold K, a first single-byte confirmation message is sent to the client, the first single-byte confirmation message being used to confirm the K data frames.
[0015] In some embodiments, the data transmission method further includes: Receive flow control query frames, which are sent by the client at a first preset interval in response to not receiving the first single-byte confirmation information, and are used to detect the queue status of the server. Based on the queue status of the server, determine whether to reply with a second single-byte confirmation message.
[0016] In some embodiments, determining whether to reply with a second single-byte confirmation message based on the queue status of the server includes: If the queue length does not exceed the preset length threshold, the second single-byte confirmation message is sent back to the client. If the queue length exceeds the preset length threshold, the second single-byte confirmation message will not be sent back to the client.
[0017] Thirdly, a data transmission system is also provided, including a client, a forward isolation device, and a server. The forward isolation device is connected between the client and the server to enable communication between the client and the server; wherein: The client is used to send data frames; The server is used to send a first single-byte confirmation message to the client in response to the number of received data frames reaching a preset threshold K. The first single-byte confirmation message is used to confirm K data frames. The client is also configured to continue sending the data frame in response to receiving the first single-byte confirmation information, and to perform flow control operations in response to not receiving the first single-byte confirmation information, the flow control operations being used to restrict the sending of the data frame.
[0018] Fourthly, a data transmission apparatus is also provided, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the data transmission method as described in any one of the first aspects, or to implement the data transmission method as described in any one of the second aspects.
[0019] In this embodiment, the client sends data frames to the server via a forward isolation device. When the number of sent but unacknowledged data frames reaches a preset threshold K, the client decides whether to continue sending or perform flow control based on whether it receives a first single-byte acknowledgment from the server to confirm the K data frames. This solution reduces the frequency of reverse acknowledgments through a batch acknowledgment mechanism while satisfying the constraint that the forward isolation device only allows single-byte reverse acknowledgments, thus improving channel utilization and transmission efficiency. Simultaneously, by counting and acknowledging the number of sent but unacknowledged frames, the sending end can perceive the server's reception status and restrict data frame transmission when no acknowledgment is received, thereby improving data transmission reliability. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the data transmission system according to an embodiment of this application; Figure 2 This is a schematic diagram of the overall process of a data transmission method according to an embodiment of this application; Figure 3 This is a schematic diagram of the FIDP protocol format according to an embodiment of this application; Figure 4 This is a schematic diagram of the overall process of another data transmission method according to an embodiment of this application; Figure 5 This is a schematic diagram of the interaction process of the data transmission system according to an embodiment of this application.
[0022] Explanation of reference numerals in the attached figures: 10 - Client; 20 - Forward isolation device; 30 - Server. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0025] "A and / or B" includes the following three combinations: A only, B only, and a combination of A and B.
[0026] The use of "applies to" or "configured to" in this application implies open and inclusive language, which does not exclude the applicability to or configuration to devices performing additional tasks or steps. Additionally, the use of "based on" implies openness and inclusivity, because processes, steps, calculations, or other actions "based on" one or more of the stated conditions or values may in practice be based on additional conditions or values beyond those stated.
[0027] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0028] In power dispatching systems, a forward isolation device 20 is typically deployed between the production control area (i.e., the internal network sending end) and the management information area (i.e., the external network receiving end). The forward isolation device 20 is a dedicated hardware device used to physically or electrically isolate a low-security network area from a high-security internal production control area. Its core feature is that data can only be transmitted unidirectionally from the internal network to the external network; the reverse channel is cut off or can only transmit a very small amount of response signal, thus eliminating the possibility of external attacks entering the internal network. Related industrial control protocols (such as IEC104, Modbus, etc.) are usually based on TCP / IP and are mostly bidirectional interactive, such as request... In response or acknowledged data transmission modes, these industrial control protocols cannot directly penetrate the forward isolation device 20 because the forward isolation device 20 prohibits reverse data flow.
[0029] Data transmission across the forward isolation device 20 typically employs one of two schemes. The first is the raw transparent transmission scheme: a data acquisition server is deployed on the internal network side. After parsing data from various industrial protocols, the data packets are sent to the external network server using a custom format and TCPSocket. The external network server, upon receiving the data, cannot perform any effective protocol-level confirmation and can only receive data unidirectionally. The second is a file-based relay scheme: the internal network side periodically writes data to a text file, which is then "ferryed" to the external network side, where the external network application parses the file content.
[0030] The above solutions have several drawbacks. For the original transparent transmission scheme, since the external network server cannot send protocol-layer responses other than TCP acknowledgments, the sending end cannot confirm whether the data has been correctly received and processed. In the event of a network outage or server-side program 30 becoming overloaded, data is easily lost without the sending end's knowledge, leading to telemetry blind spots or false alarms on server-side 30, resulting in poor transmission reliability. For the file-based relay scheme, it relies on the file synchronization period (usually on the order of seconds or minutes), which cannot meet the requirements of power dispatching for telemetry changes (requiring millisecond-level response) and the real-time performance of critical telemetry, resulting in low real-time performance. Furthermore, simple transparent transmission schemes often employ arbitrary response mechanisms (e.g., replying with data packets of arbitrary length), which violates the mandatory requirements of the forward isolation device 20 regarding the response data format (only allowing single bits 0x00 or 0xFF) and response timing (only one response after receiving data). Multiple non-compliances can lead to policy disabling and system shutdown. Meanwhile, the relevant solutions lack flow control mechanisms. When the processing capacity of the external network decreases (e.g., message queue backlog), the sending end cannot detect it and will still send data at full speed, causing the server-side program to crash or suffer a large number of packet losses.
[0031] Therefore, how to achieve effective perception of the data reception status by the sending end while taking into account transmission efficiency, under the premise of strictly adhering to the unidirectional transmission and single-byte response specifications of the forward isolation device 20, is a problem that needs to be solved in this field.
[0032] In view of this, the present application provides a data transmission method in which the client 10 sends data frames to the server 30 through the forward isolation device 20. When the number of sent and unacknowledged data frames reaches a preset threshold K, the client decides whether to continue sending or perform flow control operation based on whether it receives the first single-byte acknowledgment information returned by the server 30 to acknowledge K data frames. This reduces the number of reverse acknowledgments by using a batch acknowledgment mechanism while satisfying the constraint that the forward isolation device 20 only allows single-byte reverse acknowledgments, thus helping to improve channel utilization. At the same time, by counting and detecting the number of sent and unacknowledged frames, the sending end can sense the receiving status of the server 30 and perform flow control operation when no acknowledgment is received, which helps to improve the reliability of data transmission and alleviate network congestion, thereby solving at least one of the above-mentioned technical problems.
[0033] Please see Figure 1 , Figure 1 This is a schematic diagram of the data transmission system according to an embodiment of this application. The data transmission system of this embodiment includes a client 10, a forward isolation device 20, and a server 30. The forward isolation device 20 is connected between the client 10 and the server 30 to enable communication between the client 10 and the server 30.
[0034] Specifically, client 10 is deployed in the production control area (i.e., intranet) of the power dispatching system. It is responsible for collecting data from various industrial protocols (such as IEC104, Modbus, etc.), and performing dead-zone judgment, bitmap merging, and queue buffering according to the data transmission method of this application embodiment. It encapsulates messages according to the FIDP (Forward Isolation Device Protocol) protocol format and sends them to server 30 through forward isolation device 20. It also processes the single-byte acknowledgment information returned by server 30. If no acknowledgment is received, a retransmission mechanism is initiated. Server 30 is deployed in the management information area (i.e., extranet). It is used to receive messages sent by client 10 according to the data transmission method of this application embodiment, parse the messages and write them into a real-time database for use by upper-layer applications, decide whether to reply with acknowledgment based on the backlog of its own processing queue, maintain link status, and monitor the survival of client 10 through heartbeat. The forward isolation device 20 is connected in series between the production control area and the management information area. Its core characteristic is that data is only allowed to be transmitted unidirectionally from the client 10 to the server 30, and the reverse channel can only transmit simple single-byte responses, with the number of responses and their content strictly limited. The data transmission system of this embodiment achieves reliable data transmission between the client 10 and the server 30 under this restricted environment.
[0035] Please see Figure 2 , Figure 2 This is a schematic diagram of the overall flow of a data transmission method according to an embodiment of this application. The method is applied to client 10 and specifically includes the following steps S201 to S203: S201: Send a data frame to server 30.
[0036] S202: In response to the number of sent and unacknowledged data frames reaching a preset threshold K, and receiving the first single-byte acknowledgment information returned by the server 30, continue sending data frames; the first single-byte acknowledgment information is replied by the server 30 after receiving K data frames, and is used to acknowledge the K data frames.
[0037] S203: In response to the number of sent and unacknowledged data frames reaching a preset threshold K and no first single-byte acknowledgment information being received, a flow control operation is performed to restrict the data frame sending action of client 10.
[0038] Flow control is a mechanism used in information transmission to regulate the data transmission rate between the sender and receiver. Restricting the transmission of data frames refers to limiting the data frame transmission actions of client 10 by pausing the transmission of new data frames and resuming transmission when certain conditions are met.
[0039] Specifically, each time client 10 sends a data frame, it records that the frame has not yet been acknowledged. When the cumulative number of unacknowledged frames reaches K, client 10 pauses sending new data frames (or waits for acknowledgment from server 30 before sending the next frame). After server 30 has completely received K data frames, it replies to client 10 with a first single-byte acknowledgment message (e.g., 0xFF) as a batch acknowledgment. After receiving the first single-byte acknowledgment message, client 10 deducts the corresponding acknowledged frame from the unacknowledged count and continues to send subsequent data frames. If client 10 does not receive the first single-byte acknowledgment message within the first preset time period T1, it determines that network congestion or insufficient processing capacity of server 30 may occur, and performs flow control operations, thereby helping to improve the reliability of data transmission and channel utilization.
[0040] In some examples, in step S201, the data frame includes telemetry change frames and telemetry signaling change frames. Telemetry change frames are used to transmit telemetry point data whose change amplitude exceeds a preset dead zone. For example, a telemetry change frame may contain the addresses of one or more telemetry points and their current measurement values. Telemetry signaling change frames are used to transmit telemetry signaling point information that has changed position. For example, a telemetry signaling change frame may contain the addresses of one or more telemetry signaling points, their changed state value, and the timestamp of the change (accurate to milliseconds). By encapsulating telemetry changes and telemetry signaling changes into independent frame types, the server 30 can easily distinguish and process data of different priorities.
[0041] The data transmission method in this embodiment further includes: First, comparing the current value of each telemetry point with the corresponding previous forwarding value; if the difference between the current value and the previous forwarding value exceeds a corresponding preset dead zone, marking the telemetry point as a pending transmission state. When a change in a remote signaling point is detected, the change information of that remote signaling point is added to the remote signaling queue. Then, according to a first preset period, a packet assembly operation is triggered to generate telemetry change frames and remote signaling change frames.
[0042] In some embodiments, packet assembly operations are triggered according to a first preset period to generate telemetry change frames and teleindication change frames, which can be implemented in the following ways: Based on the first preset period and the change information stored in the remote signaling queue, a remote signaling change frame is generated.
[0043] After generating the telemetry change frame, the telemetry change frame is generated based on the current value of the telemetry point in the state to be transmitted.
[0044] For example, the first preset period is set to 100 milliseconds. For telemetry points, client 10 maintains a bitmap (i.e., a set of change markers), where each marker bit in the bitmap corresponds to a telemetry point. Each telemetry point maintains the previous forwarded value and the current value. When a new telemetry value is received, the change magnitude between the current value and the previous forwarded value is calculated. If the change magnitude is greater than a preset dead zone (e.g., 0.05% of the rated value of the corresponding telemetry value), the marker bit corresponding to that telemetry point in the bitmap (e.g., one bit in the bitmap) is set to 1, indicating that the point has a new value to be sent. In this way, invalid small changes can be effectively suppressed and telemetry merging can be achieved.
[0045] For remote signaling points, client 10 maintains a first-in-first-out (FIFO) remote signaling queue, which stores change events. Whenever a remote signaling state changes (e.g., from split to merge), the change event (including the remote signaling point address, new state, and timestamp) is immediately appended to the end of the queue. When the first preset period (e.g., 100ms) expires, client 10 begins packet assembly. During packet assembly, the remote signaling queue is first traversed, and based on the change information stored in the queue, it is encapsulated into one or more remote signaling change frames in FIFO order. After the remote signaling queue is processed, all telemetry points marked as pending transmission in the bitmap are traversed, and their current measurement values, addresses, and other information are encapsulated into one or more telemetry change frames. This packet assembly order of remote signaling first, then telemetry helps ensure that high-priority remote signaling change data is sent first, reducing the transmission delay of critical alarm signals.
[0046] For example, the number of telemetry points or teleindication points included in a data frame is determined based on the frame length of the data frame. The number of teleindication change frames or teleindication change frames is determined by the total number of teleindication points or teleindication points to be transmitted, and the maximum number of frames currently allowed to be transmitted.
[0047] In some embodiments, the data transmission method further includes: After generating a telemetry change frame, clear the pending state of the telemetry point and update the corresponding previous forwarding value with the current value.
[0048] After generating the remote signaling change frame, the transmitted change information is removed from the remote signaling queue.
[0049] Specifically, for telemetry points, once a telemetry point is marked as pending transmission, client 10 encapsulates the current value of that telemetry point into a telemetry change frame. After the telemetry change frame is generated, client 10 clears the corresponding flag bit in the bitmap, thereby clearing the pending transmission state of the telemetry point; at the same time, it updates its previous forwarding value with the current value of the telemetry point so that it can be compared with the new current value in the next cycle to determine whether to trigger change transmission again.
[0050] For remote signaling points, after client 10 retrieves the change information from the remote signaling queue and encapsulates it into a remote signaling change frame, client 10 removes the processed change record from the head of the queue.
[0051] In some examples, if a telemetry change frame or teleindication change frame is not acknowledged by the server 30 after being sent, the client 10 may not immediately clear the pending state or remove the change information from the queue, but instead wait for retransmission or retain the data according to the flow control logic until an acknowledgment is received or a timeout occurs before performing the corresponding recovery operation.
[0052] The above scheme ensures that each telemetry change and tele-signal change will not be sent up repeatedly after successful processing, while releasing storage resources and preventing the queue from growing indefinitely.
[0053] In some examples, the data frame includes at least one of a full telemetry frame and a full teleindication frame. The full telemetry frame includes the current values of all telemetry points, and the full teleindication frame includes the current state of all teleindication points.
[0054] Step S201 may include the following steps: According to the second preset period, at least one of the full telemetry frames and the full teleindication frames is sent to the server 30.
[0055] Specifically, full data transmission is typically used for initialization after link establishment, periodic full synchronization, or data verification after anomaly recovery. Unlike telemetry change frames and teleindication change frames, full telemetry frames and full teleindication frames carry a complete snapshot of all measurement points on client 10 at a certain moment, not limited to the parts that have changed.
[0056] In some examples, the second preset period is set to, for example, 30 seconds or 60 seconds, and the second preset period can be different from the first preset period. Whenever the second preset period is reached, client 10 iterates through all local telemetry points, encapsulating the address and current value of each telemetry point into one or more full telemetry frames; simultaneously, it iterates through all teleindication points, encapsulating the address and current state (e.g., 0 or 1) of each teleindication point into one or more full teleindication frames. Client 10 can send the full telemetry frames and full teleindication frames separately, or they can be sent together. After receiving the full data frames, server 30 can use the data to update its local database, thus maintaining complete data consistency with client 10. The periodic sending of full data can coexist with the uploading of changed data. For example, during normal operation, client 10 sends changed data frames every first preset period to upload change information in real time, and simultaneously sends full data every second preset period to correct inconsistencies that may be caused by packet loss or accumulated errors. In addition, when the client 10 re-establishes a connection with the server 30 (e.g., after a disconnection and reconnection), the client 10 can immediately and proactively send a full data frame to ensure that the server 30 obtains the correct initial data.
[0057] In some embodiments, in step S202, the preset threshold K ranges from 10 to 320. The preset threshold K is adjusted within a preset range, which is determined based on the chip processing performance of the client 10. Each time the client 10 sends a data frame, it increments the count of sent but not yet acknowledged frames by 1. When the frame count reaches K, the client 10 pauses sending new data frames, starts a timeout timer, and waits for the server 30 to return a first single-byte acknowledgment. The duration of the timeout timer can be adjusted according to the timeout period of the forward isolation device 20, for example, it can be set to 3 seconds. The server 30 places the received data frames into a processing queue. After receiving K complete data frames, it can check whether the length of the processing queue exceeds a preset length threshold. If it does not exceed the threshold, it can reply with a first single-byte acknowledgment; if it exceeds the threshold, it indicates that the server 30 is busy and can choose not to reply with a first single-byte acknowledgment. The preset length threshold can be set to 80% of the queue length. After receiving the first single-byte acknowledgment, client 10 clears the unacknowledged frame counter and the timeout timer, then continues sending the next batch of data frames. This mechanism of batch sending with single-byte acknowledgment helps reduce the number of reverse acknowledgment interactions and improves channel utilization, while strictly adhering to the single-byte acknowledgment specification of the forward isolation device 20.
[0058] In some examples, the data transmission method of this application embodiment further includes: adjusting a preset threshold K according to network quality; wherein, the preset threshold K is decreased when the network quality decreases, and the preset threshold K is increased when the network quality improves.
[0059] Specifically, client 10 can monitor the current network quality, such as the round-trip time of statistical frames, packet loss rate, or number of timeout retransmissions, as indicators for evaluating network quality. When network quality deteriorates, the preset threshold K is decreased, causing client 10 to send data frames in smaller batches, thereby shortening the acknowledgment waiting period. This helps to detect lost frames in a timely manner and retransmit them, reducing the amount of data transmitted in a single retransmission. When network quality improves, the preset threshold K is increased, causing client 10 to send data frames in larger batches, thereby reducing the number of reverse acknowledgments and improving channel utilization and overall throughput.
[0060] For example, the initial value of the preset threshold K is set to 16. Each time a timeout retransmission occurs or multiple consecutive batch acknowledgments are received, the client 10 can dynamically adjust the preset threshold K based on statistical information: if acknowledgments are successfully received for a preset number of consecutive times (e.g., 10 times) without retransmission, the value of K is increased according to a third preset interval; if a timeout retransmission occurs, the value of K is decreased according to a fourth preset interval. The third and fourth preset intervals can be different. Through dynamic adaptive adjustment, the client 10 can automatically optimize the granularity of batch transmission according to the current network environment, achieving a balance between reliability and transmission efficiency, and further improving the stability of the system under complex network conditions.
[0061] In some embodiments, step S203, performing flow control operations includes: Stop sending data frames and send flow control query frames to server 30 at a first preset interval. The flow control query frames are used to detect the queue status of server 30. If no second single-byte confirmation message is received from the server 30 for the flow control query frame after the first consecutive preset number of attempts, the connection with the server 30 is disconnected and a new connection is established.
[0062] For example, the first consecutive preset number of times is set to 2 or 3. The first preset interval is set to 3 seconds. The second single-byte confirmation message is 0xFF.
[0063] Specifically, when client 10 does not receive the first single-byte acknowledgment from server 30 after sending K data frames, client 10 assumes potential network congestion or insufficient processing capacity of server 30. At this point, client 10 stops sending new data frames to avoid further burdening server 30. Then, client 10 sends flow control query frames to server 30 at fixed first preset intervals (e.g., every 3 seconds). These flow control query frames do not carry large amounts of data; they are only used to inquire about the current processing status of server 30, such as queue length and processing busyness. Upon receiving the flow control query frame, server 30 decides whether to reply with a second single-byte acknowledgment based on its own queue status. If the server 30's processing queue length does not exceed a preset length threshold, it replies with a second single-byte acknowledgment; if the queue length exceeds the preset length threshold, it does not reply with a second single-byte acknowledgment. Client 10 starts a timer after sending the flow control query frame, waiting for the second single-byte acknowledgment. If no response is received after the first preset number of attempts, client 10 determines that the link is unavailable or server 30 has crashed. In this case, it actively disconnects the current connection and attempts to re-establish it. After re-establishing the connection, client 10 can resume transmission from the point of interruption or with all data.
[0064] Through the above scheme, client 10 can automatically slow down when it does not receive batch confirmation, detect the status of server 30 and reconnect in a timely manner, realizing implicit flow control based on the queue status of server 30, which helps to avoid server 30 overload and improve the system's self-healing ability and stability.
[0065] In some embodiments, before performing step S201, the data transmission method of this application embodiment further includes: Establish a TCP connection with server 30; Send a handshake frame to server 30; Receive the third single-byte confirmation message returned by the server (30) to confirm that the link was successfully established.
[0066] For example, the first, second, and third single-byte confirmation messages, as well as the fourth single-byte confirmation message, are all 0xFF. The terms "first," "second," "third," and "fourth" are only used to distinguish different interaction stages such as data confirmation, flow control inquiry, handshake, and heartbeat, and do not indicate that the values of each single-byte confirmation message are different.
[0067] Specifically, client 10 first initiates a TCP connection request to server 30, establishing a low-level transport layer connection through a three-way handshake (SYN, SYN+ACK, ACK). The TCP connection establishment process is not restricted by the forward isolation device 20 because the three-way handshake does not carry application layer data. After the TCP connection is successfully established, client 10 actively sends a handshake frame to request the establishment of an application layer FIDP protocol connection. Upon receiving the handshake frame, server 30 replies to client 10 with a third single-byte acknowledgment message according to the response specifications of the forward isolation device 20. Upon receiving the third single-byte acknowledgment message, client 10 determines that the application layer link has been successfully established, and both parties enter a state where they can normally send and receive data. This helps the protocol versions and parameter configurations of client 10 and server 30 to match, and prepares for subsequent data transmission.
[0068] In some examples, if client 10 does not receive a third single-byte acknowledgment within a preset timeout period after sending a handshake frame (this preset timeout period is greater than or equal to the timeout period configured by the forward isolation device 20, for example, 3 seconds), the handshake is considered to have failed, and client 10 can actively disconnect the TCP connection and retry establishing the connection. After a successful handshake, client 10 can begin sending changed data frames and full data frames according to the first preset period and the second preset period.
[0069] In some embodiments, after performing steps S201 to S203, the data transmission method of this application embodiment further includes: If no data frames are sent within the first preset time period, a heartbeat frame is sent to the server 30 at the second preset interval. If the server receives the fourth single-byte confirmation message for the heartbeat frame within the second consecutive preset number of times, the timer for the first preset period is reset; If no fourth single-byte confirmation message is received after the second preset number of consecutive attempts, the connection with server 30 is disconnected and a new connection is established.
[0070] For example, the fourth single-byte confirmation message is 0xFF. The duration of the first preset time period is set to 30 seconds. The second preset interval is set to 30 seconds. The second preset number of times is set to 2 or 3 times.
[0071] Specifically, to ensure the stability of the long connection, client 10 can start an idle timer. The duration of the idle timer is the duration of a first preset time period. Whenever client 10 sends any data frame, the idle timer is reset and restarts. When the idle timer expires, client 10 actively sends a heartbeat frame to server 30 to detect whether the link is normal. Client 10 can periodically send heartbeat frames at a second preset interval; that is, if an acknowledgment is received after each transmission, the idle timer is reset, and the client waits for the next idle period before sending again. After receiving the heartbeat frame, server 30 replies with a fourth single-byte acknowledgment message according to the specifications of forward isolation device 20. After receiving the fourth single-byte acknowledgment message, client 10 determines that the link is normal and resets the idle timer. If client 10 does not receive the fourth single-byte acknowledgment message, it can resend the heartbeat frame after the second preset interval. If no reply is received after the second preset number of consecutive attempts, the client determines that the link is abnormal, actively disconnects the TCP connection with server 30, and attempts to re-establish the connection.
[0072] In some examples, server 30 maintains a receive timer (e.g., 120 seconds). If no message (including heartbeat frame) is received from client 10 within the receive timer period, server 30 will actively close the connection to release resources. The first preset time period can be shorter than the idle timeout of server 30 to avoid server 30 actively disconnecting due to idle time.
[0073] Through the above scheme, client 10 can maintain the activity of long-term connections without consuming a lot of bandwidth, and quickly restore the connection when server 30 is unreachable.
[0074] Please see Figure 3 , Figure 3 This is a schematic diagram of the FIDP protocol format according to an embodiment of this application. Exemplarily, the handshake frame, data frame, flow control query frame, full data frame, and heartbeat frame in this embodiment all use the FIDP protocol. The FIDP protocol includes a fixed-length header, a variable Protocol Data Unit (PDU), and a 16-bit CRC (Cyclic Redundancy Check) checksum.
[0075] Specifically, the message header includes a start character, message length, frame sequence number, source address, and function code. The start character is 2 bytes, fixed at 0xDDCC, used to identify the beginning of a message and prevent packet fragmentation. The message length is 2 bytes, representing the total length of the frame (including the start character and CRC). The frame sequence number is 2 bytes, incrementing by 1 after each message is sent, restarting from 0 or 1 when it exceeds 65535, used for message sorting and duplicate detection. The source address is 1 byte, identifying the address of the sending device, facilitating the receiver's differentiation between multiple clients. The function code is 1 byte, identifying the type or function of the current message; for example, 01H indicates a handshake frame, 02H indicates a broken link frame, 03H indicates a heartbeat frame, 04H indicates a flow control query frame, 05H indicates a full telemetry frame, 06H indicates a full telemetry frame, 07H indicates a telemetry change frame, and 08H indicates a telemetry change frame.
[0076] The protocol data unit is of variable length and corresponds to different data formats depending on the function code. For example, the protocol data unit of telemetry change frame, tele-signaling change frame, and full telemetry frame can all include acknowledgment type, forwarding address, number of measurement points, and address, data, and quality information of each measurement point; the protocol data unit of full tele-signaling frame can include acknowledgment type, forwarding address, number of measurement points, and address and data of each measurement point; the protocol data unit of handshake frame, disconnection frame, heartbeat frame, and flow control query frame can all be empty.
[0077] The CRC checksum is 2 bytes long and uses the Cyclic Redundancy Check (CRC) algorithm to verify the integrity of the message header and protocol data units.
[0078] Through the aforementioned fixed-format encapsulation, the receiving end can parse each field according to the same format, thereby correctly identifying the frame type and data content. Using 0xDDCC as the start character reduces the probability of collisions with ordinary data content, and combined with the total length field, allows the receiving end to buffer and reassemble even incomplete messages. The frame sequence number mechanism can detect packet loss or out-of-order delivery. CRC checksums help ensure data integrity.
[0079] The solution in this application embodiment can reduce the frequency of reverse responses through a batch confirmation mechanism while satisfying the constraint that the forward isolation device 20 only allows single bytes for reverse responses, which helps to improve channel utilization and thus improve transmission efficiency. At the same time, by counting and confirming the number of sent but unacknowledged frames, the sending end can sense the receiving status of the server 30 and restrict the sending of data frames when no confirmation is received, which is beneficial to improving the reliability of data transmission.
[0080] This application also provides another data transmission method, which is applied to server 30. See also... Figure 4 , Figure 4This is a schematic diagram of the overall flow of another data transmission method according to an embodiment of this application. Specifically, it includes the following steps S401 to S403: S401: In response to the number of data frames received from client 10 reaching a preset threshold K, a first single-byte acknowledgment message is sent to client 10. The first single-byte acknowledgment message is used to acknowledge K data frames.
[0081] In some embodiments, the data transmission method further includes: S402: Receive flow control query frame. The flow control query frame is sent by the client 10 at a first preset interval in response to not receiving the first single-byte confirmation information. It is used to detect the queue status of the server 30. S403: Based on the queue status of server 30, determine whether to reply with a second single-byte confirmation message.
[0082] In some embodiments, step S403 is implemented in the following manner: If the queue length does not exceed the preset length threshold, reply with a second single-byte confirmation message to client 10.
[0083] If the queue length exceeds the preset length threshold, do not reply with a second single-byte confirmation message to client 10.
[0084] The descriptions of the embodiments in this application and the descriptions of the foregoing embodiments can be referred to each other. For parts not described in detail in the descriptions of the embodiments in this application, please refer to the relevant descriptions of the foregoing embodiments, which will not be repeated here.
[0085] The solution in this application embodiment can reduce the frequency of reverse responses through a batch confirmation mechanism while satisfying the constraint that the forward isolation device 20 only allows single bytes for reverse responses, which helps to improve channel utilization and thus improve transmission efficiency. At the same time, by counting and confirming the number of sent but unacknowledged frames, the sending end can sense the receiving status of the server 30 and restrict the sending of data frames when no confirmation is received, which is beneficial to improving the reliability of data transmission.
[0086] This application also provides a data transmission system. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of the interaction flow of the data transmission system according to an embodiment of this application. Specifically, it includes the following steps: Step S501: Client 10 sends a data frame to server 30.
[0087] Step S502: In response to the number of received data frames reaching a preset threshold K, the server 30 sends the first single-byte confirmation message to the client 10.
[0088] The first single-byte confirmation message is used to confirm K data frames.
[0089] Step S503: In response to receiving the first single-byte acknowledgment information, client 10 continues to send data frames.
[0090] Step S504: In response to not receiving the first single-byte acknowledgment information, client 10 performs flow control operation, which is used to restrict the sending of data frames.
[0091] In some embodiments, before performing step S501, the following steps may also be included: Step S505: Client 10 establishes a TCP connection with server 30.
[0092] Step S506: Server 30 responds to client 10's connection request.
[0093] Step S507: Client 10 sends a handshake frame to server 30.
[0094] Step S508: Server 30 sends a third single-byte confirmation message to client 10 to confirm that the link has been successfully established.
[0095] The solution in this application embodiment can reduce the frequency of reverse responses through a batch confirmation mechanism while satisfying the constraint that the forward isolation device 20 only allows single bytes for reverse responses, which helps to improve channel utilization and thus improve transmission efficiency. At the same time, by counting and confirming the number of sent but unacknowledged frames, the sending end can sense the receiving status of the server 30 and restrict the sending of data frames when no confirmation is received, which is beneficial to improving the reliability of data transmission.
[0096] This application also provides a data transmission apparatus, including a memory and a processor. The memory stores a computer program, and the processor is configured to execute the computer program to implement a data transmission method as described in this application embodiment, or to implement another data transmission method as described in this application embodiment.
[0097] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps of any of the methods in the above embodiments.
[0098] In the embodiments of this application, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0099] It should be noted that, in the data processing stage, the technical solution of this application has strictly limited the scope of data collection to the minimum necessary to achieve the technical objectives, preventing the acquisition of irrelevant information. For any user information to be collected, the data subject will be clearly informed and their consent obtained. Furthermore, technologies such as encrypted storage and access control are employed to strengthen data security and ensure the security and compliance of the entire data processing process. The technical model and decision-making mechanism are based on objective technical parameters and do not introduce unnecessary parameters such as gender or age that may lead to discrimination, resolutely eliminating algorithmic discrimination and upholding public order and good morals. In addition, the specification fully describes the technical implementation methods, application scenarios, and compliance protection details. The claims are consistent with the content of the specification, key compliance designs are clear and verifiable, and the overall technical design is guided by the protection of public interests and adherence to social ethics, without any circumstances that harm public interests or violate public order and good morals.
[0100] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0101] The data transmission method, apparatus, and system provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A data transmission method, characterized in that, Applied to the client side, the client communicates with the server through a forward isolation device; The data transmission method includes: Send data frames to the server; In response to the number of data frames that have been sent but not acknowledged reaching a preset threshold K, and upon receiving a first single-byte acknowledgment message returned by the server, the server continues to send the data frames. The first single-byte acknowledgment message is a reply from the server after receiving K data frames and is used to acknowledge the K data frames. In response to the number of data frames that have been sent but not acknowledged reaching a preset threshold K, and the first single-byte acknowledgment information not being received, a flow control operation is performed to restrict the sending of the data frames.
2. The data transmission method according to claim 1, characterized in that, The execution of flow control operations includes: Stop sending the data frame and send a flow control query frame to the server at a first preset interval. The flow control query frame is used to detect the processing status of the server. If no second single-byte confirmation message is received from the server in response to the flow control query frame after a first preset number of consecutive attempts, the connection with the server is disconnected and a new connection is established.
3. The data transmission method according to claim 1, characterized in that, The data frame includes telemetry change frames and teleindication change frames; the data transmission method further includes: The current value of each telemetry point is compared with the corresponding previous forwarding value. If the difference between the current value and the corresponding previous forwarding value exceeds the corresponding preset dead zone, the corresponding telemetry point is marked as a pending transmission state. If a change in the remote signaling point is detected, the change information of the remote signaling point is added to the remote signaling queue; The telemetry change frame and the remote signaling change frame are generated according to the first preset period triggering packet operation.
4. The data transmission method according to claim 3, characterized in that, The step of triggering packet assembly operation according to a first preset period to generate the telemetry change frame and the remote signaling change frame includes: The remote signaling change frame is generated based on the first preset period and the change information stored in the remote signaling queue; After the remote signaling change frame is generated, the telemetry change frame is generated based on the current value of the telemetry point in the state to be transmitted.
5. The data transmission method according to claim 4, characterized in that, The data transmission method further includes: After generating the telemetry change frame, the pending transmission status of the telemetry point is cleared, and the corresponding previous forwarding value is updated with the current value; After generating the remote signaling change frame, the transmitted change information is removed from the remote signaling queue.
6. The data transmission method according to claim 1, characterized in that, The data frames include at least one of full telemetry frames and full teleindication frames; Sending data frames to the server includes: According to the second preset period, at least one of the full telemetry frame and the full teleindication frame is sent to the server. The full telemetry frame includes the current value of all telemetry points, and the full teleindication frame includes the current state of all teleindication points.
7. The data transmission method according to claim 1, characterized in that, Before sending the data frame to the server, the data transmission method further includes: Establish a TCP connection with the server; Send a handshake frame to the server; Receive the third single-byte confirmation message returned by the server to confirm that the link was successfully established.
8. The data transmission method according to claim 1, characterized in that, The data transmission method further includes: If the data frame is not sent within the first preset time period, a heartbeat frame is sent to the server at a second preset interval. If the server returns a fourth single-byte confirmation message for the heartbeat frame within a second consecutive preset number of times, the timer for the first preset period is reset; If the fourth single-byte confirmation message is not received after the second consecutive preset number of attempts, the connection with the server is disconnected and a new connection is established.
9. The data transmission method according to claim 1, characterized in that, The data transmission method further includes: The preset threshold K is adjusted according to network quality; wherein, the preset threshold K is decreased when the network quality decreases, and the preset threshold K is increased when the network quality improves.
10. The data transmission method according to claim 9, characterized in that, The step of adjusting the preset threshold K based on network quality includes: The preset threshold K is adjusted within a preset range based on network quality, and the preset range is determined based on the chip processing performance of the client.
11. A data transmission method, characterized in that, Applied to the server side, the server communicates with the client through a forward isolation device; The data transmission method includes: In response to the number of data frames received from the client reaching a preset threshold K, a first single-byte confirmation message is sent to the client, the first single-byte confirmation message being used to confirm the K data frames.
12. The data transmission method according to claim 11, characterized in that, The data transmission method further includes: Receive flow control query frames, which are sent by the client at a first preset interval in response to not receiving the first single-byte confirmation information, and are used to detect the queue status of the server. Based on the queue status of the server, determine whether to reply with a second single-byte confirmation message.
13. The data transmission method according to claim 12, characterized in that, Based on the queue status of the server, determine whether to reply with a second single-byte confirmation message, including: If the queue length does not exceed the preset length threshold, the second single-byte confirmation message is sent back to the client. If the queue length exceeds the preset length threshold, the second single-byte confirmation message will not be sent back to the client.
14. A data transmission system, characterized in that, It includes a client, a forward isolation device, and a server. The forward isolation device is connected between the client and the server to enable communication between the client and the server; wherein: The client is used to send data frames; The server is used to send a first single-byte confirmation message to the client in response to the number of received data frames reaching a preset threshold K. The first single-byte confirmation message is used to confirm K data frames. The client is also configured to continue sending the data frame in response to receiving the first single-byte confirmation information, and to perform flow control operations in response to not receiving the first single-byte confirmation information, the flow control operations being used to restrict the sending of the data frame.
15. A data transmission device, characterized in that, It includes a processor and a memory, the memory storing a computer program, the processor being configured to implement the data transmission method as described in any one of claims 1 to 10, or to implement the data transmission method as described in any one of claims 11 to 13, when executing the computer program.
