A data receiving and rate-limiting forwarding method based on adaptive buffer
By using adaptive buffer optimization and rate-controlled forwarding methods, the performance limitations of traditional equipment in terms of high code rate, low latency, and low packet loss rate have been overcome, enabling efficient and stable data reception and forwarding for aerospace telemetry and control data transmission missions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 10TH RES INST OF CETC
- Filing Date
- 2023-06-30
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional data receiving and forwarding equipment struggles to achieve a balance between high bit rate, low latency, and low packet loss rate. Improper buffer size settings lead to performance limitations, and the UDP protocol suffers from high packet loss rates during network congestion, failing to meet the real-time and stability requirements of aerospace telemetry and control data transmission missions.
An adaptive buffer optimization method is adopted, which adjusts the buffer size adaptively according to the current code rate and data latency. Combined with the rate control forwarding method of UDP protocol, the data packet sending interval is controlled by introducing a balance factor λ to optimize the data reception and forwarding process.
It achieves a balance between low latency and low packet loss rate at high bit rates, with data latency controlled within 20ms and packet loss rate maintained at one ten-thousandth. It adapts to multiple data sources and improves the robustness of data reception and forwarding.
Smart Images

Figure CN116865910B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of aerospace telemetry, tracking, and command (TT&C) data transmission technology, and in particular to a data reception and speed control forwarding method based on an adaptive buffer. Background Technology
[0002] With the rapid advancement of aerospace technology and commercial spaceflight, the number of satellites launched globally is growing exponentially, and countries are using satellites to support the development of related industries. Currently, my country has hundreds of satellites used in remote sensing, reconnaissance, meteorology, surveying and mapping, and other fields. Satellite payload data in certain specialized areas are characterized by large data volumes, high real-time requirements, and high forwarding stability. The large data volume is reflected in the high receiving and forwarding interface code rates, reaching up to 2Gbps; the high real-time requirements are reflected in the total latency from data reception at the front end to data forwarding at the back end not exceeding 20ms; and the high forwarding stability is reflected in the ability of UDP protocol-based forwarding to adapt to network fluctuations, with packet loss rates consistently controlled below one in ten thousand. Therefore, the demand for a high-speed, efficient, and stable data reception and forwarding method is increasingly strong.
[0003] Traditional data receiving and forwarding devices utilize a buffer mechanism to address the performance limitations caused by the mismatch in read / write rates between high-speed and low-speed devices. Input devices have input buffers, and output devices have output buffers. During data exchange, a portion of memory is reserved as a buffer. Each read / write (send / receive) operation is not executed immediately upon data arrival, but rather after the buffer is full, such as writing to disk or calling the `send` function to send data. This mechanism serves two purposes: First, it effectively reduces the number of kernel calls to system-level functions, saving unnecessary overhead. Because the time spent starting and ending read / write operations is relatively long, without a buffer, the device's CPU consumption would be largely spent on calling read / write functions, making it unsuitable for high bit rates. Second, it removes the constraint between high-speed and low-speed devices. After receiving data, the high-speed device pushes the data into the buffer and can proceed with the next step of processing without waiting for the low-speed device to complete its data processing, thus improving device efficiency.
[0004] However, the buffer settings in the aforementioned buffer mechanism are often difficult to determine, as their size directly affects the performance of receiving and forwarding data. If the buffer is designed to be too small, the number of CPU scheduling system functions increases, and unnecessary overhead may lead to an inability to meet the requirements of high bit rates, potentially resulting in data frame overwriting or excessive memory usage during the task. If the buffer is designed to be too large, the time it takes to fill the buffer increases, leading to excessively low read / write frequency and prolonged data stagnation, making it difficult to support the timeliness requirements of aerospace telemetry and control data transmission tasks. On the other hand, the UDP protocol used for external forwarding provides a connectionless, best-effort data transmission service, and is therefore inherently unreliable, less stable and reliable than TCP. While it does not reduce the sending rate like TCP does during network congestion, it does not resend packets when lost. The packet loss rate of data forwarded under the UDP protocol is related to factors such as the current network congestion, the bit rate of data transmission, the number of data frames per packet, and the stability of packet transmission and reception at the receiving and sending ends. The more congested the network, the higher the sending rate, the larger the number of frames per packet, and the less timely the receiver, the more likely packet loss will occur. These factors are beyond the control of the sending device; the sending end can only optimize the stability of the transmitted data. For the sending end, the more uniform the interval between transmitted data packets and the smaller the jitter, the lower the packet loss rate.
[0005] Therefore, in order to adapt to the characteristics of large data volume, high real-time requirements, and high forwarding stability requirements in the field of aerospace telemetry and control data transmission, the data receiving and forwarding method of this invention is proposed. Summary of the Invention
[0006] The purpose of this invention is to provide a data reception and rate-controlled forwarding method based on an adaptive buffer. By adaptively optimizing multi-level buffers and controlling the rate of forwarding, this method solves the problem that traditional data reception and transmission methods struggle to achieve a balance between high bit rate, low latency, and low packet loss rate.
[0007] The specific technical solution is as follows:
[0008] This invention is a data reception and rate-controlled forwarding method based on adaptive buffers. When the device receives data, it sets up multi-level buffers for receiving and processing data for demodulators with different data push methods. The size of each level of buffer can be adaptively changed according to the current code rate and data latency, while taking into account both high code rate and low latency characteristics.
[0009] When the device forwards data to the outside world, for the UDP protocol, the speed control forwarding method is adaptively changed according to the current data latency and transmission stability, while taking into account the characteristics of low latency and low packet loss rate.
[0010] Furthermore, when receiving data, the buffer is automatically increased or decreased based on the current device performance, current latency, and received processing code rate. When the data latency is high, the buffer is decreased to improve timeliness, and when the code rate is low, the buffer is increased to improve receiving and processing efficiency.
[0011] Furthermore, the device includes an antenna, a demodulator, a data receiving module, a data processing module, a data storage module, and a data distribution module, as well as a receiving buffer disposed after the data receiving module and a processing buffer disposed after the data processing module.
[0012] The device receives satellite data via an antenna, and the demodulator converts the electromagnetic waves into digital signals.
[0013] The data receiving module receives data in real time at high speed and pushes it to the receiving buffer for temporary buffering. Once the receiving buffer is full, it is pushed to the data processing module.
[0014] After processing the data frame by frame, the data processing module pushes it to the processing buffer. Once the processing buffer is full, the data is divided into two paths: one path is sent to the data storage module for disk storage; the other path is sent to the data distribution module for data forwarding.
[0015] Furthermore, the receiving buffer and processing buffer can simultaneously adapt to different data push methods of the high-speed data transmission demodulator and the integrated measurement and control demodulator, wherein:
[0016] High-speed data transmission demodulators acquire data at a fixed frequency, and are time-driven.
[0017] The integrated measurement and control demodulator has a fixed data packet size, but different code rates, meaning the frequency f of data packet acquisition and transmission is different, which is data-driven.
[0018] Furthermore, when the device receives the data packet pushed by the demodulator, it first reads the frame length and frame number information in the data packet, and then calculates the size of the data packet receiving buffer based on the performance factor preset by the device and the latency factor β1 of the current data frame.
[0019] Once the receive buffer is full, the data is immediately submitted to the data processing module, which processes it frame by frame. After processing, the size of the processing buffer is dynamically set according to the current delay factor β2. Once the processing buffer is full, the data is pushed to the data distribution module and data storage module for data forwarding and storage.
[0020] Furthermore, for the high-speed data transmission demodulator and the integrated measurement and control demodulator, the sizes of the receiving buffer and the processing buffer are:
[0021] bufferSize=α×DataLen
[0022] Where DataLen is the size of the data packet pushed by the demodulator in a single collection, and α is the comprehensive factor;
[0023] For high-speed data transmission demodulators, DataLen is equal to the product of num_per_Packege and nFrameLen. num_per_Packege varies depending on the code rate, but the push interval is fixed. For integrated measurement and control demodulators, DataLen is of a fixed size, and the push interval varies depending on the code rate.
[0024] Furthermore, for the high-speed data transmission demodulator, the current data packet buffer size is:
[0025] bufferSize=α×num_per_Packege×nFrameLen
[0026] Where num_per_Package is the number of frames in the current data packet, which is the amount of data pushed by the demodulator per unit time 1 / f:
[0027]
[0028] Where nFrameLen represents the frame length of the data packet in bytes, and TransRate is the bit rate in Mbps;
[0029] The comprehensive factor α is derived by introducing the time delay factor β and the performance factor f. γ To make a joint decision, and f γ ≥f, the formula is:
[0030]
[0031] In the formula, the range of the comprehensive factor α is (0,1], and when the delay factor... At that time, the comprehensive factor α gradually decreases as the delay factor β increases, which means that the greater the time delay, the smaller the buffer.
[0032] Delay factor When the comprehensive factor α is a fixed size This means that when the latency is too high, the buffer is reduced to the minimum value that the system can accept, so as to ensure call efficiency and meet the requirements of high code rate;
[0033] The latency factor β represents the urgency of the current data to latency, and the formula is:
[0034]
[0035] Wherein, dataTime is the timestamp of the demodulator generating digital signal contained in the data frame information, currentTime is the current time of the system, TimeLimit is the threshold of the delay requirement, and the value range of β is [0, +∞), which indicates the urgency of the current data to delay.
[0036] f γ The performance factor, directly determined by the device's performance, is defined as the minimum frequency of system function calls that the device can tolerate. The performance factor f γ The larger the value, the better the device performance, which indirectly determines the minimum buffer size that the device can accept.
[0037] For high-speed data transmission demodulators, DataLen is equal to the product of num_per_Packege and nFrameLen. The code rate is different, so num_per_Packege varies, but the push interval is fixed.
[0038] Furthermore, for the integrated measurement and control demodulator, the sizes of the receiving buffer and the processing buffer are:
[0039] bufferSize=α×DataLen
[0040] The comprehensive factor α is derived by introducing the time delay factor β and the performance factor f. γ The decision is made jointly, consistent with the high-speed data transmission demodulator, and the specific formula is as follows:
[0041]
[0042] Among them, the push frequency f in the comprehensive factor α varies with the code rate, specifically as follows:
[0043]
[0044] The data receiving module receives a data packet pushed by the integrated measurement and control demodulator. It first calculates f based on the code rate and DataLen size. The subsequent process of calculating the receiving buffer size and processing buffer size is the same as that of the high-speed data transmission demodulator.
[0045] Furthermore, when forwarding data, the rate-controlled forwarding method controls the time consumed by forwarding a unit number of packets. By introducing a balance factor λ, the rate-controlled forwarding method is automatically and adaptively adjusted based on the current data latency and packet loss rate. Specifically:
[0046] Under the premise of controlling the uniformity of the forwarding data packet interval, when facing large data delay, the data transmission rate is increased and the data packet transmission interval is reduced to improve data timeliness; when facing high packet loss rate, the upper limit of the forwarding rate is limited, that is, the minimum interval of data packet forwarding is limited to reduce the packet loss rate.
[0047] Furthermore, the formula for the balance factor λ is:
[0048]
[0049] Among them, time_least is defined as the minimum time consumed to send a single packet, and Time_per_Package is the time consumed to send one data packet;
[0050] λ can be adaptively changed according to the latency level to balance the optimal effect of packet loss and latency. By setting the minimum interval between unit data packets, the upper limit of the forwarding code rate is limited, thereby reducing the packet loss rate while gradually reducing the latency caused by network fluctuations or CPU scheduling.
[0051] The beneficial effects of this invention are as follows:
[0052] 1. This invention provides a data reception and rate-controlled forwarding method based on an adaptive buffer, achieving low data reception latency and high code rate. Data is pushed from the demodulator to the data receiving module, processed by the data processing module (e.g., frame selection, quality assessment), and then sent out by the data distribution module. No functional reductions are made, and the entire process maintains a high code rate of 2Gbps. This method can control the average latency to within 20ms, representing a 90% performance improvement compared to the traditional data reception and transmission method with an average latency of 300ms. Latency and code rate are mutually exclusive parameters for buffer settings; low latency requires a small buffer, while high code rate requires a large buffer. Therefore, this invention can serve as a universal data reception and forwarding method, effectively solving the problem of balancing latency and rate.
[0053] 2. This invention provides a data reception and rate-controlled forwarding method based on an adaptive buffer, resulting in low data forwarding latency and low packet loss rate. Low packet loss rate has always been a challenge for the UDP protocol. This invention proposes a method that can precisely control the forwarding of each UDP data packet to improve the stability of transmitted data, thereby achieving optimal forwarding at the sending end. Latency and packet loss rate are mutually exclusive; low latency requires timely forwarding of each data packet, while low packet loss requires uniform forwarding intervals. Compared to traditional data forwarding methods, this invention can control the packet loss rate to within one ten-thousandth, while maintaining data latency within 20ms. This invention can serve as a general data rate-controlled forwarding method, effectively solving the problem of balancing packet loss rate and latency.
[0054] 3. This invention provides a data reception and rate-controlled forwarding method based on an adaptive buffer, which is adaptable to various data sources and highly robust. This invention proposes two adaptive buffer methods for high-speed data transmission demodulators and integrated telemetry and control demodulators in the aerospace telemetry and control field, and comprehensively summarizes the buffer settings under different demodulators, unifying an adaptive method applicable to any data push method. This invention has a wide range of applications and effectively copes with different data source push methods. Attached Figure Description
[0055] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort, wherein:
[0056] Figure 1 This is a schematic diagram illustrating the data flow of a data transmission task;
[0057] Figure 2 This is a schematic diagram of a multi-level buffer structure;
[0058] Figure 3 This is a detailed flowchart of the speed control forwarding method. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention; that is, the described embodiments are merely some embodiments of the invention, and not all embodiments. The components of the embodiments of the invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0060] It should be noted that the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0061] Example 1
[0062] This embodiment provides a data reception and rate-controlled forwarding method based on an adaptive buffer. When the device receives data, it sets up a multi-level buffer for receiving and processing data for demodulators with different data push methods. The size of each level of buffer can be adaptively changed according to the current code rate and data latency, while taking into account both high code rate and low latency characteristics.
[0063] When the device forwards data to the outside world, for the UDP protocol, the speed control forwarding method is adaptively changed according to the current data latency and transmission stability, while taking into account the characteristics of low latency and low packet loss rate.
[0064] See Figure 1 The data transmission task flow process specifically includes: the system equipment receives satellite data through the antenna; the demodulator converts electromagnetic waves into digital signals; the software receiving module receives the data in real time at high speed and pushes it to the data processing module; the data processing module processes the data frame by frame, such as frame selection and quality judgment, and sends the processed data to the application center or stores it on the disk.
[0065] See Figure 2 This invention is mainly aimed at Figure 1 The buffers of the data receiving and processing modules are adaptively optimized to address the balance between received data latency and code rate. The specific structure of the multi-level buffer is as follows: Figure 2 As shown, the system includes a receiving buffer and a processing buffer. After the demodulator pushes the data to the data receiving module, it is temporarily buffered in the receiving buffer. When the receiving buffer is full, it is pushed to the data processing module. The data processing module processes the data frame by frame (such as frame selection and quality judgment) and then pushes it to the processing buffer. When the processing buffer is full, the data is divided into two paths: one path is sent to the data storage module for disk storage; the other path is sent to the data distribution module to realize data transmission.
[0066] The two levels of buffers serve different purposes. The first-level receive buffer separates the high-speed receiving module from the low-speed processing module, ensuring that the demodulator's data transmission flow is unaffected by the processing rate and guaranteeing the reliability of data transmission between satellite and ground. The second-level processing buffer reduces the number of system-level function calls, improving efficiency. Whether the processed data is forwarded externally or stored on disk, the larger the amount of data processed in a single system call, the higher the efficiency and the better it can adapt to high bit rate requirements. Since data demodulators in the aerospace telemetry and control field are divided into high-speed data transmission demodulators and integrated telemetry and control demodulators, with different bit rates and different methods of acquiring satellite data, this invention proposes an adaptive multi-level buffer method that can adapt to different demodulators and balance high bit rate and low latency characteristics, based on different bit rates and current latency levels.
[0067] For high-speed data transmission demodulators, the data acquisition frequency is fixed, such as f = 100Hz. This means that the high-speed data transmission demodulator acquires one data packet in hardware every 10ms and pushes it to the next layer, which is time-driven. Different code rates result in different packet sizes; the faster the rate, the larger the data packet, meaning more data frames are acquired in a single acquisition.
[0068] The specific adaptive implementation is as follows: Let the buffer size be `bufferSize` (Byte), the bit rate be `TransRate` (Mbps), the frame length be `nFrameLen` (Byte), the number of frames per data packet for the demodulator be `num_per_Package` (frames), and the demodulator push data packet frequency be `f` (Hz). A simple calculation yields the formula for the demodulator pushing data per unit time 1 / f(s):
[0069]
[0070] Further calculations show that the time to fill the buffer and push it to the next layer is:
[0071]
[0072] Here, `time` represents the time data remains in the buffer, which is also the interval between system function calls, directly affecting forwarding latency. If `bufferSize` is fixed, `time` increases as the bit rate decreases; that is, the lower the bit rate, the greater the latency. For example, if `TransRate = 100Mbps`, `nFrameLen = 1024 (Bytes)`, and `f = 100 (Hz)`, then `num_per_Package = 128 (frames)`, meaning the demodulator pushes one data packet every 10ms, with 128 frames. Assuming a fixed buffer size of `bufferSize = 5 × num_per_package = 5 × 128 × 1024 (Bytes)`, this means that at a bit rate of 100Mbps, it takes 5 data packets from the demodulator to fill the buffer before proceeding to the next layer. The time to fill the buffer is `time = 5 × 10 = 50ms`, meaning a system function is called every 50ms. When the bit rate is halved to 50 Mbps, num_per_Packege = 64 (frames), it takes 10 data receptions from the demodulator to fill the buffer once, with time = 100 ms. According to Formula 2, a simple adaptive method is to let the buffer change with the bit rate, and when the buffer is less than or equal to one num_per_Packege, time can be controlled within 10 ms. The buffer size is set as shown in the formula:
[0073]
[0074] Where α is a composite factor, with a value of (0,1).
[0075] The above method needs to solve two problems: First, the data code rate is unstable. The TransRate granularity is seconds, while the demodulator's data acquisition granularity is 1 / f = 10ms. Therefore, the number of data frames num_per_Package changes every 10ms, and the buffer should also change every 10ms, not 1s. Second, the specific setting of the buffer integration factor α needs to consider both latency and high-speed reception efficiency. If it is too small, it will lead to too short a filling time, too frequent system calls, too little data per operation, and too low efficiency, which cannot meet the requirements of high code rate.
[0076] To address problem one, this invention controls the buffer size in real time by pre-reading the demodulator data packet header information. The header information includes the data frame length nFrameLen, the number of frames num_per_Package, etc. Therefore, the formula for setting the buffer size of the current packet is:
[0077] bufferSize=α×num_per_Packege×nFrameLen(Byte)(4)
[0078] To address problem two, this invention introduces a delay factor β and a performance factor f. γ Together, they determine the comprehensive factor α. Since the data frame information contains the timestamp (dataTime) of the digital signal generated by the demodulator, β is defined as:
[0079]
[0080] Where currentTime is the system's current time, and TimeLimit is the threshold for latency requirements, such as 20ms in aerospace telemetry and control. β ranges from [0, +∞), representing the urgency of the current data to latency; a larger β indicates that the buffer should be as small as possible to ensure data is ejected as early as possible. γ Directly determined by equipment performance, it is defined as the minimum frequency of system function calls that the equipment can withstand, in Hz, f. γ The larger the value, the better the device performance, indirectly determining the minimum buffer the device can accept. For example, device f... γ The minimum is 1000Hz, meaning it can accept a system function call at least once every 1ms. Given a demodulator sampling frequency f = 100Hz, this means the demodulator can store a single data packet in a maximum of 10 buffers. The synthesis factor α is composed of β and f. γ Decision, and f γ ≥f, the specific formula for the comprehensive factor α is:
[0081]
[0082] The range of the comprehensive factor α is (0,1], when the delay factor... When β increases, the comprehensive factor α gradually decreases, indicating that the greater the time delay, the smaller the buffer. When α is a fixed size This means that when the latency is too high, the buffer is reduced to the minimum value that the system can accept, to ensure call efficiency and meet the requirements of high code rate.
[0083] After optimization, the data receiving module receives a data packet pushed by the demodulator. It first reads the frame length and frame count information from the packet header, and then determines the appropriate data based on the performance factor f preset by the device. γ Together with the latency factor β1 of the current data frame, the size of the receive buffer for this packet is calculated. Once the receive buffer is full, the data is immediately submitted to the data processing module, which processes it frame by frame. After processing, the size of the processing buffer is dynamically set according to the current latency factor β2. Once the processing buffer is full, it is pushed to the next application module.
[0084] The adaptive buffer method differs slightly for integrated telemetry and control demodulators. Integrated telemetry and control demodulators acquire data using a fixed data packet size. The frequency (f) of data packet acquisition and transmission varies depending on the code rate, but the size of each transmitted data packet remains fixed, making it data-driven. If the demodulator's single acquisition and transmission data packet size is DataLen, for high-speed data transmission demodulators, DataLen equals the product of num_per_Package and nFrameLen. num_per_Package varies with different code rates, but the transmission interval is fixed, such as 10ms. For integrated telemetry and control demodulators, DataLen is a fixed size, such as 4096 bytes, and the transmission interval varies with different code rates. Therefore, the buffer settings for both types of demodulators can be unified as follows:
[0085] bufferSize=α×DataLen (7)
[0086] For the integrated measurement and control demodulator, the delay factor β and performance factor f γ The definition is consistent with that in high-speed data transmission demodulators, but the push frequency f in the comprehensive factor α varies with the code rate. The specific formula is as follows:
[0087]
[0088] After optimization according to the above formula, the data receiving module receives a data packet pushed by the demodulator. First, it calculates f based on the code rate and the size of DataLen. The subsequent calculation process of the receiving buffer and processing buffer is the same as that of the high-speed data transmission demodulator.
[0089] After summarizing and unifying the buffer setting formula for high-speed data transmission demodulators and integrated measurement and control demodulators, it can be extended to any demodulator with data acquisition and push methods. The buffer is set as formula (7), which is the product of the comprehensive factor α and DataLen.
[0090] This embodiment proposes an adaptive method for adjusting the size of a multi-level response buffer that can take into account both high code rate characteristics and reduced data latency for data reception. This method introduces a comprehensive factor, a latency factor, and a performance factor to jointly implement an adaptive scheme, controlling the latency within 1 / f and meeting the requirements of TimeLimit (latency threshold).
[0091] This embodiment provides further explanation regarding data transmission.
[0092] When application software forwards data under the UDP protocol, the smaller the unit time for sending data packets and the more even the data packet sending interval, the lower the packet loss rate. That is, within the same unit of time, data packets should be evenly distributed across each time segment to ensure that data is sent in each time segment, rather than sending all data packets in one part of the unit of time while the rest of the time is idle, resulting in insufficient stability of data transmission.
[0093] For example, assuming a frame length of nFrameLen = 1024 bytes and the number of frames per packet num_per_Package = 1, for a bitrate of TransRate = 100Mbps, we can easily calculate the number of data packets needed per second to achieve the 100Mbps rate. The specific formula for calculating the number of data packets is as follows:
[0094]
[0095] If the control packet sending unit time is 1 second, let SendCos(ms) be the time taken for the software to detect and send 12800 data packets. If SendCos is greater than 1000ms, it indicates a sending rate lower than 100Mbps, which is disregarded and requires improved equipment performance. If SendCos is less than 1000ms, then Sleep = 1000 - SendCos(ms) is used to control the code rate to 100Mbps. In this case, the 12800 data packets are concentrated in the first 1000ms SendCos(ms) for forwarding, while the program idles during the subsequent Sleep(ms).
[0096] For the example above, we now reduce the unit time for sending data packets from second-level detection to millisecond-level detection. The application center's software detects the time taken to send approximately 12 data packets (Package_per_Time = 12800 / 1000 ≈ 12), compares this to the unit time of 1ms, and performs corresponding sleep or no operation. Reducing the unit time makes the interval between sent data packets more stable, ensuring that forwarded data packets are evenly distributed across milliseconds, avoiding long periods of idle time within a unit. While the above method can simply solve the instability problem caused by insufficient precision in controlling the packet sending unit time, it also has three significant drawbacks:
[0097] 1) If the granularity is reduced infinitely, the number of data packets sent per unit of time will be less than 1, and there will still be cases where multiple packets are sent at once;
[0098] 2) Due to the deviation in forwarding code rate caused by rounding, such as the 12 data packets in the example above being 12.8 rounded down, this process will reduce the overall final outward forwarding code rate.
[0099] 3) It does not take into account the problems caused by transmission delay fluctuations. For example, if the time to send data packets increases significantly due to CPU scheduling or network fluctuations in a certain unit of time, the subsequent data packet forwarding speed control method will lead to the accumulation of delay if it is not changed. This is not suitable for the network instability and large delay characteristics required in the field of aerospace telemetry and control data transmission.
[0100] This invention proposes a rate-controlled forwarding method, with three specific improvements:
[0101] 1. Change the rate control method from controlling the number of packets forwarded per unit time to controlling the time consumed by forwarding a unit number of packets. Using the previous example, with a bitrate of 100Mbps, a simple calculation shows that the time consumed to send one data packet should be controlled within [timeframe missing].
[0102]
[0103] This means that instead of controlling how many data packets should be sent in 1 second or 1 second, it controls how much time should be consumed to send one data packet. If the time consumed (SendCos(us)) is less than 78us, then sleep = Time_per_Package - SendCos(us). This operation can effectively solve the above-mentioned defects 1) and 2), controlling the sending time of a single data packet is the smallest logical granularity, which can ensure that the interval between each data packet is uniform and avoid the situation of continuous packet sending without sleep.
[0104] 2. Consider network fluctuations or CPU scheduling issues. Similar to the previous example, if sending a single data packet takes more than 78µs, record the excess value as nDifVal = SendCos – Time_per_Package. If nDifVal is less than the next round of Sleep, then in the next packet transmission, the excess value nDifVal from the previous round is deducted from the Sleep time to reduce sleep time and offset latency issues caused by network fluctuations and CPU scheduling. If nDifVal is greater than Sleep, then the Sleep time for multiple consecutive packets is deducted to resolve latency issues. The purpose is to ensure that the average bit rate of consecutive packets remains constant. Intuitively, when the sending rate fluctuates and drops, or data is delayed, the TransRate is increased to catch up with the average rate after the network or CPU recovers, thereby reducing data latency.
[0105] 3. Based on Improvement 2, further considering network fluctuations or CPU scheduling issues, when nDifVal is too large, a short-term high-speed forwarding phase with multiple packets forwarding continuously without sleep occurs. Due to the high packet concentration and lack of intervals during this phase, the probability of UDP packet loss increases. Therefore, a rate control method that integrates packet loss rate and latency is proposed, introducing a balance factor λ, the formula of which is:
[0106]
[0107] `time_least` is defined as the minimum time consumed to send a single packet. For example, if λ = 0.9, then in the previous example with a code rate of 100Mbps, `time_least` = 78 × 0.9 ≈ 70 (µs). Its purpose is to limit the upper limit of the forwarding code rate by setting the minimum interval between unit data packets. This reduces packet loss while gradually minimizing latency caused by network fluctuations or CPU scheduling. Furthermore, λ can adaptively change according to the latency level to achieve the best balance between packet loss and latency.
[0108] See Figure 3 Based on the specific code rate, number of frames per packet, and frame length of this invention, the time consumed in sending one data packet should be controlled within Time_per_Packege. The actual time consumed in sending one data packet, SendCos, is detected, and the balance factor λ = 1 is initialized. The first-level judgment is entered. If SendCos is greater than Time_per_Packege, it indicates that the data transmission has timed out and the set code rate value has not been reached. Therefore, the excess value nDif is recorded for later rate increases to catch up with the delay, and the next loop begins. If SendCos is less than or equal to Time_per_Packege, the second-level judgment is entered. If nDif is equal to 0, it means there is no delay at this time, so the system sleeps for the corresponding time to control the transmission speed and maintain a good packet loss rate; if nDif is greater than 0, it means there is a delay at this time, so λ is updated according to the formula:
[0109] λ=e -nDif / Time_per_Packege (12)
[0110] Formula (12) above uses nDif as the independent variable, with a value range of [0, +∞) and a value range of (0, 1]. It monotonically decreases within the independent variable region. It expresses that the larger the time delay, the smaller the balance factor λ, and the smaller the sleep time_least, that is, the smaller the minimum sleep time, which is reflected in the faster transmission rate. After calculating the new time_least, depending on the difference between SendCos and nDif, it enters different branches to sleep or directly enters the next round of loop. Figure 3 The dashed box indicates a step that requires hibernation.
[0111] This invention effectively solves the problem of choosing between packet loss rate and latency in an automated manner by introducing a balancing factor λ.
[0112] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be conceived by those skilled in the art within the technical scope disclosed in the present invention without creative effort should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A data reception and rate-controlled forwarding method based on an adaptive buffer, characterized in that: When the device receives data, it sets up multi-level buffers for receiving and processing data for demodulators with different data push methods. The size of each level of buffer can adaptively change according to the current code rate and data latency, while taking into account both high code rate and low latency characteristics. The device includes an antenna, a demodulator, a data receiving module, a data processing module, a data storage module, and a data distribution module, as well as a receiving buffer disposed after the data receiving module and a processing buffer disposed after the data processing module. The receiving buffer and processing buffer can simultaneously adapt to different data push methods of the high-speed data transmission demodulator and the integrated measurement and control demodulator. For both the high-speed data transmission demodulator and the integrated measurement and control demodulator, the sizes of the receiving buffer and the processing buffer are: Wherein, DataLen is the demodulator single acquisition push packet size, is the comprehensive factor; For high-speed data transmission demodulators, DataLen equals and The product of these has different code rates. It varies, but the push interval is fixed; for the integrated telemetry and control demodulator, DataLen is of fixed size, but the push interval varies depending on the code rate; num_per_Package is the number of frames in the current data packet, corresponding to 1 / 1000 bps of the demodulator's unit time. f The push data, f The frequency of data packet collection and transmission; nFrameLen represents the frame length of the data packet, in bytes; The comprehensive factor α is achieved by introducing a time delay factor β and a performance factor. f γ Let us decide together, and f γ ≥ f The formula is: ,f γ ≥ f In the formula, the range of the comprehensive factor α is (0,1], and when the delay factor β ≤ At that time, the comprehensive factor α gradually decreases as the delay factor β increases, which means that the greater the time delay, the smaller the buffer. When the time delay factor β is fixed, the comprehensive factor α is of fixed size , which represents that when the time delay is too large, the buffer size is reduced to the minimum value acceptable by the system, ensuring the calling efficiency to meet the requirement of high code rate. The latency factor β represents the urgency of the current data to latency, and the formula is: Where dataTime is the timestamp within the data frame information containing the digital signal generated by the demodulator, and currentTime is the system's current time. The threshold value for latency requirement is β, which ranges from [0, +∞), representing the urgency of the current data to delay. f γ defined as the minimum frequency of system function call that the device can bear, performance factor f γ The larger, the better the performance of the device, indirectly determines the minimum buffer that the device can accept; When the device forwards data to the outside world, for the UDP protocol, a rate-controlled forwarding method is adopted to control the time consumed by forwarding a unit number of packets. A balance factor λ is introduced to balance data latency and packet loss rate. The rate-controlled forwarding method is adaptively changed according to the current data latency and transmission stability, while taking into account both low latency and low packet loss rate characteristics. The formula for the balance factor λ is: Wherein, time_least is defined as the least time consumed for single packet transmission, Time consumed for transmitting one data packet; λ can be adaptively changed according to the latency level to balance the optimal effect of packet loss and latency. By setting the minimum interval between unit data packets, the upper limit of the forwarding code rate is limited, thereby reducing the packet loss rate while gradually reducing the latency caused by network fluctuations or CPU scheduling.
2. The adaptive buffer based data receiving and rate limiting forwarding method according to claim 1, wherein: When receiving data, the buffer is automatically increased or decreased based on the current device performance, current latency, and received processing code rate. When the data latency is high, the buffer is decreased to improve timeliness, and when the code rate is low, the buffer is increased to improve receiving and processing efficiency.
3. The adaptive buffer based data receiving and rate limiting forwarding method of claim 2, wherein, The device receives satellite data via an antenna, and the demodulator converts the electromagnetic waves into digital signals. The data receiving module receives data in real time at high speed and pushes it to the receiving buffer for temporary buffering. Once the receiving buffer is full, it is pushed to the data processing module. After processing the data frame by frame, the data processing module pushes it to the processing buffer. Once the processing buffer is full, the data is divided into two paths: one path is sent to the data storage module for disk storage; the other path is sent to the data distribution module for data forwarding.
4. The adaptive buffer based data receiving and rate limiting forwarding method of claim 3, wherein, High-speed data demodulators acquire data at a fixed frequency, and are time-driven. The integrated measurement and control demodulator has fixed data packet size for collecting data, and different code rates, i.e. different frequencies of collecting and pushing data packets f Different, belonging to data-driven.
5. The data reception and rate-controlled forwarding method based on an adaptive buffer according to claim 4, characterized in that: When the device receives a data packet pushed by the demodulator, it first reads the frame length and frame number information in the data packet, and then calculates the size of the data packet receiving buffer based on the performance factor preset by the device and the latency factor β1 of the current data frame. Once the receive buffer is full, the data is immediately submitted to the data processing module, which processes it frame by frame. After processing, the size of the processing buffer is dynamically set according to the current delay factor β2. Once the processing buffer is full, the data is pushed to the data distribution module and data storage module for data forwarding and storage.
6. The adaptive buffer based data receiving and rate limiting forwarding method of claim 5, wherein: For the high-speed data transmission demodulator, the number of frames in the current data packet is: Where TransRate is the code rate, in Mbps; For high speed data modem, DataLen is equal to and The product of code rate is different, is variable, but the push interval is fixed.
7. The adaptive buffer based data receiving and rate limiting forwarding method of claim 6, wherein, For integrated measurement and control demodulators, the integration factor Push frequency in f It varies with the code rate, specifically: The data receiving module receives one data packet pushed by the integrated measurement and control demodulator, and calculates the value based on the code rate and DataLen size. f The size of the receive buffer and the size of the processing buffer are then calculated.
8. The adaptive buffer based data receiving and rate limiting forwarding method according to claim 1, wherein, When the device forwards data to the outside world, for the UDP protocol, a rate-controlled forwarding method is adopted, which controls the time consumed by forwarding a unit number of packets. A balance factor λ is introduced to balance data latency and packet loss rate. The rate-controlled forwarding method is adaptively changed according to the current data latency and transmission stability. Specifically: Under the premise of controlling the uniformity of the forwarding data packet interval, when facing large data delay, the data transmission rate is increased and the data packet transmission interval is reduced to improve data timeliness; when facing high packet loss rate, the upper limit of the forwarding rate is limited, that is, the minimum interval of data packet forwarding is limited to reduce the packet loss rate.