A flow control method, system and terminal for a data terminal device

By generating and sending flow control signals between the data receiving device and the data transmission device, and controlling data transmission according to status parameters and flow control requirements, the problem of data loss in serial port connection is solved, and efficient and accurate data transmission control is achieved.

CN113806274BActive Publication Date: 2025-06-17E SURFING IOT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110952611.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2025-06-17
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

In the prior art, data loss often occurs in the serial connection between the data receiving device and the data transmission device, hardware flow control occupies interface pins, and software flow control is prone to misjudgment.

Method used

By generating and sending a flow control signal, a second flow control signal is generated based on the state parameters of the data transmission device and the flow control requirements of the data flow, and the data transmission process is accurately controlled to avoid data loss.

Benefits of technology

Accurate control of data transmission is achieved, packet loss and retransmission are reduced, terminal power consumption is reduced, and interface utilization is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113806274B_ABST
    Figure CN113806274B_ABST
Patent Text Reader

Abstract

A flow control method, system and terminal for a data terminal device provided by the present invention, the method steps include: receiving a first flow control signal from a data transmission device; determining that the first flow control signal is a first flow control character, and obtaining a data stream of the data transmission device; the data stream includes status parameters and sensor acquisition data; extracting a plurality of the status parameters from the data stream, and generating a second flow control signal according to the status parameters and the flow control requirements of the data stream; the solution realizes precise control of data transmission, improves the accuracy of judgment through an additional layer of judgment of software flow control characters, reduces packet loss, reduces retransmission or misoperation, and ultimately helps to reduce the power consumption of the terminal and improve the utilization rate of the interface, and can be widely applied to the field of wireless data communication technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wireless data communication, and in particular to a flow control method, system and terminal for a data terminal device. Background Art

[0002] In the related art, a data receiving device (receiving data) is connected to a data transmitting device (transmitting data) through a serial port. When data is transmitted between the two serial ports, data loss often occurs, and flow control is required to control the process of data reception and transmission to prevent data loss.

[0003] Among them, the flow control methods include hardware flow control and software flow control. Hardware flow control requires additional hardware pins, thus causing occupation of interface pins. For example, it occupies Arduino interface pins, increasing the development cost; while serial port software flow control needs to be implemented through general flow control characters, but the existing flow control methods or solutions in the prior art are prone to misjudgment. Summary of the Invention

[0004] In view of this, to at least partially solve one of the above technical problems, an embodiment of the present invention aims to provide a more accurate, more convenient and lower-cost flow control method for a data terminal device, as well as a system and terminal capable of implementing this method.

[0005] In a first aspect, a technical solution of the present application provides a flow control method for a data terminal device executed by a data receiving device, and its steps include:

[0006] Generate a first flow control signal and send it to the data transmitting device;

[0007] Determine that the first flow control signal is a first flow control character, and obtain the data stream of the data transmitting device;

[0008] Extract several state parameters of the data transmitting device from the data stream, and generate a second flow control signal according to the state parameters and the flow control requirements of the data stream;

[0009] Make the data transmitting device continue or terminate the transmission of the data stream through the second flow control signal.

[0010] In a feasible embodiment of the solution of the present application, after the step of receiving the first flow control signal of the data transmitting device, the method further includes the following steps:

[0011] Determine that the first flow control signal is a second flow control character, and make the data transmitting device stop the transmission of the data stream.

[0012] In a feasible embodiment of the solution of the present application, generating the second flow control signal according to the state parameter and the flow control requirement of the data stream further includes the following steps:

[0013] Set a data acquisition period, and acquire the state parameter according to the data acquisition period;

[0014] Determine the change of the state parameter according to at least two of the acquisition periods, and generate a second flow control signal according to the change of the state parameter and the flow control requirement of the data stream.

[0015] In a feasible embodiment of the solution of the present application, the state parameter includes at least one of the following data: voltage data, current data, and power consumption data;

[0016] Generating the second flow control signal according to the state parameter and the flow control requirement of the data stream includes the following steps:

[0017] Obtain the voltage data, the current data, and the power consumption data corresponding to a plurality of serial port baud rates;

[0018] Determine that the voltage data, the current data, and the power consumption data are greater than the lower threshold of the state parameter and less than the upper threshold of the state parameter, and use the first flow control character as the second flow control signal;

[0019] Alternatively, determine that the voltage data, the current data, and the power consumption data are less than the lower threshold of the state parameter or greater than the upper threshold of the state parameter, and use the second flow control character as the second flow control signal.

