Serial port communication analysis method and device

CN122053734APending Publication Date: 2026-05-15NEW YIDONG (SHANGHAI) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NEW YIDONG (SHANGHAI) TECH CO LTD
Filing Date
2026-01-14
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, the parsing efficiency of unknown serial communication systems is low and the accuracy is difficult to guarantee, resulting in low efficiency in equipment debugging, system integration and fault diagnosis.

Method used

An automated parsing process is adopted, which includes parameter combination, test case generation, and feedback data reception and verification. By generating combinations of various known communication protocols, data types, and basic parameters, the validity of feedback data is automatically tested and verified to determine the communication parameters of the serial communication system under test.

Benefits of technology

It greatly improves parsing efficiency and accuracy, shortens the troubleshooting time of unknown serial communication system faults, and increases the success rate of control intervention, making it suitable for complex industrial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122053734A_ABST
    Figure CN122053734A_ABST
Patent Text Reader

Abstract

The invention provides a serial port communication analysis method and device, and relates to the technical field of serial port communication, and the method comprises the steps: combining various known communication protocols, various known data types and each group of known serial port basic parameters into a plurality of parameter combinations, each parameter combination comprises a known communication protocol, a known data type and a group of known serial port basic parameters; generating a test case corresponding to each parameter combination; sending a test instruction corresponding to the test case to the to-be-tested serial port communication system, and receiving feedback data sent by the to-be-tested serial port communication system after responding to the test instruction; verifying the validity of the feedback data; and if the feedback data is verified to be valid, determining that the communication parameter of the to-be-tested serial port communication system is a parameter combination corresponding to the feedback data. According to the method, the communication parameters of the unknown serial port communication system are analyzed by adopting an automatic analysis process of parameter combination, test case generation and sending and feedback data receiving and verification, so that the analysis efficiency and accuracy are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of serial communication technology, and in particular to a serial communication parsing method and apparatus. Background Technology

[0002] Serial communication is widely used in industrial control, intelligent devices, instrumentation, and many other fields due to its simple structure, low cost, and high reliability. In practical applications, there are often needs to interface with unknown serial communication systems, such as for the maintenance of old equipment, interconnection of devices from multiple vendors, and troubleshooting of systems with unknown faults. These scenarios require testing to obtain the communication parameters of the unknown serial communication system.

[0003] In existing technologies, solving the problem of parsing unknown serial communication parameters typically involves manual trial and error or relying on general-purpose serial port debugging tools. Specifically, technicians, based on experience, manually set a set of possible communication parameters, then send test commands to the system under test or listen to its data via a serial port tool, observing whether the returned data is garbled. If the returned data is garbled, another set of parameters is used, and the process is repeated until parameters that can correctly display the data are found. This process is essentially a manual enumeration and trial-and-error process, entirely dependent on the technician's experience and patience.

[0004] However, the manual trial-and-error method used in the aforementioned existing technologies suffers from low parsing efficiency and difficulty in guaranteeing accuracy. Due to the vast number of communication parameters, manual enumeration and testing are extremely time-consuming, especially when dealing with uncommon parameter combinations, which easily leads to omissions and parsing failures. Furthermore, this method heavily relies on the operator's experience to judge the correctness of the returned data, which is prone to misjudgments, resulting in low parsing accuracy and severely impacting the efficiency of subsequent equipment debugging, system integration, and troubleshooting. Summary of the Invention

[0005] This invention provides a serial communication parsing method and apparatus to solve the technical problem of low parsing efficiency and accuracy of unknown serial communication system communication parameters in the prior art.

[0006] This invention provides a serial communication parsing method, comprising: Various known communication protocols, various known data types, and various sets of known serial port basic parameters are combined into multiple parameter combinations. Each parameter combination includes one of the known communication protocols, one of the known data types, and one set of the known serial port basic parameters. Generate test cases corresponding to each of the parameter combinations; Send the test instructions corresponding to the test cases to the serial communication system under test, and receive the feedback data sent by the serial communication system under test after responding to the test instructions; The validity of the feedback data is verified. If the feedback data is verified to be valid, then the communication parameters of the serial communication system under test are determined to be the parameter combination corresponding to the feedback data.

