Data transmission method and device, equipment and storage medium
By optimizing the data transmission method during methanol hydrogen production, using the serial communication interface and DMA controller, the problems of insufficient flexibility and delay in the methanol hydrogen production process are solved, and efficient and accurate data transmission is achieved.
Patent Information
- Application Number
- CN202411972314.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In the process of methanol hydrogen production, traditional data transmission methods have problems such as insufficient flexibility, delay or misjudgment, especially when rapid response is required, it is difficult to ensure the efficiency and accuracy of data transmission.
By obtaining the communication interface configuration information of the target data interaction terminal and the DMA controller setting parameters, the serial communication interface is initialized and the DMA controller is configured to prepare for data reception. Combined with the configuration of the serial communication interface, determine the IDLE time threshold and the data block size transmitted by DMA, establish a data reception comparison table and generate a data reception control model to achieve complete reception of data of any length.
It improves the flexibility of data transmission and the fault tolerance of the system, reduces the CPU's intervention in data handling, releases more computing resources, and improves the real-time performance and accuracy of data transmission.
Smart Images

Figure CN119814549A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a data transmission method, apparatus, device and storage medium. Background Art
[0002] In modern industry, methanol-to-hydrogen is an important method for producing hydrogen. It is widely used due to its advantages such as high efficiency and environmental protection. However, in actual operation, the process involves multiple complex and interrelated process parameters (such as temperature, pressure, flow rate, etc.). Changes in these parameters have a direct impact on the quality and output of the final hydrogen. In addition, due to the harsh reaction conditions (high temperature and high pressure environment), any abnormal state, if not discovered and handled in time, may lead to equipment damage, safety accidents and even product quality decline.
[0003] In order to ensure the safety and efficiency of the methanol-to-hydrogen process, a reliable monitoring system must be established to monitor key parameters in real time and respond quickly when anomalies are detected. Traditional data transmission methods often rely on fixed frame formats or communication protocols, which not only limits the flexibility of data, but may also cause delays or misjudgments, especially when a quick response is required. Therefore, it is necessary to develop a data transmission method suitable for the methanol-to-hydrogen process to achieve efficient and accurate data exchange. Summary of the invention
[0004] In order to provide a data transmission method suitable for a methanol-to-hydrogen process and realize efficient and accurate data exchange, the present application provides a data transmission method, device, equipment and storage medium.
[0005] In the first aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A data transmission method, comprising: Acquire the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and the DMA controller setting parameters, and configure the DMA controller to prepare for data reception; According to the configuration of the serial communication interface, determining an IDLE time threshold for detecting an idle state of a data stream, and setting a data block size and a buffer management strategy for DMA transmission; Establishing a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes corresponding to data packets of different lengths and corresponding buffer allocation rules; Obtain a data flow change reference range representing the sensitivity of the data flow change, combine the data reception comparison table and the obtained key parameter transmission identifier, and generate a data reception control model. The key parameter transmission identifier is used to characterize the processing priority of the key parameter. The data reception control model is used to control the data transmission operation of the target data interaction terminal.
[0006] By adopting the above technical scheme, the target data interaction terminal is a variety of intelligent terminals for parameter data collection, transmission and processing in the process of methanol hydrogen production, which is responsible for monitoring key parameters (such as temperature, pressure, flow, etc.) and transmitting this information to the control system or host computer in real time; the target data interaction terminal includes but is not limited to the control system or host computer. This application optimizes the communication interface configuration according to the characteristics of methanol hydrogen production equipment to ensure that the target data interaction terminal can also work stably and normally in complex and extreme environments; the IDLE time threshold for detecting the idle state of the data stream is determined according to the configuration of the serial communication interface, and the data block size and buffer management strategy for DMA transmission are set. Based on the burst data flow that may occur in the process of methanol hydrogen production, the size of the buffer is compliantly planned to avoid data overflow or loss of important information; further, this application is based on The construction of the data receiving comparison table and the data receiving control model ensures the priority processing of data of key parameters such as temperature and pressure by introducing key parameter transmission identifiers, thereby accelerating the recognition speed of abnormal states, that is, improving the detection speed and accuracy of abnormal states; thus, by using DMA transmission technology and serial port IDLE interrupts, the present application can realize the complete reception of data of any length through the data receiving control model without being restricted by a specific frame format or communication protocol, which not only improves the flexibility of data transmission, but also enhances the fault tolerance of the system; DMA transmission reduces the intervention of the CPU in data handling and releases more computing resources for other tasks; at the same time, the serial port IDLE interrupt is used as an indicator of the data packet boundary to ensure the timeliness and integrity of data reception, thereby improving the real-time performance of the entire data transmission system.
[0007] In a preferred example of the present application, the method includes: Monitor the communication line status of the target data exchange terminal, and when it is detected that the serial line changes from an active state to an idle state, trigger a serial port IDLE interrupt to mark the end of the previous data packet, and prepare to receive the next data packet according to the data reception comparison table; When a new data packet is received, DMA transfer is immediately activated to store the data directly into the preset memory buffer; Acquire actual data flow characteristics, input the actual data flow characteristics into the data receiving control model, and dynamically adjust the parameters of DMA transmission to adapt to the current data flow characteristics; Based on the preset monitoring frequency, monitor the serial port IDLE interrupt and respond to new data packets in time; When it is detected that key parameters exceed the preset safety range, an abnormal alarm instruction is generated and sent to the preset control terminal through a high-speed channel.
[0008] By adopting the above technical solution, when the serial port IDLE interrupt is triggered, it indicates that the transmission of the previous data packet has ended and is ready to receive the next data packet. The present invention improves the real-time response efficiency of the data transmission system by detecting the serial communication line status and interrupt triggering of the target data interaction terminal. At the same time, when a new data packet is received, DMA transmission can be activated immediately to store the data directly in a preset memory buffer, thereby reducing CPU intervention and improving transmission efficiency and system throughput. At the same time, when key parameters (such as temperature, pressure, flow, etc.) exceed the preset safety range, an abnormal alarm instruction is generated and sent to the preset control terminal through a high-speed channel to quickly handle potential problems and ensure the reliability of data transmission.
[0009] In a preferred example of the present application: the method further includes: Acquire communication environment parameters and a preset data transmission rate between a transmitting end and a receiving end, and determine a first predicted delay time of a data packet when starting transmission and a second predicted delay time when completing transmission according to the communication environment parameters and the preset data transmission rate; generating a data transmission rate comparison table for adjusting the data transmission rate according to the preset data transmission rate, the first predicted delay time and the second predicted delay time; Acquire a data transmission rate change reference range representing a data transmission rate change threshold, and generate a data transmission rate control model according to the data transmission rate change reference range and the data transmission rate comparison table; Acquire actual network status parameters, and input the actual network status parameters into the data transmission rate control model to adjust the data transmission rate.
[0010] By adopting the above technical scheme, the present application not only considers the communication interface configuration and DMA setting, but also adds the evaluation of the communication environment parameters between the transmitter and the receiver in the target data interaction terminal (such as channel quality, signal strength, interference level, distance, etc.), as well as the preset data transmission rate, so as to predict the first predicted delay time of the data packet at the beginning of transmission and the second predicted delay time when the transmission is completed, and constructs a data transmission rate control model in combination with the data transmission rate change reference range and comparison table to guide the rate adjustment strategy under actual network conditions; by making more accurate adjustments to the data transmission rate based on actual network conditions, the data transmission performance is further optimized, and the efficiency of data transmission is improved to be suitable for complex or unstable communication environments.
[0011] In a preferred example of the present application, the step of obtaining communication environment parameters and a preset data transmission rate between a transmitting end and a receiving end, and determining a first predicted delay time of a data packet when starting transmission and a second predicted delay time when completing transmission according to the communication environment parameters and the preset data transmission rate, specifically includes: Acquire communication environment parameters, wherein the communication environment parameters include channel quality, signal strength, interference, and the distance between the transmitting end and the receiving end, and the preset data transmission rate includes a maximum design transmission rate and a minimum design transmission rate; According to the minimum designed transmission rate, channel quality and interference level, a first predicted delay time when starting transmission is determined; according to the distance between the transmitting end and the receiving end, the maximum transmission rate, and the channel quality, a second predicted delay time when completing transmission is determined.
[0012] By adopting the above technical solution, the communication environment parameters can be analyzed in detail and the transmission delay time of the data packet can be predicted more accurately. The precise prediction helps to plan the data transmission strategy in advance and avoid the problems of low transmission efficiency or reduced service quality caused by delay.
[0013] In a preferred example of the present application, generating a data transmission rate comparison table for adjusting the data transmission rate based on the preset data transmission rate, the first predicted delay time and the second predicted delay time specifically includes: Acquire a predicted transmission time according to the distance between the transmitting end and the receiving end, the first predicted delay time and the second predicted delay time, and acquire a designed transmission time according to the minimum designed transmission rate and the maximum designed transmission rate; Acquire a predicted data transmission rate according to the maximum designed transmission rate, the predicted transmission time, and the designed transmission time; Calculating a ratio of the first predicted delay time to the second predicted delay time to obtain a predicted delay ratio for predicting an actual delay time; Calculating a transmission time difference between the predicted transmission time and the designed transmission time, and calculating a transmission rate difference between the predicted data transmission rate and the maximum designed transmission rate; According to the transmission time difference and the transmission rate difference, obtaining a predicted transmission rate time correspondence relationship for determining an actual transmission rate; A data transmission rate comparison table for adjusting the data transmission rate is generated according to the predicted delay ratio and the predicted transmission rate time correspondence.
[0014] By adopting the above technical solution, an accurate data transmission rate comparison table is created. The data transmission rate comparison table not only helps the system identify the optimal data transmission rate, but also improves the system's adaptability and response speed, which is conducive to maintaining efficient data transmission even when network conditions change, and can dynamically adjust the transmission rate according to actual conditions, thereby improving the overall data transmission performance and reliability.
[0015] In a preferred example of the present application: before determining the first predicted delay time when starting transmission according to the minimum designed transmission rate, the channel quality and the interference level, the method further includes: Acquiring a network congestion degree, and determining an initial transmission speed according to the network congestion degree and the communication environment parameters; According to the initial transmission speed, obtaining a delay adjustment coefficient for adjusting the first predicted delay time; The determining, according to the minimum designed transmission rate, the channel quality and the interference level, a first predicted delay time at the start of transmission specifically includes: A first predicted delay time when starting transmission is determined according to the delay adjustment coefficient, the minimum designed transmission rate, the channel quality and the interference level.
[0016] By adopting the above technical solution, the present invention introduces the evaluation of network congestion and the application of delay adjustment coefficient, which enhances the predictability and flexibility of the system. By understanding the network status in advance and adjusting the transmission strategy accordingly, it is possible to maintain high transmission efficiency and service quality in the case of network congestion. The application of the delay adjustment coefficient makes the prediction of delay time more accurate, helps to reduce unnecessary waiting time and resource waste, and ensures the smoothness and stability of data transmission.
[0017] In a preferred example of the present application, the obtaining of the actual network status parameter and inputting the actual network status parameter into the data transmission rate control model to adjust the data transmission rate specifically includes: Acquire actual network status parameters, input the actual network status parameters into the data transmission rate control model, and acquire a data transmission rate adjustment value; The data transmission rate is adjusted according to the data transmission rate adjustment value.
[0018] By adopting the above technical solution, the network status is monitored in real time and the transmission rate is adjusted dynamically. The system can respond quickly to changes in network conditions and maintain optimal transmission performance. Even when the network conditions are unstable or suddenly change, efficient data transmission can be guaranteed. Rate adjustment based on actual network status parameters can avoid the problem of low transmission efficiency caused by fixed rate settings, so as to facilitate flexible adjustment according to actual conditions, make full use of available bandwidth, reduce unnecessary transmission delays, and help improve data transmission efficiency.
[0019] In the second aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A data transmission system, applied to the data transmission method as described above, the system comprising: A configuration initialization module is configured to obtain the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and the DMA controller setting parameters, and configure the DMA controller to prepare for data reception; A parameter setting module, used to determine an IDLE time threshold for detecting an idle state of a data stream according to the configuration of the serial communication interface, and to set a data block size and a buffer management strategy for DMA transmission; A comparison table establishment module, used to establish a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes corresponding to data packets of different lengths and corresponding buffer allocation rules; A control model generation module is used to obtain a data flow change reference range representing the sensitivity of the data flow change, and generate a data reception control model in combination with the data reception comparison table and the obtained key parameter transmission identifier, wherein the key parameter transmission identifier is used to characterize the processing priority of the key parameter, and the data reception control model is used to control the data transmission operation of the target data interaction terminal.
[0020] By adopting the above technical solution, the configuration initialization module is used to obtain and apply specific communication interface configuration information and DMA controller setting parameters. The system can ensure compatibility with different types of terminal devices and stably prepare for data transmission. The automated initialization process reduces the need for manual configuration and improves the deployment speed and efficiency of the system. The pre-configuration of the DMA controller helps to reduce CPU intervention, optimize the use of system resources, and improve overall performance. In the parameter setting module, the setting of the IDLE time threshold enables the system to more accurately detect the idle state in the data stream, thereby responding to new data packets in a timely manner, improving the timeliness of data processing, and reducing data processing delays by optimizing DMA transmission parameters, thereby improving the throughput and response speed of the system. The comparison table establishment module is used to formulate specific processing rules for different types of data packets, ensuring the optimal allocation of resources and avoiding waste or excessive occupation of resources. The control model generation module can guide the system to select the optimal transmission rate under different conditions to ensure efficient data transmission.
[0021] In the third aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data transmission method when executing the computer program.
[0022] In a fourth aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned data transmission method are implemented.
[0023] In summary, the present application includes at least one of the following beneficial technical effects: 1. This application optimizes the configuration of the communication interface in view of the characteristics of the methanol hydrogen production equipment to ensure that the target data interaction terminal can also work stably and normally in complex and extreme environments; the IDLE time threshold for detecting the idle state of the data stream is determined according to the configuration of the serial communication interface, and the data block size and buffer management strategy for DMA transmission are set. Based on the burst data stream that may appear in the methanol hydrogen production process, the size of the buffer is planned in compliance with regulations to avoid data overflow or loss of important information; this application uses DMA transmission technology and serial port IDLE interrupts, and can achieve complete reception of data of any length through the data reception control model without being restricted by a specific frame format or communication protocol, which not only improves the flexibility of data transmission, but also enhances the fault tolerance of the system; DMA transmission reduces the CPU's involvement in data handling and releases more computing resources for other tasks; at the same time, the serial port IDLE interrupt is used as an indicator of the data packet boundary to ensure the timeliness and integrity of data reception, thereby improving the real-time performance of the entire data transmission system; 2. The present invention introduces the evaluation of network congestion and the application of delay adjustment coefficients, which enhances the predictability and flexibility of the system. By understanding the network status in advance and adjusting the transmission strategy accordingly, it is possible to maintain high transmission efficiency and service quality in the case of network congestion. The application of the delay adjustment coefficient makes the prediction of delay time more accurate, helps to reduce unnecessary waiting time and resource waste, and ensures the smoothness and stability of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a flow chart of a data transmission method in an embodiment of the present application; Figure 2 It is a flow chart of a data transmission method in one embodiment of the present application; Figure 3 is another flow chart of a data transmission method in one embodiment of the present application; Figure 4 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The present application is further described in detail below in conjunction with the accompanying drawings.
[0026] In one embodiment, if Figure 1 As shown, the present application discloses a data transmission method, which specifically includes the following steps: S1: obtaining the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initializing the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and DMA controller setting parameters, and configuring the DMA controller to prepare for data reception.
[0027] In this embodiment, the communication interface configuration information refers to the specific settings of the communication port (such as UART, SPI, I2C, etc.) of the target data interaction terminal (such as a microcontroller or a computer), including baud rate, data bits, stop bits, check bits, etc.; DMA controller setting parameters refer to configuration parameters involving the DMA (direct memory access) controller, such as channel selection, trigger conditions, transmission direction, and data width.
[0028] S2: According to the configuration of the serial communication interface, determine the IDLE time threshold for detecting the idle state of the data stream, and set the data block size and buffer management strategy for DMA transmission.
[0029] In this embodiment, the IDLE time threshold refers to the time threshold used to detect the idle state of the data stream, that is, the time period within which no new data is received is considered to be an idle state; the data block size of DMA transfer refers to the amount of data transferred each time DMA transfers, which affects the transmission efficiency and memory usage; the buffer management strategy is used to define how to allocate and manage the buffer used to temporarily store data, including allocation methods, overflow processing, etc.
[0030] S3: Establish a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes corresponding to data packets of different lengths and corresponding buffer allocation rules.
[0031] In this embodiment, the data receiving comparison table is a table that defines DMA operation modes and corresponding buffer allocation rules corresponding to data packets of different lengths in a mapping manner.
[0032] Specifically, we first count and analyze the various data packet lengths that may appear in actual applications, and then define the most suitable DMA operation mode (such as single transmission, continuous transmission, etc.) for data packets of different lengths. Then, we set specific buffer allocation rules for each data packet length to ensure efficient use of memory resources. The above information is integrated into a comparison table for reference in the subsequent data reception process.
[0033] S4: Obtain a data flow change reference range representing the sensitivity of the data flow change, combine the data reception comparison table and the obtained key parameter transmission identifier, and generate a data reception control model. The key parameter transmission identifier is used to characterize the processing priority of the key parameter. The data reception control model is used to control the data transmission operation of the target data interaction terminal.
[0034] In this embodiment, the data stream change sensitivity is used to indicate the degree of response of the data stream to environmental changes, such as channel quality, interference level, etc.; the key parameter transmission identifier is used to mark the priority category of the monitored parameters to distinguish the key parameters that need to be processed first among the massive monitored parameters.
[0035] Specifically, the data receiving control model is an intelligent model obtained by modeling, training and verification using a machine learning algorithm (such as a decision tree, a neural network) or a rule-based expert system.
[0036] In one embodiment, if Figure 2 As shown, a data transmission method also includes: S10: Monitor the communication line status of the target data exchange terminal. When the serial line is detected to change from an active state to an idle state, trigger the serial port IDLE interrupt to mark the end of the previous data packet and prepare to receive the next data packet according to the data reception comparison table.
[0037] S20: When a new data packet is received, DMA transmission is immediately activated to store the data directly into a preset memory buffer.
[0038] In this embodiment, DMA transfer is direct memory access (Direct Memory Access), a technology that allows rapid data transfer between peripherals and memory without CPU intervention. DMA transfer is an operation independent of the CPU and can maintain stable data transmission even under high load conditions; the memory buffer is a preset memory area used to temporarily store received data.
[0039] S30: Acquire actual data flow characteristics, input the actual data flow characteristics into the data receiving control model, and dynamically adjust the DMA transmission parameters to adapt to the current data flow characteristics.
[0040] In this embodiment, the actual data flow characteristics include but are not limited to data flow, rate, delay and other characteristics, which reflect the current network status.
[0041] S40: Based on the preset monitoring frequency, monitor the serial port IDLE interruption and respond to the new data packet in time.
[0042] In this embodiment, according to the set frequency, it is checked regularly whether there is a new serial port IDLE interrupt event; once a new IDLE interrupt is detected, it responds immediately and prepares to receive a new data packet.
[0043] S50: When it is detected that the key parameter exceeds the preset safety range, an abnormal alarm instruction is generated and sent to a preset control terminal through a high-speed channel.
[0044] In this embodiment, key parameters include temperature, pressure, flow, etc., and specific parameters can be customized according to actual usage scenarios and monitoring content; the safety range refers to a pre-set threshold interval, and if it exceeds this interval, it is considered that there is a potential problem; the abnormal alarm instruction refers to the warning information generated when the key parameters exceed the safety range, which is used to notify the administrator or control system to take measures; the high-speed channel is a communication path specifically used to quickly transmit alarm information to ensure that the alarm can be conveyed quickly.
[0045] In one embodiment, if Figure 3 As shown, a data transmission method also includes: S11: Obtain communication environment parameters and a preset data transmission rate between a transmitting end and a receiving end, and determine a first predicted delay time of a data packet when starting transmission and a second predicted delay time when completing transmission according to the communication environment parameters and the preset data transmission rate.
[0046] Specifically, the communication environment parameters include channel quality, signal strength, interference level, the distance between the transmitter and the receiver, etc.; the preset data transmission rate refers to the maximum design transmission rate and the minimum design transmission rate preset by the system.
[0047] S12: Generate a data transmission rate comparison table for adjusting the data transmission rate according to the preset data transmission rate, the first predicted delay time and the second predicted delay time.
[0048] Specifically, the data transmission rate comparison table defines the optimal data transmission rate under different conditions, helping the system to adjust the transmission rate according to actual conditions.
[0049] S13: Acquire a data transmission rate change reference range representing a data transmission rate change threshold, and generate a data transmission rate control model according to the data transmission rate change reference range and a data transmission rate comparison table.
[0050] In this embodiment, the data transmission rate change threshold is a set data transmission rate change range, which is used to determine whether the transmission rate needs to be adjusted. The data transmission rate comparison table can quickly guide the system to select a suitable transmission rate, simplify the decision-making process, and enable the system to flexibly adjust the transmission strategy according to different communication environments, thereby enhancing the adaptability.
[0051] Specifically, according to application requirements and system performance indicators, a reasonable change threshold is set, such as a transmission rate fluctuation of ±10%. The data transmission rate comparison table is combined with the set change threshold to form a complete input data set. Based on the input data set, a control model is constructed that can adjust the data transmission rate in real time to ensure that the system can maintain optimal performance in a changing network environment.
[0052] S14: Acquire actual network status parameters, and input the actual network status parameters into a data transmission rate control model to adjust the data transmission rate.
[0053] In this embodiment, the data transmission rate control model is dynamically adjusted according to the real-time network status, which can quickly respond to network changes, optimize resource utilization, and improve user experience.
[0054] In one embodiment, in step S11, a communication environment parameter and a preset data transmission rate between a transmitting end and a receiving end are obtained, and a first predicted delay time when a data packet starts transmission and a second predicted delay time when transmission is completed are determined according to the communication environment parameter and the preset data transmission rate, specifically including: S111: Acquire communication environment parameters, where the communication environment parameters include channel quality, signal strength, interference, and the distance between the transmitter and the receiver. The preset data transmission rates include a maximum design transmission rate and a minimum design transmission rate.
[0055] Specifically, use channel monitoring tools or sensors to obtain quality indicators of the current channel in real time, such as bit error rate and signal-to-noise ratio; measure the received signal strength through the antenna or interface of the receiving end to evaluate the strength of the signal; evaluate the interference level by analyzing the surrounding electromagnetic environment to detect whether there is interference from other wireless devices and the degree of interference; use physical positioning technology to measure the actual physical distance between the transmitter and the receiver, and set the maximum design transmission rate and minimum design transmission rate according to application requirements and technical specifications.
[0056] S112: Determine a first predicted delay time when starting transmission according to the minimum designed transmission rate, channel quality and interference level.
[0057] Specifically, since channel quality and interference level are important factors affecting data transmission speed and reliability, the minimum design transmission rate refers to the lowest transmission rate set by the system, which is usually used for data transmission in the worst case. The first predicted delay time refers to the time from the start of transmission to the arrival of the first data. The first predicted delay time is calculated by using a predefined mathematical model or formula, combined with the minimum design transmission rate and the transmission delay factor.
[0058] For example, the first predicted delay time T d1 The calculation formula is: T d1 =L / R min ×exp(-k 1 ×SNR)+D / C Where L represents the size of the data packet to be transmitted (also called the data packet length); L / R minis the basic transmission time calculated based on the minimum design transmission rate, L is the packet length; the signal-to-noise ratio SNR represents the channel quality, where k 1 is a constant determined experimentally. Taking into account the interference level I, k 1 =1+α*I, α is a constant coefficient determined based on experimental experience, I is used to characterize the degree of electromagnetic interference in the surrounding environment; D is the distance between the transmitter and the receiver, and C is the signal propagation speed (such as the speed of light, about 3×10^8 meters / second).
[0059] S113: Determine a second predicted delay time when the transmission is completed according to the distance between the transmitting end and the receiving end, the maximum transmission rate, and the channel quality.
[0060] Specifically, the maximum transmission rate is the highest transmission rate set by the system, which is usually used for data transmission under optimal conditions; the second predicted delay time is the time from the start of transmission to the arrival of the last bit, and a predefined mathematical model or formula is used to combine the maximum transmission rate and the transmission time factor to calculate the second predicted delay time. The data transmission method of the present invention realizes a comprehensive perception of the communication environment and can accurately predict the transmission delay of data packets at different stages.
[0061] For example, the second predicted delay time T d2 The calculation formula is: T d2 =D / C+L / R max ×(1+k 2 ×BER)+T p Where BER is the bit error rate, k 2 is a constant determined experimentally, L / R max is the basic transmission time calculated based on the minimum design transmission rate, T p is the signal propagation time.
[0062] In one embodiment, in step S12, a data transmission rate comparison table for adjusting the data transmission rate is generated according to the preset data transmission rate, the first predicted delay time and the second predicted delay time, specifically including: S121: Obtain a predicted transmission time according to the distance between the transmitting end and the receiving end, the first predicted delay time and the second predicted delay time, and obtain a designed transmission time according to a minimum designed transmission rate and a maximum designed transmission rate.
[0063] In this embodiment, the predicted transmission time T pr =D / v+T d1 +T d1 ; Designed transmission time T des Equal to L / R max .
[0064] S122: Obtain a predicted data transmission rate according to the maximum designed transmission rate, the predicted transmission time, and the designed transmission time.
[0065] Specifically, the predicted transmission time is the estimated transmission time of the entire data packet obtained from S121, the designed transmission time is the transmission time under ideal conditions obtained from S121, and the predicted data transmission rate R is pr =R max ×T des / R max .
[0066] S123: Calculate the ratio of the first predicted delay time to the second predicted delay time to obtain a predicted delay ratio for predicting the actual delay time.
[0067] S124: Calculate the transmission time difference between the predicted transmission time and the designed transmission time, and calculate the transmission rate difference between the predicted data transmission rate and the maximum designed transmission rate.
[0068] S125: Obtaining a predicted transmission rate-time correspondence for determining an actual transmission rate according to the transmission time difference and the transmission rate difference.
[0069] Specifically, the predicted transmission rate-time correspondence describes the variation rule of the corresponding transmission time under different transmission rates.
[0070] S126: Generate a data transmission rate comparison table for adjusting the data transmission rate according to the predicted delay ratio and the predicted transmission rate time correspondence.
[0071] Specifically, the data transmission rate comparison table defines the optimal transmission rates corresponding to different conditions.
[0072] In one embodiment, before step S112, a data transmission method further includes: S1121: Obtain the degree of network congestion, and determine the initial transmission speed according to the degree of network congestion and communication environment parameters.
[0073] In this embodiment, the communication environment parameters include channel quality (such as bit error rate BERBER or signal-to-noise ratio SNRSNR), signal strength, interference level, etc.; the initial transmission speed is the data transmission starting rate determined based on the network congestion level and the communication environment parameters.
[0074] Specifically, a network monitoring tool or protocol (such as TCP window size, queue length) is used to obtain the current network congestion level in real time.
[0075] S1122: Obtain a delay adjustment coefficient for adjusting the first predicted delay time according to the initial transmission speed.
[0076] In this embodiment, the delay adjustment coefficient refers to a factor used to adjust the first predicted delay time.
[0077] Further, in step S112, judging a first predicted delay time at the start of transmission according to the minimum designed transmission rate, channel quality and interference level specifically includes: S1120: Determine a first predicted delay time when starting transmission according to the delay adjustment coefficient, the minimum designed transmission rate, the channel quality and the interference level.
[0078] In this embodiment, by comprehensively considering the delay adjustment coefficient, the minimum design transmission rate, the channel quality and the interference level, the system can more accurately predict the delay time when the data packet starts to be transmitted, thereby optimizing the preparation work of the receiving end.
[0079] Specifically, in one embodiment, in step S14, obtaining actual network status parameters and inputting the actual network status parameters into a data transmission rate control model to adjust the data transmission rate specifically includes: S141: Acquire actual network status parameters, input the actual network status parameters into a data transmission rate control model, and acquire a data transmission rate adjustment value.
[0080] In this embodiment, the actual network status parameters include channel quality (such as bit error rate BERBER or signal-to-noise ratio SNRSNR), signal strength, interference level, network congestion level, etc.; the data transmission rate control model is a logical or mathematical model used to guide and optimize the data transmission rate, and is adjusted based on historical data and real-time monitoring parameters; the data transmission rate adjustment value is a new transmission rate calculated according to the actual network status parameters and the control model.
[0081] S142: Adjust the data transmission rate according to the data transmission rate adjustment value.
[0082] In this embodiment, the new transmission rate adjustment value is notified to the relevant components of the sending end and the receiving end (such as the DMA controller, the communication interface, etc.) to ensure that they update the configuration synchronously; the transmission rate of the sending end is actually adjusted to the new value, and the receiving end is notified to prepare to receive data packets at the new rate.
[0083] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0084] In one embodiment, a data transmission system is provided, and the data transmission system corresponds to a data transmission method in the above embodiment.
[0085] A data transmission system includes a configuration initialization module, a parameter setting module, a comparison table establishment module and a control model generation module. The detailed description of each functional module is as follows: A configuration initialization module is configured to obtain the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and the DMA controller setting parameters, and configure the DMA controller to prepare for data reception; The parameter setting module is used to determine the IDLE time threshold for detecting the idle state of the data stream according to the configuration of the serial communication interface, and to set the data block size and buffer management strategy of the DMA transmission; A comparison table establishment module is used to establish a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes corresponding to data packets of different lengths and corresponding buffer allocation rules; The control model generation module is used to obtain a reference range of data flow changes representing the sensitivity of data flow changes, and generate a data reception control model in combination with a data reception comparison table and the obtained key parameter transmission identifier. The key parameter transmission identifier is used to characterize the processing priority of the key parameter. The data reception control model is used to control the data transmission operation of the target data interaction terminal.
[0086] For the specific definition of a data transmission system, please refer to the definition of a data transmission method in the above text, which will not be repeated here; each module in the above-mentioned data transmission system can be implemented in whole or in part by software, hardware and a combination thereof; each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0087] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store communication interface configuration information, DMA controller setting parameters and buffer allocation rules, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data transmission method is implemented.
[0088] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1: Obtain the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and DMA controller setting parameters, and configure the DMA controller to prepare for data reception; S2: According to the configuration of the serial communication interface, determine the IDLE time threshold for detecting the idle state of the data stream, and set the data block size and buffer management strategy for DMA transmission; S3: establishing a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes and corresponding buffer allocation rules corresponding to data packets of different lengths; S4: Obtain a data flow change reference range representing the sensitivity of the data flow change, combine the data reception comparison table and the obtained key parameter transmission identifier, and generate a data reception control model. The key parameter transmission identifier is used to characterize the processing priority of the key parameter. The data reception control model is used to control the data transmission operation of the target data interaction terminal.
[0089] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: S1: Obtain the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and DMA controller setting parameters, and configure the DMA controller to prepare for data reception; S2: According to the configuration of the serial communication interface, determine the IDLE time threshold for detecting the idle state of the data stream, and set the data block size and buffer management strategy for DMA transmission; S3: establishing a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes and corresponding buffer allocation rules corresponding to data packets of different lengths; S4: Obtain a data flow change reference range representing the sensitivity of the data flow change, combine the data reception comparison table and the obtained key parameter transmission identifier, and generate a data reception control model. The key parameter transmission identifier is used to characterize the processing priority of the key parameter. The data reception control model is used to control the data transmission operation of the target data interaction terminal.
[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0091] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0092] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the features thereof may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: include: Acquire the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and the DMA controller setting parameters, and configure the DMA controller to prepare for data reception; According to the configuration of the serial communication interface, determining an IDLE time threshold for detecting an idle state of a data stream, and setting a data block size and a buffer management strategy for DMA transmission; Establishing a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes corresponding to data packets of different lengths and corresponding buffer allocation rules; Obtain a data flow change reference range representing the sensitivity of the data flow change, combine the data reception comparison table and the obtained key parameter transmission identifier, and generate a data reception control model. The key parameter transmission identifier is used to characterize the processing priority of the key parameter. The data reception control model is used to control the data transmission operation of the target data interaction terminal.
2. A data transmission method according to claim 1, characterized in that: The method comprises: Monitor the communication line status of the target data exchange terminal, and when it is detected that the serial line changes from an active state to an idle state, trigger a serial port IDLE interrupt to mark the end of the previous data packet, and prepare to receive the next data packet according to the data reception comparison table; When a new data packet is received, DMA transfer is immediately activated to store the data directly into the preset memory buffer; Acquire actual data flow characteristics, input the actual data flow characteristics into the data receiving control model, and dynamically adjust the parameters of DMA transmission to adapt to the current data flow characteristics; Based on the preset monitoring frequency, monitor the serial port IDLE interrupt and respond to new data packets in time; When it is detected that key parameters exceed the preset safety range, an abnormal alarm instruction is generated and sent to the preset control terminal through a high-speed channel.
3. A data transmission method according to claim 1, characterized in that: The method further comprises: Acquire communication environment parameters and a preset data transmission rate between a transmitting end and a receiving end, and determine a first predicted delay time of a data packet when starting transmission and a second predicted delay time when completing transmission according to the communication environment parameters and the preset data transmission rate; generating a data transmission rate comparison table for adjusting the data transmission rate according to the preset data transmission rate, the first predicted delay time and the second predicted delay time; Acquire a data transmission rate change reference range representing a data transmission rate change threshold, and generate a data transmission rate control model according to the data transmission rate change reference range and the data transmission rate comparison table; Acquire actual network status parameters, and input the actual network status parameters into the data transmission rate control model to adjust the data transmission rate.
4. A data transmission method according to claim 3, characterized in that: The acquiring of the communication environment parameters and the preset data transmission rate between the transmitting end and the receiving end, and determining the first predicted delay time of the data packet when starting transmission and the second predicted delay time when completing transmission according to the communication environment parameters and the preset data transmission rate, specifically includes: Acquire communication environment parameters, wherein the communication environment parameters include channel quality, signal strength, interference, and the distance between the transmitting end and the receiving end, and the preset data transmission rate includes a maximum design transmission rate and a minimum design transmission rate; Determining a first predicted delay time at the start of transmission according to the minimum designed transmission rate, channel quality and interference level; The second predicted delay time when the transmission is completed is determined according to the distance between the transmitting end and the receiving end, the maximum transmission rate, and the channel quality.
5. A data transmission method according to claim 4, characterized in that: The step of generating a data transmission rate comparison table for adjusting the data transmission rate according to the preset data transmission rate, the first predicted delay time and the second predicted delay time specifically includes: Acquire a predicted transmission time according to the distance between the transmitting end and the receiving end, the first predicted delay time and the second predicted delay time, and acquire a designed transmission time according to the minimum designed transmission rate and the maximum designed transmission rate; Acquire a predicted data transmission rate according to the maximum designed transmission rate, the predicted transmission time, and the designed transmission time; Calculating a ratio of the first predicted delay time to the second predicted delay time to obtain a predicted delay ratio for predicting an actual delay time; Calculating a transmission time difference between the predicted transmission time and the designed transmission time, and calculating a transmission rate difference between the predicted data transmission rate and the maximum designed transmission rate; According to the transmission time difference and the transmission rate difference, obtaining a predicted transmission rate time correspondence relationship for determining an actual transmission rate; A data transmission rate comparison table for adjusting the data transmission rate is generated according to the predicted delay ratio and the predicted transmission rate time correspondence.
6. A data transmission method according to claim 4, characterized in that: Before determining the first predicted delay time when starting transmission according to the minimum designed transmission rate, the channel quality and the interference level, the method further includes: Acquiring a network congestion degree, and determining an initial transmission speed according to the network congestion degree and the communication environment parameters; According to the initial transmission speed, obtaining a delay adjustment coefficient for adjusting the first predicted delay time; The determining, according to the minimum designed transmission rate, the channel quality and the interference level, a first predicted delay time at the start of transmission specifically includes: A first predicted delay time when starting transmission is determined according to the delay adjustment coefficient, the minimum designed transmission rate, the channel quality and the interference level.
7. A data transmission method according to claim 3, characterized in that: The obtaining of actual network status parameters and inputting the actual network status parameters into the data transmission rate control model to adjust the data transmission rate specifically includes: Acquire actual network status parameters, input the actual network status parameters into the data transmission rate control model, and acquire a data transmission rate adjustment value; The data transmission rate is adjusted according to the data transmission rate adjustment value.
8. A data transmission system, characterized in that: Applied to the data transmission method according to any one of claims 1 to 7, the system comprises: A configuration initialization module is configured to obtain the communication interface configuration information and DMA controller setting parameters of the target data interaction terminal, initialize the serial communication interface to enable the serial port IDLE terminal according to the communication interface configuration information and the DMA controller setting parameters, and configure the DMA controller to prepare for data reception; A parameter setting module, used to determine an IDLE time threshold for detecting an idle state of a data stream according to the configuration of the serial communication interface, and to set a data block size and a buffer management strategy for DMA transmission; A comparison table establishment module, used to establish a data receiving comparison table for comparing and adjusting the data receiving mechanism, wherein the data receiving comparison table defines DMA operation modes corresponding to data packets of different lengths and corresponding buffer allocation rules; A control model generation module is used to obtain a data flow change reference range representing the sensitivity of the data flow change, and generate a data reception control model in combination with the data reception comparison table and the obtained key parameter transmission identifier, wherein the key parameter transmission identifier is used to characterize the processing priority of the key parameter, and the data reception control model is used to control the data transmission operation of the target data interaction terminal.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the data transmission method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a data transmission method as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for receiving serial port variable-length data based on DMA and FIFO
CN114238188A
DMA data transmission method, DMA data transmission device and data transmission system
CN114884909A
FC (Fiber Channel) equipment adaptive rate DMA (Direct Memory Access) communication method and communication system based on multiple partitions
CN118631773A
Data transmission method and device, computer equipment and readable storage medium
CN119011629A
Data transmission method and device, nonvolatile storage medium and electronic equipment
CN119135580A
Cited By
Method and system-on-chip for dynamically adjusting transmission rate of serial peripheral interface
CN120762519A
A method for dynamically adjusting the transmission rate of a serial peripheral interface and a system-on-a-chip.
CN120762519B