[0020] In a feasible embodiment of the solution of the present application, generating the second flow control signal according to the state parameter and the flow control requirement of the data stream further includes the following steps:

[0021] Generate a numerical relationship table of the voltage data, the current data, and the power consumption data;

[0022] Generate the second flow control signal according to the numerical relationship table to continue or terminate obtaining the data stream.

[0023] In a second aspect, the technical solution of the present application provides a data terminal device flow control method executed by a data transmission device, including the following steps:

[0024] Receive a first flow control signal sent by a data receiving device, and establish a communication connection with the data receiving device;

[0025] Send a data stream to the data receiving device through the communication connection; the data stream includes state parameters and sensor acquisition data;

[0026] Continue or terminate the transmission of the data stream according to the second flow control signal sent by the data receiving device; the second flow control signal is obtained by updating the first flow control signal according to the state parameter and the flow control requirement of the data stream.

[0027] In a feasible embodiment of the solution of the present application, the state parameter is obtained through the following steps:

[0028] Obtain sensor data, and collect the data packet of the state parameter through serial port communication at a preset baud rate.

[0029] In a third aspect, the technical solution of the present invention also provides a software system for flow control of a data terminal device, which includes:

[0030] An instruction generation module, configured to generate a first flow control signal;

[0031] A data processing module, configured to determine that the first flow control signal is a first flow control character, obtain a data stream, extract several state parameters from the data stream, and generate a second flow control signal according to the state parameter and the flow control requirement of the data stream;

[0032] A data transmission module, configured to send the first flow control signal, and continue or terminate the transmission of the data stream by the data transmission device according to the second flow control signal.

[0033] In a third aspect, the technical solution of the present invention also provides a hardware system for flow control of a data terminal device, which includes:

[0034] At least one processor;

[0035] At least one memory, configured to store at least one program;

[0036] When at least one program is executed by at least one processor, at least one processor runs any one of the data terminal device flow control methods in the first aspect or the second aspect.

[0037] In a fourth aspect, the technical solution of the present invention also provides a data terminal, in which a program executable by a processor is stored, and the program executable by the processor is used to run the method in the first aspect when executed by the processor.

[0038] The advantages and beneficial effects of the present invention will be partially given in the following description, and the other parts can be understood through the specific implementation manners of the present invention:

[0039] The technical solution of this application determines whether to perform data communication by sending a software flow control signal to a data terminal device and judging according to the control characters of the flow control signal; during the process of data communication and exchange, this solution compares the changes in the data in the data stream with the flow control requirements of the data stream in real time to determine that the current data stream meets the flow control requirements, so as to achieve precise control of data transmission. Through an additional layer of judgment of software flow control characters, the accuracy of judgment is improved, packet loss, retransmission or misoperation are reduced, and ultimately it is beneficial to reduce the power consumption of the terminal and improve the utilization rate of the interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0041] Figure 1 It is a flowchart of the steps of a method for flow control of a data terminal device provided by an embodiment of the present invention;

[0042] Figure 2 It is a flowchart of the steps of another method for flow control of a data terminal device provided by an embodiment of the present invention;

[0043] Figure 3 It is a schematic structural diagram of a flow control system for a data terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention. For the step numbers in the following embodiments, they are only set for the convenience of elaboration and explanation, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art. In the technical solution of the present application, the "flow" in flow control refers to the data stream. When data is transmitted between two serial ports, when the communication rates of both parties do not match, the phenomenon of data loss often occurs. For example, in the communication between a desktop computer and a single-chip microcomputer, if the data buffer at the receiving end is full, the data sent continuously will be lost. This problem was particularly prominent when network signals were transmitted through MODEMs in the early days. Therefore, the concept of flow control is introduced. When the data processing speed at the receiving end is insufficient, a "stop receiving" signal is sent, and the sending end stops sending until it receives a "can continue to send" signal and then sends data. Therefore, flow control can control the process of data transmission and prevent data loss. In the first aspect, as Figure 1 shown, a data terminal device flow control method executed by a data receiving device such as a data acquisition device or a data display device provided by the technical solution of the present application may mainly include S100-S400:

[0045] S100. Generate a first flow control signal and send it to the data transmission device;

[0046] In this embodiment, the first flow control signal is a signal for implementing flow control during the transmission between the data receiving device and the data transmission device. In this embodiment, the flow control signal may be the serial port software flow control characters XON / XOFF between the data receiving device and the data transmission device; specifically, the data receiving device in the embodiment first sends a flow control signal to the data transmission device through the serial port, and controls whether the data transmission device continues to transmit the data stream to the data receiving device according to the flow control signal.