[0007] According to a serial communication parsing method provided by the present invention, the validity verification of the feedback data includes: Verify whether the frame header and footer of the feedback data are complete, whether the checksum is correct, and whether the feedback data conforms to a preset logical range; If the feedback data has a complete frame header and footer, a correct checksum, and conforms to a preset logical range, then the feedback data verification is valid.

[0008] According to a serial communication parsing method provided by the present invention, after determining that the communication parameters of the serial communication system under test are the parameter combination corresponding to the feedback data if the feedback data is verified to be valid, the method further includes: Based on the communication parameters, receive the communication data sent by the serial communication system under test; The communication data is sent to an external control device.

[0009] According to a serial communication parsing method provided by the present invention, after determining that the communication parameters of the serial communication system under test are the parameter combination corresponding to the feedback data if the feedback data is verified to be valid, the method further includes: Receive control commands sent by external control devices; The control command is sent to the serial communication system under test based on the communication parameters.

[0010] The present invention also provides a serial communication parsing device, comprising: The storage module is used to store various known communication protocols, various known data types, and various sets of known serial port basic parameters; The testing module is used to generate test cases corresponding to each parameter combination and send the test instructions corresponding to the test cases to the serial communication system under test; each parameter combination includes a known communication protocol, a known data type and a set of known serial port basic parameters; The processing module is used to receive feedback data sent by the serial communication system under test after responding to the test command, and to perform noise filtering, signal shaping and format decoding on the feedback data; The control module is used to verify the validity of the feedback data sent by the processing module, and if the feedback data is verified to be valid, to store the parameter combination corresponding to the feedback data into the storage module.

[0011] According to a serial communication parsing device provided by the present invention, the processing module includes: A receiving unit is used to receive the feedback data sent by the serial communication system under test; The parsing unit is used to perform noise filtering, signal shaping and format decoding on the feedback data, and send the processed feedback data to the control module.

[0012] According to a serial communication parsing device provided by the present invention, the receiving unit is further configured to receive communication data sent by the serial communication system under test; The parsing unit is also used to parse the communication data to obtain communication information; The processing module further includes a synchronization forwarding unit, used to forward the communication information to the control module or an external control device.

[0013] According to a serial communication parsing device provided by the present invention, the processing module further includes a synchronization forwarding unit, which is used to forward control commands sent by an external control device to the control module, and forward control commands sent by the control module to the serial communication system under test.

