Embedded software serial port data transmission method, device, equipment, medium and product
By implementing sampling and cache screening strategies in the embedded system, filtering and transmitting the target data of the embedded software to the superior computer, the problem of low data transmission rate in the embedded system is solved, improving the efficiency of problem analysis and maintaining analysis accuracy.
Patent Information
- Application Number
- CN202510349417.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-04
AI Technical Summary
When the closed-loop control results of the embedded system do not meet expectations, all relevant data is transmitted to the upper computer through the serial port, resulting in a low data transmission rate and reducing the efficiency of problem analysis.
Implement filtering strategies in preset application scenarios in embedded software, including sampling filtering strategies and cache filtering strategies, filtering out target data and transmitting them to the superior computer, reducing the amount of data and improving transmission efficiency.
Reduce data transmission time through filtering strategies, improve problem analysis efficiency, while retaining the characteristics of the data to ensure analysis accuracy.
Smart Images

Figure CN120256366A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of serial communication, and in particular to a method, device, equipment, medium and product for serial port data transmission of embedded software. Background Art
[0002] Currently, embedded systems usually use embedded software to implement closed-loop control. Due to the limited computing power of embedded products, when the closed-loop control result does not meet the expectation, relevant data in the closed-loop control process is usually transmitted to the host computer through the serial port, and the host computer analyzes the relevant data to determine the reason why the closed-loop control result does not meet the expectation and determine a solution, so that the embedded product can continue the closed-loop control.
[0003] However, the rate of serial port data transmission is low, and it takes a long time to transmit all relevant data to the host computer, which will reduce the efficiency of problem analysis. Summary of the Invention
[0004] The present invention provides a method, device, equipment, medium and product for serial port data transmission of embedded software, which can solve the defect that the rate of serial port data transmission is low, it takes a long time to transmit all relevant data to the host computer, and the efficiency of problem analysis will be reduced.
[0005] The present invention provides a method for serial port data transmission of embedded software, including: Obtaining a closed-loop control result obtained by an embedded software executing a preset closed-loop control algorithm in a preset application scenario; If the closed-loop control result does not meet the preset conditions, obtaining target data involved when the embedded software executes the preset closed-loop control algorithm; Screening the target data based on a screening strategy corresponding to the preset application scenario, and transmitting the screened target data to the host computer.
[0006] As an embodiment, the screening strategy includes a sampling screening strategy and a cache screening strategy. Correspondingly, screening the target data based on a screening strategy corresponding to the preset application scenario includes: If the data involved in the preset application scenario is analog data, screening the target data based on the sampling screening strategy; If the data involved in the preset application scenario is digital data, screening the target data based on the cache screening strategy.
[0007] As an embodiment, screening the target data based on the sampling screening strategy includes: Dividing sampling points according to the periodic characteristics and shape characteristics of the target data; Select the target data at different sampling points within each period to complete the screening.
[0008] As an embodiment, the selection of the target data at different sampling points within each period includes: Select the target data of adjacent sampling points within adjacent periods, or select the target data of adjacent sampling points within a single period.
[0009] As an embodiment, the screening of the target data based on the cache screening strategy includes: Select the target data within a preset time period before the closed-loop control result to complete the screening.
[0010] As an embodiment, it further includes: If the closed-loop control result meets the preset conditions, release the target data within a preset time period before the closed-loop control result.
[0011] The present invention also provides an embedded software serial port data transmission device, including: A first acquisition module, configured to acquire the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; A second acquisition module, configured to, if the closed-loop control result does not meet the preset conditions, acquire the target data involved when the embedded software executes the preset closed-loop control algorithm; A data transmission module, configured to screen the target data based on a screening strategy corresponding to the preset application scenario, and transmit the screened target data to the host computer.
[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, it implements the embedded software serial port data transmission method as described in any one of the above.
[0013] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the embedded software serial port data transmission method as described in any one of the above.
[0014] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the embedded software serial port data transmission method as described in any one of the above.
[0015] The embedded software serial port data transmission method, device, equipment, medium and product provided by the present invention obtain the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; if the closed-loop control result does not meet the preset conditions, obtain the target data involved when the embedded software executes the preset closed-loop control algorithm; screen the target data based on the screening strategy corresponding to the preset application scenario, and transmit the screened target data to the host computer. The present invention selects the corresponding screening strategy according to the preset application scenario to screen and transmit data to the host computer, without transmitting all data, reducing the data transmission time and improving the problem analysis efficiency. In addition, the screened data has the characteristics of the preset application scenario, and the analysis accuracy will not be reduced while improving the efficiency. Description of the Drawings
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the implementation examples or the description of the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a schematic structural diagram of an embedded system and a host computer.
[0018] Figure 2 It is one of the flow schematic diagrams of the embedded software serial port data transmission method provided by the present invention.
[0019] Figure 3 It is the second flow schematic diagram of the embedded software serial port data transmission method provided by the present invention.
[0020] Figure 4 It is a sampling point schematic diagram of the sampling screening strategy provided by the present invention.
[0021] Figure 5 It is a flow schematic diagram of the cache screening strategy provided by the present invention.
[0022] Figure 6 It is a data analysis schematic diagram of the embedded software provided by the present invention.
[0023] Figure 7 It is a schematic structural diagram of the embedded software serial port data transmission device provided by the present invention.
[0024] Figure 8 It is a schematic structural diagram of the electronic device provided by the present invention. Detailed Embodiment
[0025] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without any creative efforts shall fall within the protection scope of the present invention.
[0026] It should be noted that all actions of obtaining signals, information or data in the present invention are carried out on the premise of complying with the corresponding data protection regulations and policies of the country where it is located and with the authorization given by the owner of the corresponding device.
[0027] An embedded system is a special-purpose computer system designed to perform specific functions. It is usually embedded in a larger device or system and typically has limited memory, processing power, and power consumption. A typical embedded system includes one or more processors (such as microprocessors, microcontrollers, digital signal processors, etc.), memory (such as RAM, ROM, Flash, etc.), input / output interfaces, and software.
[0028] Figure 1 It is a schematic structural diagram of an embedded system and a host computer. The embedded system (such as a power supply, a motor, a charger, etc.) includes an MCU that communicates with the host computer through a serial port. The MCU is deployed with embedded software, and the embedded software performs closed-loop control according to the performance of the embedded system.
[0029] Figure 2 It is one of the flow schematic diagrams of the embedded software serial port data transmission method provided by the present invention. As Figure 2 shown, the present invention provides an embedded software serial port data transmission method, and the method includes steps S100 - S300.
[0030] Step S100, obtain the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario.
[0031] Existing closed-loop control algorithms include PID control (Proportional-Integral-Derivative control) algorithms, state-space control algorithms, fuzzy control algorithms, model predictive control algorithms, adaptive control algorithms, etc. The PID control algorithm performs closed-loop control based on three parameters: proportional, integral, and derivative. The proportional (P) is proportional to the error and is used to quickly respond to changes in the error; the integral (I) integrates the error to eliminate the steady-state error; the derivative (D) differentiates the rate of change of the error to predict future errors, thereby improving the stability and response speed of the system. The state-space control algorithm uses a state-space model to describe the system and uses state feedback to control the system, usually used to control complex, multi-input multi-output systems. The fuzzy control algorithm uses fuzzy logic to describe the behavior of the system and uses fuzzy inference to determine the control strategy, usually used to control systems with high nonlinearity and uncertainty. The model predictive control algorithm uses the model of the system to predict future outputs and optimizes the control strategy based on the prediction results, usually used to control systems with constraints. The adaptive control algorithm can automatically adjust the control parameters according to changes in the system, thereby maintaining the performance of the system, usually used to control time-varying systems or systems with uncertain parameters.
[0032] The preset application scenario, the preset closed-loop control algorithm, and the closed-loop control result are all related to the functions of the embedded system.
[0033] Step S200, if the closed-loop control result does not meet the preset conditions, obtain the target data involved when the embedded software executes the preset closed-loop control algorithm.
[0034] Different closed-loop control algorithms have different judgment criteria. If the closed-loop control result meets the preset conditions, the embedded software continues to execute the closed-loop control algorithm. If the closed-loop control result does not meet the preset conditions, the embedded software will obtain the relevant data involved when executing the preset closed-loop control algorithm and use the relevant data as the target data, such as current and voltage signals of the power supply, motor, charger, etc. during the operation of the embedded system.
[0035] Step S300, screen the target data based on the screening strategy corresponding to the preset application scenario, and transmit the screened target data to the host computer.
[0036] Figure 3 is the second flow chart of the serial port data transmission method for embedded software provided by the present invention. It can be seen from Figure 3 that the execution of the closed-loop control algorithm by the embedded software can be controlled by an interrupt. When the closed-loop control result does not meet the preset conditions, the target data is screened using the screening strategy corresponding to the preset application scenario, and the screened target data is transmitted to the host computer. Subsequently, the execution of the closed-loop control algorithm by the embedded software is continued through the interrupt.
[0037] It is understandable that the present invention selects a corresponding screening strategy according to a preset application scenario to screen data and transmit it to the host computer, without transmitting all the data, reducing the data transmission time and improving the problem analysis efficiency. In addition, the screened data has the characteristics of the preset application scenario, which will not reduce the analysis accuracy while improving the efficiency.
[0038] Based on the above embodiments, as an optional embodiment, the screening strategy includes a sampling screening strategy and a caching screening strategy. Correspondingly, screening the target data based on the screening strategy corresponding to the preset application scenario includes steps S310 - S320.
[0039] Step S310, if the data involved in the preset application scenario is analog data, screen the target data based on the sampling screening strategy. The sampling screening strategy refers to sampling the target data to obtain the amplitude data of the target data at different cycles and different sampling points, so that the host computer can restore the shape of the analog data according to the received amplitude data, which is helpful for problem analysis.
[0040] Many embedded systems process analog signals. The following are some common examples of embedded systems that process analog signals: Sensor interface system: Most sensors (such as temperature sensors, pressure sensors, optical sensors, accelerometers, etc.) directly generate analog signals. The embedded system needs to collect, amplify, and filter these analog signals, and then convert them into digital signals through an analog-to-digital converter (ADC) for processing. For example, an embedded system for monitoring environmental temperature and humidity needs to process the analog voltage signals from the temperature and humidity sensors.
[0041] Audio processing system: Audio signals are essentially analog signals. Embedded audio systems, such as MP3 players, digital recorders, hearing aids, etc., all need to process the analog audio signals from the microphone and may output them to the speaker through a digital-to-analog converter (DAC). It involves processing such as amplification, filtering, equalization, encoding, and decoding of audio signals.
[0042] Motor control system: Motor control usually requires feedback information, such as the position, speed, and current of the motor. These feedback signals are usually analog and need to be processed by the embedded system. For example, a robot control system needs to read the analog signals from the motor encoder or Hall sensor to achieve precise position and speed control.
[0043] Industrial automation systems: There are a large number of analog signals in industrial environments, such as signals from pressure transmitters, flow meters, level gauges, etc. Embedded systems used to monitor and control industrial processes need to process these analog signals and output control signals (which may also be analog signals, implemented through digital-to-analog converters) according to the set control strategies.
[0044] Medical devices: Many medical devices, such as electrocardiogram (ECG) monitors, electroencephalogram (EEG) monitors, etc., need to collect and process bioelectric signals from the human body, which are essentially analog.
[0045] Automotive electronic systems: Many sensors in vehicles, such as air flow sensors, oxygen sensors, throttle position sensors, etc., output analog signals. The automotive electronic control unit (ECU) needs to process these signals to achieve functions such as engine control, vehicle stability control, airbag control, etc.
[0046] Step S320, if the data involved in the preset application scenario is digital data, filter the target data based on the cache filtering strategy.
[0047] The data processed by the embedded system for controlling industrial equipment is digital data. After the embedded software receives an interrupt, it starts to execute the closed-loop control algorithm and at the same time caches the relevant data in the memory. If the closed-loop control result obtained after the execution of the closed-loop control algorithm indicates that there is no problem with the embedded system, it continues to execute the closed-loop control algorithm in response to the interrupt. The cache filtering strategy means that when the closed-loop control result does not meet the preset conditions, that is, the closed-loop control result indicates that the embedded system has an abnormality, the data cached during the previous executions of the closed-loop control algorithm is transmitted to the host computer.
[0048] It should be noted that the execution order of step S310 and step S320 can be adjusted, and the present invention does not limit this.
[0049] It can be understood that the present invention selects the sampling filtering strategy or the cache filtering strategy to filter data according to the data type, which can preserve the characteristics of the data. Because analog data is not processed by analog-to-digital conversion and does not lose data details, the sampling filtering strategy can reduce the data volume while preserving the data characteristics. Digital data has been through analog-to-digital conversion or has high precision requirements, and all relevant data in the previous time period needs to be transmitted to the host computer to ensure the accuracy of problem analysis. In addition, existing embedded software either transmits all data or waits for instructions from the host computer and selects corresponding data according to the instructions when transmitting relevant data to the host computer. The cache filtering strategy proposed by the present invention does not need to wait for instructions from the host computer, reduces the interaction time before data transmission, and thus improves the efficiency of problem analysis.
[0050] Based on the above embodiments, as an alternative embodiment, screening the target data based on the sampling and screening strategy includes steps S311 - S312.
[0051] Step S311: Divide the sampling points according to the periodic characteristics and shape characteristics of the target data.
[0052] Step S312: Select the target data of different sampling points within each period to complete the screening.
[0053] As an alternative embodiment, selecting the target data of different sampling points within each period includes: Selecting the target data of adjacent sampling points within adjacent periods, or selecting the target data of adjacent sampling points within a single period.
[0054] Figure 4 is a schematic diagram of sampling points of the sampling and screening strategy provided by the present invention. As Figure 4 shown, in the embodiments of the present invention, the target data in the shape of a sine wave is taken as an example for illustration. For the target data in the shape of a sine wave, the target data can be divided into multiple sampling points according to the sine wave period, such as 1a, 1b, 1c, 1d, 1e... 1l, 2a, 2b, 2c, 2d, 2e... 2l, 3a, 3b, 3c, 3d, 3e... 3l, etc. Among them, the numbers represent the period numbers, and the letters represent the sampling point numbers within the period. Adjacent sampling points can be selected from adjacent sine wave periods before and after, such as 1a, 2b, 3c, 4d, etc. If the amount of screened data is still large and the speed of serial port data transmission cannot meet the preset transmission time requirement, a sampling point can be selected after several sine wave periods to further reduce the amount of data, such as 1a, 3b, 4c, 7d, or 2a, 2b, 2c, 6d, 7e, 7f, 10g.
[0055] It can be understood that the present invention obtains the sampling point data through the sampling and screening strategy, reduces the amount of data, and selects the target data of different sampling points within each period, which is convenient for the host computer to restore the sine wave shape for problem analysis, especially suitable for scenarios where the processing methods of relevant data within each sine wave period by embedded software are similar.
[0056] Figure 5 is a schematic flowchart of the cache screening strategy provided by the present invention. As Figure 5 shown, based on the above embodiments, as an alternative embodiment, screening the target data based on the cache screening strategy includes: Selecting the target data within a preset time period before the closed-loop control result to complete the screening.
[0057] The embedded software executes the closed-loop control algorithm corresponding to the interrupt instruction in response to the interrupt instruction, obtains the closed-loop control result, and caches the relevant data of the closed-loop control algorithm in the buffer of the embedded system's memory. If the embedded software finds that the closed-loop control result is abnormal, it transmits the relevant data within a certain period of time before the closed-loop control result in the buffer to the host computer through the serial port. If the embedded software finds that the closed-loop control result is normal, it returns to execute the step of executing the closed-loop control algorithm corresponding to the interrupt instruction in response to the interrupt instruction. Among them, the preset time period is determined comprehensively according to the buffer capacity of the buffer, the data volume of the relevant data of the closed-loop control algorithm, and the execution frequency of the closed-loop control algorithm.
[0058] As an optional embodiment, the method for transmitting serial port data of the embedded software provided by the present invention further includes: If the closed-loop control result meets the preset conditions, release the target data within the preset time period before the closed-loop control result.
[0059] It can be understood that since the memory of the MCU in the embedded system is limited and cannot cache too much data, according to the actual situation, only the data of the recent several interrupts can be cached, and the expired data can be released to reduce the memory occupancy. During the normal operation of the embedded software, the data is only cached in the memory and not output through the serial port, which has little impact on the service processing; while when the embedded software finds an abnormality, the data cached in the recent several times can be sent to the host computer through the serial port, which is beneficial to analyzing the cause of the abnormality.
[0060] Next, the technical effects of the present invention will be described in conjunction with an embodiment.
[0061] Figure 6 It is a schematic diagram of data analysis of the embedded software provided by the present invention. As Figure 6 shown, the data in the table is the actual data output by the embedded software to the host computer through the serial port. Specifically, label 1 in the waveform diagram is the grid voltage, and its shape is a sine wave. Label 2 is the duty cycle calculated based on the sampling points in different cycles during the loop control process, which can easily find the position of the data that can mutate. Find the corresponding position in the actual data, and then further analyze the overall data at this position to analyze the problems of the loop control algorithm. If the host computer directly analyzes the data in the table one by one, it will take a long time.
[0062] Next, the serial port data transmission device of the embedded software provided by the present invention will be described. The serial port data transmission device of the embedded software described below can be mutually corresponding and referred to the serial port data transmission method of the embedded software described above.
[0063] Figure 7It is a schematic structural diagram of the embedded software serial port data transmission device provided by the present invention. As Figure 7 shown, the present invention also provides an embedded software serial port data transmission device, including the following modules.
[0064] The first acquisition module 710 is used to acquire the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; The second acquisition module 720 is used to acquire the target data involved in the embedded software when executing the preset closed-loop control algorithm if the closed-loop control result does not meet the preset conditions; The data transmission module 730 is used to screen the target data based on a screening strategy corresponding to the preset application scenario, and transmit the screened target data to the host computer.
[0065] As an embodiment, the screening strategy includes a sampling screening strategy and a cache screening strategy. Correspondingly, the screening of the target data based on the screening strategy corresponding to the preset application scenario includes: If the data involved in the preset application scenario is analog data, screen the target data based on the sampling screening strategy; If the data involved in the preset application scenario is digital data, screen the target data based on the cache screening strategy.
[0066] As an embodiment, the screening of the target data based on the sampling screening strategy includes: Dividing sampling points according to the periodic characteristics and shape characteristics of the target data; Selecting the target data at different sampling points within each period to complete the screening.
[0067] As an embodiment, the selection of the target data at different sampling points within each period includes: Selecting the target data at adjacent sampling points within adjacent periods, or selecting the target data at adjacent sampling points within a single period.
[0068] As an embodiment, the screening of the target data based on the cache screening strategy includes: Selecting the target data within a preset time period before the closed-loop control result to complete the screening.
[0069] As an embodiment, it further includes: If the closed-loop control result meets the preset conditions, releasing the target data within a preset time period before the closed-loop control result.
[0070] It should be noted that the embedded software serial port data transmission device provided by the present invention can execute the embedded software serial port data transmission method described in any of the above embodiments during specific operation, and has the corresponding technical effects of the method, which will not be elaborated in this embodiment.
[0071] Figure 8 An example of a schematic physical structure diagram of an electronic device is shown as Figure 8 shown. The electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840. Among them, the processor 810, the communication interface 820, and the memory 830 complete mutual communication through the communication bus 840. The processor 810 can call the logical instructions in the memory 830 to execute the embedded software serial port data transmission method, which includes: obtaining the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; if the closed-loop control result does not meet the preset conditions, obtaining the target data involved when the embedded software executes the preset closed-loop control algorithm; screening the target data based on a screening strategy corresponding to the preset application scenario, and transmitting the screened target data to the host computer.
[0072] In addition, when the logical instructions in the above-mentioned memory 830 can be implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0073] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the embedded software serial port data transmission method provided by the above-mentioned various methods. The method includes: obtaining a closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; if the closed-loop control result does not meet the preset conditions, obtaining target data involved when the embedded software executes the preset closed-loop control algorithm; screening the target data based on a screening strategy corresponding to the preset application scenario, and transmitting the screened target data to a host computer.
[0074] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the embedded software serial port data transmission method provided by the above-mentioned various methods. The method includes: obtaining a closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; if the closed-loop control result does not meet the preset conditions, obtaining target data involved when the embedded software executes the preset closed-loop control algorithm; screening the target data based on a screening strategy corresponding to the preset application scenario, and transmitting the screened target data to a host computer.
[0075] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An embedded software serial port data transmission method, characterized in that Including: Obtain the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; If the closed-loop control result does not meet the preset conditions, obtain the target data involved when the embedded software executes the preset closed-loop control algorithm; Based on a screening strategy corresponding to the preset application scenario, screen the target data, and transmit the screened target data to the host computer.
2. The embedded software serial port data transmission method according to claim 1, wherein The screening strategy includes a sampling screening strategy and a cache screening strategy. Correspondingly, the screening of the target data based on a screening strategy corresponding to the preset application scenario includes: If the data involved in the preset application scenario is analog data, screen the target data based on the sampling screening strategy; If the data involved in the preset application scenario is digital data, screen the target data based on the cache screening strategy.
3. The embedded software serial port data transmission method according to claim 2, wherein The screening of the target data based on the sampling screening strategy includes: Divide sampling points according to the periodic characteristics and shape characteristics of the target data; Select the target data at different sampling points within each period to complete the screening.
4. The embedded software serial port data transmission method according to claim 3, characterized in that The selection of the target data at different sampling points within each period includes: Select the target data at adjacent sampling points in adjacent periods, or select the target data at adjacent sampling points within a single period.
5. The embedded software serial port data transmission method according to claim 2, wherein The screening of the target data based on the cache screening strategy includes: Select the target data within a preset time period before the closed-loop control result to complete the screening.
6. The embedded software serial port data transmission method according to claim 5, characterized in that, Also including: If the closed-loop control result meets the preset conditions, release the target data within a preset time period before the closed-loop control result.
7. An embedded software serial port data transmission device, characterized in that, Including: A first acquisition module for obtaining the closed-loop control result obtained by the embedded software executing a preset closed-loop control algorithm in a preset application scenario; A second acquisition module for obtaining the target data involved when the embedded software executes the preset closed-loop control algorithm if the closed-loop control result does not meet the preset conditions; A data transmission module for screening the target data based on a screening strategy corresponding to the preset application scenario and transmitting the screened target data to the host computer.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the embedded software serial port data transmission method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the embedded software serial port data transmission method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the embedded software serial port data transmission method according to any one of claims 1 to 6.