[0047] S200. Determine that the flow control signal is the first flow control character and obtain the data stream of the data transmission device;

[0048] In this embodiment, the flow control signal is mainly the flow control character of the serial port software; among them, the first flow control character is XON, and the corresponding second flow control character is XOFF. XON and XOFF respectively represent continue and stop, and are data flow control protocols between computers and other components in an asynchronous serial connection. Exemplarily, the speed at which the data transmission device sends data to the data receiving device is usually faster than the speed of the data receiving device. The data receiving device includes a buffer that can be used to store data, enabling the data receiving device's ability to receive buffered data to match the data transmission speed of the data transmission device. When the data receiving device has processed a considerable amount of data, the buffer memory becomes empty. Before the data transmission device needs to transmit data to the data receiving device, the data receiving device first sends an XON signal, and the data receiving device reserves the data transmission interface or channel of the data transmission device for data transmission; the data sequence with a starting point and an ending point, such as several data or data packets during the transmission process, is the data flow.

[0049] In addition, in this embodiment, the data flow includes but is not limited to the state parameters of the data transmission device and the data collected by the sensor; the data transmission device in the embodiment transmits the two types of data to the data receiving device simultaneously through the data flow.

[0050] S300. Extract several state parameters of the data transmission device from the data flow, and generate a second flow control signal according to the state parameters and the flow control requirements of the data flow;

[0051] Specifically, during the process of the data receiving device in the embodiment receiving the data flow of the data transmission device through serial port communication, the data receiving device can regularly compare the relationship between the data in the data flow and the data flow, that is, the relationship between the state parameters and the flow control requirements of the data flow; for example, when judging whether the data value obtained regularly exceeds the upper and lower limits of the set data flow threshold, confirm whether the software flow control character of the data transmission device is a normal flow control character, etc.; then, feedback the corresponding flow control character to the data transmission device. Another example is that if the data receiving device confirms that the software flow control character of the data transmission device is an abnormal flow control character, the flow control software in the data receiving device generates a second flow control signal, that is, an XOFF signal, and feeds it back to the data transmission device to terminate the data flow transmission. Correspondingly, if the data receiving device confirms that the software flow control character of the data transmission device is a normal flow control character and is an XON signal, the flow control software in the data receiving device feeds back the XON signal to the data transmission device to continue the data flow transmission.

[0052] In an embodiment, taking the data related to the power supply as an example of the status parameters of the data transmission device, the corresponding relationships between the collected data voltage values, current values, power consumption values, etc. and the data stream can include the corresponding relationships between the flow control requirements of the data stream of the data transmission device under different signal strengths, different signal-to-noise ratios, etc. and the power consumption data of the power supply of the data transmission device, as well as determining the upper and lower limits of the threshold of the data stream corresponding to the power consumption data, etc. In the embodiment, the judgment process of this corresponding relationship can be used as an auxiliary confirmation process for the software flow control XON or XOFF signal, and can be used for the data receiving device to determine whether the flow control takes effect; the flow control signal fed back from the data receiving device to the data transmission device is the second flow control signal.

[0053] S400. Make the data transmission device continue or terminate the transmission of the data stream through the second flow control signal;

[0054] Specifically, according to the flow control signal fed back from the data receiving device to the data transmission device in step S300, determine whether the data transmission device can continue to transmit data to the data receiving device; for example, if the character in the flow control signal is XON, then continue to maintain the transmission of the signal stream, and the data transmission device continues to send the data collected by the sensor and the status parameters of the data transmission device to the data receiving device; otherwise, terminate the transmission of the data stream.

[0055] In some feasible embodiments, after receiving the first flow control signal of the data transmission device in step S100, the data receiving device flow control method may further include step S110:

[0056] S110. Determine that the first flow control signal is the second flow control character and stop receiving the data stream of the data transmission device;

[0057] Specifically, when the flow control signal sent by the data transmission device to the data receiving device is the second flow control character, that is, the XOFF signal, the data receiving device will refuse to receive the status parameters and the sensor collection data sent by the data transmission device.

[0058] In some feasible embodiments, step S300 of generating the second flow control signal according to the flow control requirements of the status parameters and the data stream in the method may further include steps S310 - S320:

[0059] S310. Set the data collection period and collect the status parameters according to the data collection period;