[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the serial communication parsing method described above.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the serial communication parsing method as described above.

[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the serial communication parsing methods described above.

[0017] The serial communication parsing method and apparatus provided by this invention adopts an automated parsing process of parameter combination, test case generation and sending, and feedback data reception and verification to parse the communication parameters of an unknown serial communication system. Compared with the parsing process that relies on manual methods, this greatly improves the parsing efficiency and accuracy. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the serial communication parsing method provided by the present invention.

[0020] Figure 2 This is a schematic diagram of the serial communication parsing device provided by the present invention.

[0021] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] The following is combined Figures 1 to 3 This invention describes the serial communication parsing method and apparatus.

[0024] Figure 1 This is a flowchart illustrating the serial communication parsing method provided by the present invention, as shown below. Figure 1 As shown, the method includes, but is not limited to, steps S1, S2, S3, S4 and S5.

[0025] Step S1: Combine various known communication protocols, various known data types, and various sets of known serial port basic parameters into multiple parameter combinations. Each parameter combination includes a known communication protocol, a known data type, and a set of known serial port basic parameters.

[0026] This invention pre-configures a serial communication protocol library, a data type library, and a set of basic serial port parameters. The serial communication protocol library stores various known serial communication protocols, the data type library stores various known data types, and the set of basic serial port parameters includes multiple sets of known basic serial port parameters. Known serial communication protocols include, but are not limited to, RS-232, RS-485, Modbus RTU, and ASCII. Known data types include, but are not limited to, binary, ASCII, BCD, and floating-point types. The basic serial port parameters are configuration items for the serial port physical layer and data link layer, including baud rate (e.g., common specifications such as 300bps, 600bps, 1200bps, 2400bps, 4800bps, 9600bps, 19200bps), data bits (e.g., 5 bits, 6 bits, 7 bits, 8 bits), stop bits (e.g., 1 bit, 1.5 bits, 2 bits), and parity bits (e.g., no parity, odd parity, even parity, space parity, and marker parity).

[0027] This invention can establish all parameter combinations for various known communication protocols, various known data types, and various sets of known serial port basic parameters. For example, if there are 10 known serial port communication protocols, 8 known data types, 7 baud rates, 4 data bits, 3 stop bits, and 5 parity bits, then the number of parameter combinations = 10 × 8 × 7 × 4 × 3 × 5 = 33600.

[0028] Step S2: Generate test cases corresponding to each parameter combination.

[0029] Generate test cases corresponding to the parameter combination, that is, construct a test instruction that conforms to the communication protocol specification under that parameter combination.

[0030] Technicians can set the test scope, selecting all or part of known communication protocols and all or part of known data types, so that the present invention can generate test cases corresponding to each combination of parameters within the test scope.

[0031] Step S3: Send the test instructions corresponding to the test cases to the serial communication system under test, and receive the feedback data sent by the serial communication system under test after responding to the test instructions.

[0032] Technicians can set the priority of parameter combinations, such as prioritizing the testing of commonly used parameter combinations. Commonly used parameter combinations include baud rate of 9600bps, 8 data bits, 1 stop bit, and no parity. Thus, test commands can be sent one by one according to the priority of the parameter combinations.

[0033] The serial communication system under test (DUT) has unknown communication parameters and will return feedback data after receiving the test command. The DUT can be an industrial controller.

[0034] Step S4: Verify the validity of the feedback data.

[0035] Validating the feedback data involves determining whether it is a valid data packet with a complete structure and reasonable content.

[0036] Step S5: If the verification feedback data is valid, then the communication parameters of the serial communication system under test are determined to be the parameter combination corresponding to the feedback data.

[0037] If the feedback data is valid, it means that the current test parameter combination is the communication parameter of the serial communication system under test. Conversely, if the feedback data is invalid, the test command corresponding to the next test case is sent to the serial communication system under test for testing, and so on, until the feedback data obtained after sending a test command is valid or all test cases are completed.

[0038] As can be seen from the above, the present invention uses an automated parsing process of parameter combination, test case generation and sending, feedback data reception and verification to parse the communication parameters of an unknown serial communication system. Compared with the parsing process that relies on manual methods, this greatly improves the parsing efficiency and accuracy.

[0039] In one embodiment, step S4 may further include: Verify whether the frame header and footer of the feedback data are complete, whether the checksum is correct, and whether the feedback data conforms to the preset logical range; If the frame header and footer of the feedback data are complete, the checksum is correct, and the feedback data conforms to the preset logical range, then the feedback data verification is valid.

[0040] Of course, if the frame header or footer of the feedback data is incomplete, the checksum is incorrect, or the feedback data does not conform to the preset logical range, then the feedback data verification is invalid.

[0041] Verifying the integrity of the frame header and trailer of the feedback data means checking whether the feedback data begins with the specified byte sequence (frame header) and ends with the specified byte sequence (frame trailer) according to the specifications of the communication protocol used in the current test case.

[0042] Verifying the correctness of the checksum involves calculating the data portion of the feedback data excluding the checksum based on the verification algorithm of the current communication protocol (such as CRC cyclic redundancy check, checksum, etc.), deriving a calculated checksum, and then comparing the calculated checksum with the original checksum attached to the feedback data. If the two are completely identical, the verification passes.

[0043] Verifying whether the feedback data conforms to the preset logical range refers to making a reasonable judgment on the content of the feedback data itself.

[0044] For example, if the test case corresponding to the parameter combination "Modbus RTU protocol - binary data type - 9600bps baud rate - 8 data bits - 1 stop bit - no parity" is tested, and the feedback data frame header of the serial communication system under test is 0x01, the frame tail is 0xCRC, the checksum is correct, and the feedback data conforms to the Modbus RTU protocol specification, then the feedback data verification is successful.

[0045] This invention provides a multi-dimensional, systematic, and quantifiable feedback data verification standard, transforming the verification process from subjective judgment to objective calculation and comparison. By comprehensively examining the three core elements of the communication protocol (physical layer data frame structure, data link layer error control, and application layer data logic), it can greatly eliminate interference from noise, bit errors, and pseudo-signals caused by parameter mismatch, ensuring that verification can only be passed when communication parameters are perfectly matched.

[0046] In one embodiment, after step S5, the method of the present invention may further include: Receive communication data sent by the serial communication system under test based on communication parameters; Send communication data to external control devices.

[0047] After obtaining the communication parameters of the serial communication system under test, the communication data of the system under test can be sent to an external control device based on these parameters. The communication data can be the operating status data of the industrial controller (such as temperature, pressure, and speed), and the external control device can be a host computer.

[0048] After successfully parsing the communication parameters of the serial communication system under test, the communication data of the serial communication system under test can be collected based on the communication parameters and sent to the external control device to realize the monitoring of the operating status of the serial communication system under test.

[0049] In one embodiment, after step S5, the method of the present invention may further include: Receive control commands sent by external control devices; Control commands are sent to the serial communication system under test based on communication parameters.

[0050] After obtaining the communication parameters of the serial communication system under test, control commands sent by external control devices can be sent to the serial communication system under test based on the communication parameters of the serial communication system under test.

[0051] After successfully parsing the communication parameters of the serial communication system under test, control commands sent by external control devices can be sent to the serial communication system under test based on the communication parameters, thereby enabling control intervention of the serial communication system under test.

[0052] like Figure 2 As shown, the present invention also provides a serial communication parsing device, including but not limited to: The storage module is used to store various known communication protocols, various known data types, and various sets of known serial port basic parameters; The testing module is used to generate test cases corresponding to each parameter combination and send the test instructions corresponding to the test cases to the serial communication system under test; each parameter combination includes a known communication protocol, a known data type and a set of known serial port basic parameters; The processing module is used to receive feedback data sent by the serial communication system under test after responding to the test command, and to perform noise filtering, signal shaping and format decoding on the feedback data. The control module is used to verify the validity of the feedback data sent by the processing module, and if the feedback data is verified to be valid, it stores the parameter combination corresponding to the feedback data into the storage module.

[0053] The storage module is used for persistent data storage. It can be a built-in flash memory chip or an external SD card, such as an external 32GB SD card. The storage module can store various known communication protocols, various known data types, basic parameters of various known serial ports, various test cases, various feedback data and communication parameters. It supports data read, write and erase operations, providing support for subsequent data traceability and fault diagnosis.

[0054] The core of the test module can be a microcontroller (such as an STM32F407) with built-in storage units that pre-store parsing rules for various common serial communication protocols and decoding algorithms for various commonly used data types, thereby generating test cases. The test module can read communication protocols, data types, and basic serial port parameters from the storage module according to instructions from the control module, generate test cases corresponding to the parameter combinations through algorithms, and send the test instructions corresponding to the test cases to the serial communication system under test via a serial transceiver chip (such as a MAX3232).

[0055] The processing module is responsible for receiving and preprocessing signals, converting potentially noisy feedback data into clean, well-organized digital data frames.

[0056] The control module can be an ARM Cortex-A9 processor with a built-in Linux operating system and a custom data verification algorithm, which can verify the validity of the parsed feedback data.

[0057] This invention can realize the parsing of communication parameters of an unknown serial communication system through the cooperation of hardware circuits such as storage module, test module, processing module and control module.

[0058] In one embodiment, the processing module of the present invention may further include: The receiving unit is used to receive feedback data sent by the serial communication system under test. The parsing unit is used to perform noise filtering, signal shaping, and format decoding on the feedback data, and then send the processed feedback data to the control module.

[0059] The receiving unit can be a high-performance serial port receiver chip (such as the MAX485 chip), supporting signal reception of both RS-485 and RS-232 serial port standards. It has built-in electrostatic discharge protection circuitry, enabling it to adapt to complex electromagnetic environments in industrial settings. The receiving unit is responsible for receiving the raw serial electrical signals sent by the serial communication system under test and converting them into logic level signals that can be processed by its internal circuitry.

[0060] The parsing unit can consist of a signal conditioning circuit based on an operational amplifier LM324 and a programmable logic device (such as an FPGA chip XC7K325T). The signal conditioning circuit can filter, amplify, and shape the received feedback data; the FPGA chip has built-in custom decoding logic, which can parse different communication protocols and data types. The parsing unit can send the feedback data to the control module via the SPI interface. The signal flow of the feedback data is: serial communication system under test - receiving unit - parsing unit - control module.

[0061] By combining the receiving unit and the parsing unit, the feedback data sent by the serial communication system under test can be received and preprocessed.

[0062] In one embodiment, the receiving unit of the present invention can also be used to receive communication data sent by the serial communication system under test; The parsing unit can also be used to parse communication data to obtain communication information; The processing module may also include a synchronization forwarding unit for forwarding communication information to the control module or external control devices.

[0063] The synchronous forwarding unit can be a high-speed interface chip (such as the USB 3.0 interface chip CYUSB3014). The synchronous forwarding unit can be connected to an external control device via a serial port or to a control module via an SPI interface. The signal flow of the communication data is: serial communication system under test - receiving unit - parsing unit - synchronous forwarding unit - (control module - storage module) / external control device.

[0064] By coordinating the receiving unit, parsing unit, and synchronous forwarding unit, the communication data sent by the serial communication system under test is forwarded to the control module, enabling local display and recording of the operating status of the serial communication system under test. Forwarding the communication data to external control devices enables remote monitoring of the operating status of the serial communication system under test.

[0065] In one embodiment, the processing module of the present invention may further include a synchronization forwarding unit, which is used to forward control instructions sent by an external control device to the control module, and forward control instructions sent by the control module to the serial communication system under test.

[0066] The signal flow of control commands can be: external control device - synchronous forwarding unit - control module - synchronous forwarding unit - serial communication system under test.

[0067] By forwarding control commands sent by external control devices to the serial communication system under test through the synchronous forwarding unit, control intervention in the serial communication system under test can be realized.

[0068] This invention selected 100 groups of different types of unknown serial communication systems for experiments, including 50 industrial controllers (covering different manufacturers and models), 30 smart meters, and 20 old serial communication devices. The results compared the performance of traditional manual testing with the analytical methods of this invention. This invention can significantly improve the efficiency and accuracy of parsing unknown serial communication: Traditional manual testing takes an average of 240 minutes per group, with a parsing accuracy of 65% and a control intervention success rate of 40%; the method of this invention takes an average of only 20 minutes per group, with a parsing accuracy of 99% and a control intervention success rate of 100%, improving the accuracy by 34 percentage points, effectively solving the problems of low efficiency and error-proneness in manual parsing.

[0069] This invention solves the challenge of troubleshooting unknown system faults: By using a processing module to achieve real-time reception, parsing, and synchronous forwarding of communication data, combined with a complete data log recorded by a storage module, technicians can quickly locate the root cause of the fault based on communication parameters, reducing the difficulty of troubleshooting. Experimental results show that after adopting this invention, the average troubleshooting time for unknown serial communication system faults is reduced from 180 minutes to 30 minutes, improving fault location efficiency by 83.3%.

[0070] This invention enables convenient control intervention: based on clearly defined interface information and parsed instruction logic, external control devices can establish reliable communication with an unknown serial communication system through a processing module, thus successfully achieving control intervention. In the experiment, all 100 test subjects successfully completed the issuance and execution of external control commands, achieving a 100% success rate in control intervention. This solves the problem of difficult control intervention caused by unknown communication parameters in existing technologies, and is suitable for device interconnection and control needs in multiple scenarios.

[0071] The invention has a wide range of applications: the test module has built-in a variety of known communication protocols and data types, supports testing of different combinations of basic serial port parameters, and can be adapted to unknown serial communication systems in multiple fields such as industrial control, intelligent devices, and instrumentation, making it highly versatile.

[0072] This invention boasts high stability: The processing utilizes a dedicated serial port receiver chip and signal conditioning circuitry, effectively filtering noise interference and ensuring the stability of data reception and parsing. In experiments conducted under electromagnetic interference conditions in industrial settings, the data reception stability of this device reached 99.5%, significantly higher than the 85% of traditional parsing tools, making it suitable for complex industrial environments.

[0073] Figure 3 A schematic diagram of the physical structure of an electronic device is provided. This electronic device may include a processor, a communication interface, memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The processor can call logical instructions in the memory to execute a serial communication parsing method. This method includes: combining various known communication protocols, various known data types, and various sets of known serial port basic parameters into multiple parameter combinations. Each parameter combination includes a known communication protocol, a known data type, and a set of known serial port basic parameters; generating test cases corresponding to each parameter combination; sending test instructions corresponding to the test cases to the serial communication system under test, and receiving feedback data sent by the serial communication system under test after responding to the test instructions; validating the feedback data; if the feedback data is valid, determining that the communication parameters of the serial communication system under test are the parameter combinations corresponding to the feedback data.

[0074] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0075] 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 serial communication parsing method provided by the above methods. The method includes: combining various known communication protocols, various known data types, and various sets of known serial port basic parameters into multiple parameter combinations, each parameter combination including a known communication protocol, a known data type, and a set of known serial port basic parameters; generating test cases corresponding to each parameter combination; sending test instructions corresponding to the test cases to the serial communication system under test, and receiving feedback data sent by the serial communication system under test after responding to the test instructions; validating the feedback data; if the feedback data is verified to be valid, then determining that the communication parameters of the serial communication system under test are the parameter combinations corresponding to the feedback data.