[0060] S320. Determine the change of the status parameters according to at least two collection periods, and generate the second flow control signal according to the change of the status parameters and the flow control requirements of the data stream;

[0061] Specifically, in the embodiment, a period for collecting status parameters of each data transmission device can be preset in advance. The status parameters collected in the previous and subsequent periods are compared to determine the change in the status parameters of the data transmission device. Further, based on the change in the parameter status and the relationship between the data flow control requirements between the data transmission device and the data receiving device, it is determined whether it is a real flow control requirement. For example, real-time collection increases the burden on the processing chip of the data receiving device and the power consumption data of the entire terminal. Finally, a flow control signal is generated that is fed back from the transmission device to the data receiving device. Exemplarily, the preset period in the embodiment is 10 ms. In two consecutive 10-ms periods, the current value of a certain data transmission device increases from 5 A to 25 A. Then, the data receiving device determines that the current value of the data transmission device is abnormal according to the pre-set current value safety warning program, and thus generates an XOFF signal for rejecting data and feeds it back to the data transmission device, and stops receiving the data stream of the data transmission device. It can be understood that the smaller the set period time, the more accurate the data flow control.

[0062] In some feasible embodiments, the status parameters include, but are not limited to, at least one of the following data: voltage data, current data, and power consumption data;

[0063] Correspondingly, in the process of generating the second flow control signal according to the status parameters and the data flow control requirements in the embodiment, steps S330-S350 can also be included:

[0064] S330. Obtain the voltage data, current data, and power consumption data corresponding to several serial port baud rates;

[0065] Specifically, in the embodiment, one data receiving device can be correspondingly connected to multiple data transmission devices, and each data transmission device sends its status parameters and the sensor data collected at different serial port baud rates.

[0066] S340. Determine that the voltage data, current data, and power consumption data are greater than the lower threshold of the status parameters and less than the upper threshold of the status parameters, and use the first flow control character as the second flow control signal;

[0067] Specifically, in the embodiment, the status parameters of different data transmission devices sent at different serial port baud rates are collected through step S330 to form the relationship between the status parameters and the data flow. This relationship is the threshold that the voltage parameter, current parameter, and power consumption parameter need to meet when transmitting data at this serial port baud rate. The threshold is preset in advance and can include an upper threshold and a lower threshold. When all three parameter values in the status parameters satisfy being greater than the lower threshold of the status parameters and less than the upper threshold of the status parameters, the data receiving device generates an XON flow control character as the flow control signal and feeds it back to the data transmission device.

[0068] S350. Determine that the voltage data, current data, and power consumption data are less than the lower threshold of the data stream or greater than the upper threshold of the data stream, and use the second flow control character as the second flow control signal;

[0069] Corresponding to step S340, when any one of the three parameter values in the status parameters is less than the lower threshold of the status parameters or greater than the upper threshold of the status parameters, the data receiving device generates a flow control character XOFF as the flow control signal and feeds it back to the data transmission device.

[0070] In some feasible embodiments, step S300 of generating the second flow control signal according to the status parameters and the flow control requirements of the data stream in the method may further include steps S360 - S370:

[0071] S360. Generate a numerical relationship table of voltage data, current data, and power consumption data;

[0072] S370. Generate the second flow control signal according to the numerical relationship table to continue or terminate obtaining the data stream.

[0073] Specifically, during the data transmission process in the sending state, the data transmission device in the embodiment requires a larger current, voltage, or generates a certain power consumption. Compared with the data transmission process without data, the consumed current, voltage, or generated power consumption is greater. The embodiment can collect the current, voltage, and power consumption data consumed in the sending state of different data transmission devices at different serial port baud rates, form the relationship between the current, voltage, or power consumption data and the data stream, and then implant the relationship table between the current, voltage, and power consumption and the data stream into the data processing module of the data receiving device. When in use, when the data transmission device sends the software flow control characters XON / XOFF to the data receiving device, the data receiving device collects the voltage, current, and power consumption data on the power supply line of the data transmission device, and by retrieving the implanted relationship table and the current data stream of the serial port communication, determines whether it is a real flow control requirement, and then feeds back the corresponding flow control signal to continue or terminate the data transmission of the data receiving device.

[0074] In a second aspect, as Figure 2 shown, the technical solution of the present application further provides a flow control method for a data receiving device of a data transmission device, including steps T100 - T300:

[0075] T100. Receive the first flow control signal sent by the data receiving device and establish a communication connection with the data receiving device;

[0076] T200. Send the data stream to the data receiving device through the communication connection; wherein, the data stream includes status parameters and sensor acquisition data;

[0077] T300 continues or terminates the transmission of the data stream according to the second flow control signal sent by the data receiving device; the second flow control signal is obtained by updating the first flow control signal according to the state parameter and the flow control requirement of the data stream;

[0078] Specifically, after the data transmission device receives the data packet sent by the sensor through the serial port, the current / power consumption consumed by the data transmission device is collected by the voltage / current acquisition module, and the collected data is transmitted to the data receiving device for storage and comparison. When the data transmission device receives the software flow control characters XON / XOFF sent by the data receiving device in the sending state, the data receiving device reads the data on the voltage / current acquisition module, and compares the stored data or queries the previously stored relationship table of current / power consumption and data stream (serial port) to determine whether it is a real flow control requirement. The acquisition and reading of voltage / current are analog-to-digital signals, and the rest of the process is digital signals.

[0079] In some feasible embodiments, the step of obtaining the state parameter in the method may specifically be to obtain sensor data and collect the data packet of the state parameter through serial port communication at a preset baud rate;

[0080] Specifically, in this embodiment, data is collected. For example, sensor data continuously sends data packets through serial port communication at a certain baud rate. After the data transmission device receives the data packet through the serial port, it can upload the data packet to the server through the cellular network.

[0081] In a third aspect, as Figure 3 shown, the technical solution of the present application further provides a flow control system for a data terminal device, which includes:

[0082] An instruction generation module for generating a first flow control signal;

[0083] A data processing module for determining that the first flow control signal is a first flow control character, obtaining a data stream, extracting several state parameters from the data stream, and generating a second flow control signal according to the state parameters and the flow control requirement of the data stream;

[0084] A data transmission module for sending the first flow control signal and making the data transmission device continue or terminate the transmission of the data stream according to the second flow control signal. In a fourth aspect, the technical solution of the present application further provides another flow control system for a data terminal device, which includes at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor runs a flow control method for a data terminal device as in the first aspect.

[0085] An embodiment of the present invention also provides a data terminal. A program is stored in the data terminal and is executed by a processor to implement the method in the first aspect or the second aspect.

[0086] From the above specific implementation process, it can be summarized that the technical solution provided by the present invention has the following advantages or advantages compared with the prior art:

[0087] 1. The technical solution of the present application does not require hardware flow control, and the development process is more free and efficient, without being restricted by hardware conditions;

[0088] 2. The technical solution of the present application has an additional layer of judgment on software flow control characters, improving the accuracy of judgment, reducing packet loss, thereby reducing retransmission or misoperation, and ultimately being beneficial to reducing the power consumption of the terminal;

[0089] 3. For the terminal connected by the Arduino interface, the technical solution of the present application can reduce the pins occupied by the Arduino interface due to the use of hardware flow control, improving the utilization rate of the interface.

[0090] In some alternative embodiments, the functions / operations mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowcharts of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated, where the order of various operations is changed and where sub-operations described as part of a larger operation are executed independently.

[0091] In addition, although the present invention is described in the context of functional modules, it should be understood that unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It can also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More precisely, considering the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the module will be understood within the ordinary skills of an engineer. Therefore, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation using ordinary skills. It can also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0092] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definitional sequence list of executable instructions for implementing logical functions, and can be embodied specifically in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices.

[0093] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0094] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and purposes of the present invention, and the scope of the present invention is defined by the claims and their equivalents.

[0095] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A flow control method for a data terminal device, characterized in that, Including the following steps: Generate a first flow control signal and send it to the data transmission device; Determine that the first flow control signal is a first flow control character and obtain the data stream of the data transmission device; Extract several status parameters of the data transmission device from the data stream, and generate a second flow control signal according to the status parameters and the flow control requirements of the data stream; the status parameters include at least one of the following data: voltage data, current data, and power consumption data; The step of generating the second flow control signal according to the status parameters and the flow control requirements of the data stream includes the following steps: Set a data acquisition period and acquire the status parameters according to the data acquisition period; Determine the change of the status parameters according to at least two of the acquisition periods, and generate a second flow control signal according to the change of the status parameters and the flow control requirements of the data stream; The step of generating the second flow control signal according to the status parameters and the flow control requirements of the data stream further includes the following steps: Acquire the current data, voltage data, and power consumption data consumed by different data transmission devices when sending statuses at different serial port baud rates; Generate a numerical relationship table of the voltage data, the current data, and the power consumption data; when the data transmission device sends software flow control characters XON / XOFF, acquire the voltage data, current data, and power consumption data on the power supply line of the data transmission device, and determine whether it is a real flow control requirement by retrieving the implanted numerical relationship table and the data stream of the current serial port communication; Generate the second flow control signal according to the numerical relationship table to continue or terminate obtaining the data stream; Make the data transmission device continue or terminate transmitting the data stream through the second flow control signal.