[0076] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the serial communication parsing method provided by the above methods. The method includes: combining various known communication protocols, various known data types, and various sets of known serial port basic parameters into multiple parameter combinations, each parameter combination including a known communication protocol, a known data type, and a set of known serial port basic parameters; generating test cases corresponding to each parameter combination; sending test instructions corresponding to the test cases to the serial communication system under test, and receiving feedback data sent by the serial communication system under test after responding to the test instructions; validating the feedback data; if the feedback data is verified to be valid, then determining that the communication parameters of the serial communication system under test are the parameter combinations corresponding to the feedback data.

[0077] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions 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. A serial communication parsing method, characterized in that, include: Various known communication protocols, various known data types, and various sets of known serial port basic parameters are combined into multiple parameter combinations. Each parameter combination includes one of the known communication protocols, one of the known data types, and one set of the known serial port basic parameters. Generate test cases corresponding to each of the parameter combinations; Send the test instructions corresponding to the test cases to the serial communication system under test, and receive the feedback data sent by the serial communication system under test after responding to the test instructions; The validity of the feedback data is verified. If the feedback data is verified to be valid, then the communication parameters of the serial communication system under test are determined to be the parameter combination corresponding to the feedback data.

2. The serial communication parsing method according to claim 1, characterized in that, The validity verification of the feedback data includes: Verify whether the frame header and footer of the feedback data are complete, whether the checksum is correct, and whether the feedback data conforms to a preset logical range; If the feedback data has a complete frame header and footer, a correct checksum, and conforms to a preset logical range, then the feedback data verification is valid.