2. The flow control method for a data terminal device according to claim 1, characterized in that, After the step of receiving the first flow control signal of the data receiving device, the method further includes the following steps: Determine that the first flow control signal is a second flow control character and make the data transmission device stop transmitting the data stream.

3. The flow control method for a data terminal device according to claim 2, characterized in that, The step of generating the second flow control signal according to the status parameters and the flow control requirements of the data stream further includes the following steps: Obtain the voltage data, the current data, and the power consumption data corresponding to several serial port baud rates; Determine that the voltage data, the current data, and the power consumption data are greater than the threshold lower limit of the status parameters and less than the threshold upper limit of the status parameters, and use the first flow control character as the second flow control signal; Alternatively, determine that the voltage data, current data, and power consumption data are less than the threshold lower limit of the status parameters or greater than the threshold upper limit of the status parameters, and use the second flow control character as the second flow control signal.

4. A flow control method for a data terminal device, characterized in that, Including the following steps: Receive the first flow control signal sent by the data receiving device and establish a communication connection with the data receiving device; Send a data stream to the data receiving device through the communication connection; the data stream includes status parameters and sensor acquisition data; the status parameters include at least one of the following data: voltage data, current data, and power consumption data; The status parameters are obtained through the following steps: obtain sensor data, and acquire data packets of the status parameters through serial port communication at a preset baud rate; After receiving the data packet sent by the sensor through the serial port, the consumed current data or power consumption data is collected through the voltage / current acquisition module, and the collected data is transmitted to the data receiving device for storage and comparison; when receiving the software flow control characters XON / XOFF sent by the data receiving device in the sending state, the data receiving device reads the data on the voltage / current acquisition module, and compares the stored data or queries the relationship table between the previously stored current data / power consumption data and the serial port to determine whether it is a real flow control requirement; The data receiving device stores and compares the data collected by the voltage / current acquisition module, and sends a second flow control signal according to the relationship table between the current data / power consumption data and the serial port; Continue or terminate the transmission of the data stream according to the second flow control signal sent by the data receiving device; the second flow control signal is obtained by updating the first flow control signal according to the state parameter and the flow control requirement of the data stream.

5. A flow control system for a data terminal device, characterized in that, Comprising: An instruction generation module for generating a first flow control signal; A data processing module for determining that the first flow control signal is a first flow control character, obtaining a data stream, extracting several state parameters from the data stream, and generating a second flow control signal according to the state parameter and the flow control requirement of the data stream; the state parameter includes at least one of the following data: voltage data, current data, and power consumption data; the generating of the second flow control signal according to the state parameter and the flow control requirement of the data stream includes the following steps: setting a data acquisition period, and acquiring the state parameter according to the data acquisition period; determining the change of the state parameter according to at least two of the acquisition periods, and generating a second flow control signal according to the change of the state parameter and the flow control requirement of the data stream; the generating of the second flow control signal according to the state parameter and the flow control requirement of the data stream further includes the following steps: acquiring the current data, voltage data, and power consumption data consumed by different data transmission devices in the sending state at different serial port baud rates; generating a numerical relationship table of the voltage data, the current data, and the power consumption data; when the data transmission device sends the software flow control characters XON / XOFF, acquiring the voltage data, current data, and power consumption data on the power supply line of the data transmission device, and judging whether it is a real flow control requirement by retrieving the implanted numerical relationship table and the data stream of the current serial port communication; generating the second flow control signal according to the numerical relationship table to continue or terminate the acquisition of the data stream; A data transmission module for sending the first flow control signal and making the data transmission device continue or terminate the transmission of the data stream according to the second flow control signal.

6. A flow control system for a data terminal device, characterized in that, Comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor runs a flow control method for a data terminal device as described in any one of claims 1-4.

7. A data terminal in which a program executable by a processor is stored, characterized in that, The program executable by the processor is used to run a flow control method for a data terminal device as described in any one of claims 1-4 when executed by the processor.

Citation Information

Patent Citations

  • Method for sending plurality of data channels over single communications line and apparatus therefor

    CN1042814A

  • Method and system for transmitting data

    CN1983870A