3. The serial communication parsing method according to claim 1, characterized in that, If the feedback data is verified to be valid, and the communication parameters of the serial communication system under test are determined to be the parameter combination corresponding to the feedback data, the method further includes: Based on the communication parameters, receive the communication data sent by the serial communication system under test; The communication data is sent to an external control device.

4. The serial communication parsing method according to claim 1, characterized in that, If the feedback data is verified to be valid, and the communication parameters of the serial communication system under test are determined to be the parameter combination corresponding to the feedback data, the method further includes: Receive control commands sent by external control devices; The control command is sent to the serial communication system under test based on the communication parameters.

5. A serial communication parsing device, characterized in that, include: The storage module is used to store various known communication protocols, various known data types, and various sets of known serial port basic parameters; The testing module is used to generate test cases corresponding to each parameter combination and send the test instructions corresponding to the test cases to the serial communication system under test; each parameter combination includes a known communication protocol, a known data type and a set of known serial port basic parameters; The processing module is used to receive feedback data sent by the serial communication system under test after responding to the test command, and to perform noise filtering, signal shaping and format decoding on the feedback data; The control module is used to verify the validity of the feedback data sent by the processing module, and if the feedback data is verified to be valid, to store the parameter combination corresponding to the feedback data into the storage module.

6. The serial communication parsing device according to claim 5, characterized in that, The processing module includes: A receiving unit is used to receive the feedback data sent by the serial communication system under test; The parsing unit is used to perform noise filtering, signal shaping and format decoding on the feedback data, and send the processed feedback data to the control module.

7. The serial communication parsing device according to claim 6, characterized in that, The receiving unit is also used to receive communication data sent by the serial communication system under test; The parsing unit is also used to parse the communication data to obtain communication information; The processing module further includes a synchronization forwarding unit, used to forward the communication information to the control module or an external control device.

8. The serial communication parsing device according to claim 6, characterized in that, The processing module further includes a synchronization forwarding unit, which is used to forward control commands sent by external control devices to the control module, and forward control commands sent by the control module to the serial communication system under test.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the serial communication parsing method as described in any one of claims 1 to 4.

10. 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 serial communication parsing method as described in any one of claims 1 to 4.