Test method and device based on multi-port communication and program debugging method

By defining the data receiving logic of the UART serial port and the BLE UART service serial port, and using the UART task module to parse and forward factory test commands, the problem of real-time monitoring and module function verification during the overall debugging of electronic equipment products was solved, realizing real-time monitoring and verification of program running status and module performance.

CN120973659APending Publication Date: 2025-11-18SHENZHEN FENDA SMART TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510881805.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In the existing technology, electronic equipment products cannot monitor the program running status in real time during whole-machine debugging, and cannot use test commands to verify the functions and performance of each module.

Method used

By defining the data receiving logic of the physical UART serial port and the BLE UART service serial port, the UART task module parses the factory test instructions and forwards them to the functional modules for execution, thus solving the problem of module function verification; the debugging information is monitored to the host computer in real time through the UART debugging information sending interface.

Benefits of technology

It enables real-time monitoring of the program's running status and module functions of electronic equipment, improving the comprehensiveness and efficiency of debugging information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973659A_ABST
    Figure CN120973659A_ABST
Patent Text Reader

Abstract

The invention discloses a testing method and device based on multi-port communication and a program debugging method. The testing method comprises the steps that a physical UART serial port is initialized, a BLE UART service serial port is created, and the data receiving logic of the physical UART serial port and the data receiving logic of the BLE UART service serial port are defined; acquiring a UART (Universal Asynchronous Receiver / Transmitter) task module, analyzing plant test instruction data transmitted by the physical UART serial port or the BLE UART service serial port by using the UART task module, acquiring a plant test instruction of each functional module, forwarding the plant test instruction to each functional module for execution, and acquiring a test result; and the test result is transmitted to an upper computer through the physical UART serial port or the BLE UART service serial port. The problems that the program running state cannot be monitored in real time and the function and the performance of each module of the product cannot be verified in a test instruction mode when the whole electronic equipment product is debugged are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-port communication technology, and in particular to a testing method, apparatus, and program debugging method based on multi-port communication. Background Technology

[0002] The development of electronic devices involves two key tasks: program debugging and module functionality verification. Currently, program debugging primarily involves monitoring program execution status via the UART port. However, in the final product stage, this relies on writing log files to record some critical information. Obtaining these log files requires wired or wireless export. This conventional approach has three drawbacks: incomplete debugging information, inability to monitor debugging information in real time, and low export efficiency. Regarding module functionality verification, it currently primarily involves sending test commands from the host computer and receiving responses from the slave device via the UART serial port. However, in the final product stage, the UART serial port is no longer available, making module functionality verification via test commands impossible and increasing the difficulty of optimizing and improving product performance. Summary of the Invention

[0003] In the existing technology, the program running status cannot be monitored in real time during the debugging of electronic equipment products, nor can the functions and performance of each module of the product be verified by using test commands.

[0004] To address the aforementioned issues, a testing method, device, and program debugging method based on multi-port communication is proposed. This method defines the physical UART serial port data receiving logic and the BLE UART service serial port data receiving logic, and utilizes the UART task module to parse the factory test command data transmitted from the physical UART serial port or BLE UART service serial port to obtain the factory test commands for each functional module. These commands are then forwarded to the respective functional modules for execution. This solves the problem in existing technologies where test commands cannot be used to verify the functionality and performance of each module of the product. Furthermore, by calling the UART debugging information sending interface to send debugging information to the physical UART serial port or BLE UART service serial port and forwarding it to the host computer for real-time monitoring, this method solves the problem in existing technologies where the program's running status cannot be monitored in real-time during overall machine debugging.

[0005] Firstly, a testing method based on multi-port communication includes:

[0006] Step 100: Initialize the physical UART serial port, create the BLE UART service serial port, and define the data receiving logic of the physical UART serial port and the data receiving logic of the BLE UART service serial port;

[0007] Step 200: Obtain the UART task module, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or the BLE UART service serial port, obtain the factory test commands of each functional module, and forward the factory test commands to each functional module for execution to obtain the test results.

[0008] Step 300: Transmit the test results to the host computer via the physical UART serial port or the BLE UART service serial port.

[0009] In conjunction with the multi-port communication-based testing method described in the first aspect of the present invention, in a first possible implementation, step 100 includes:

[0010] Step 110: Configure the clock information of the physical UART serial port;

[0011] Step 120: Configure the communication baud rate, data bits, stop bits, parity bits, and flow control information of the physical UART serial port.

[0012] In conjunction with the first possible embodiment of the first aspect of the present invention, in the second possible embodiment, step 100 further includes:

[0013] Step 130: Parse the test data received by the physical UART serial port to obtain the factory test instruction flag of the test data;

[0014] Step 140: If the factory test instruction flag exists, continue to receive and cache the data according to the factory test instruction data format. After receiving, perform integrity verification on the factory test instruction.

[0015] In conjunction with the second possible embodiment of the first aspect of the present invention, in the third possible embodiment, step 140 includes:

[0016] Step 141: Determine whether the verification value of the factory test command is equal to the local verification value;

[0017] Step 142: If the verification value of the factory test command is equal to the local verification value, then the factory test command is sent to the UART task module in the form of a message.

[0018] In conjunction with the multi-port communication-based testing method described in the first aspect of the present invention, in a fourth possible implementation, step 100 includes:

[0019] Step 150: Define the BLE UART service property list, add the BLE UART service to the BLEservice list, and register the data receiving callback function;

[0020] Step 160: Use the data receiving callback function to forward the test data to the UART task module.

[0021] In conjunction with the fourth possible implementation of the first aspect of the present invention, in the fifth possible implementation, step 160 includes:

[0022] Step 161: Parse the test data received by the BLE UART service serial port to determine whether the first byte of the test data is the factory test instruction flag. If it is the factory test instruction flag, continue to receive and buffer the data.

[0023] Step 162: After the test data is received, perform an integrity check on the factory test command.

[0024] In conjunction with the fifth possible implementation of the first aspect of the present invention, in the sixth possible implementation, step 162 includes:

[0025] Step 1621: Determine whether the verification value of the factory test command is equal to the local verification value;

[0026] Step 1622: If the verification value of the factory test instruction is equal to the local verification value, then further determine whether the factory test instruction belongs to this core. If so, send the factory test instruction to the UART task module in the form of a message for further parsing; otherwise, call the inter-core communication interface to send it to the peer core for processing.

[0027] Secondly, a program debugging method based on multi-port communication includes:

[0028] Step 400: Obtain debugging information using the physical UART serial port or BLE UART service serial port, and forward the debugging information to the UART task module in the form of a message;

[0029] Step 500: Define a UART debug information sending interface, call the UART debug information sending interface to send debug information to the physical UART serial port or BLE UART service serial port, and forward it to the host computer for real-time monitoring.

[0030] Thirdly, a testing device based on multi-port communication includes:

[0031] The definition module is used to initialize the physical UART serial port, create the BLE UART service serial port, and define the data receiving logic of the physical UART serial port and the data receiving logic of the BLE UART service serial port.

[0032] The functional test module is used to obtain the UART task module, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or the BLE UART service serial port, obtain the factory test commands of each functional module, forward the factory test commands to each functional module for execution, and obtain the test results.

[0033] The forwarding module is used to transmit the test results to the host computer via the physical UART serial port or the BLE UART service serial port.

[0034] In conjunction with the multi-port communication-based test apparatus described in the third aspect of the present invention, in a first possible implementation, the defining module includes:

[0035] The first initialization unit is used to configure the clock information of the physical UART serial port, and to configure the communication baud rate, data bits, stop bits, parity bits and flow control information of the physical UART serial port.

[0036] The first verification unit is used to parse the test data received by the physical UART serial port to obtain the factory test instruction flag of the test data. If the factory test instruction flag exists, the data is received and buffered according to the data format of the factory test instruction. After the reception is completed, the integrity of the factory test instruction is verified to determine whether the verification value of the factory test instruction is equal to the local verification value. If the verification value of the factory test instruction is equal to the local verification value, the factory test instruction is sent to the UART task module in the form of a message.

[0037] The second initialization unit is used to define the BLE UART service attribute list, add the BLE UART service to the BLE service list, and register the data receiving callback function.

[0038] The second verification unit is used to parse the test data received by the BLE UART service serial port to determine whether the first byte of the test data is a factory test instruction flag. If it is the factory test instruction flag, it continues to receive and buffer the data. After the test data is received, it performs an integrity check on the factory test instruction to determine whether the check value of the factory test instruction is equal to the local check value. If the check value of the factory test instruction is equal to the local check value, it further determines whether the factory test instruction belongs to this core. If so, it sends the factory test instruction to the UART task module in the form of a message for further parsing; otherwise, it calls the inter-core communication interface to send it to the peer core for processing.

[0039] The testing method, apparatus, and program debugging method based on multi-port communication described in this invention define physical UART serial port data receiving logic and BLE UART service serial port data receiving logic, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or BLE UART service serial port to obtain the factory test commands of each functional module, and forward the factory test commands to each functional module for execution. This solves the problem in the prior art that the functions and performance of each module of the product cannot be verified by using test commands. By calling the UART debugging information sending interface to send debugging information to the physical UART serial port or BLE UART service serial port, and forwarding it to the host computer for real-time monitoring, this solves the problem in the prior art that the program running status cannot be monitored in real time during whole machine debugging. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a flowchart illustrating the steps of a specific embodiment of a testing method based on multi-port communication according to the present invention.

[0042] Figure 2 for Figure 1 A flowchart illustrating a specific embodiment of step 100 in the above steps;

[0043] Figure 3 for Figure 2 A flowchart illustrating the steps following step 120 in a specific embodiment;

[0044] Figure 4 for Figure 3 A flowchart illustrating a specific embodiment of step 140 in the above steps;

[0045] Figure 5 for Figure 1 A flowchart illustrating another specific embodiment of step 100 in the above steps;

[0046] Figure 6 for Figure 5 A flowchart illustrating a specific embodiment of step 160 in the above steps;

[0047] Figure 7 for Figure 6 A flowchart illustrating a specific embodiment of step 162 in the above steps;

[0048] Figure 8 This is a flowchart illustrating the steps of a specific embodiment of a program debugging method based on multi-port communication according to the present invention.

[0049] Figure 9 This is a schematic diagram of a specific embodiment of a testing device based on multi-port communication according to the present invention;

[0050] Components and their serial numbers:

[0051] 601 - Definition Module, 602 - Functional Test Module, 603 - Forwarding Module. Detailed Implementation

[0052] The technical solutions of this invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are all within the scope of protection of this invention.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0054] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to that other component.

[0055] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0056] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0057] In the existing technology, the program running status cannot be monitored in real time during the debugging of electronic equipment products, nor can the functions and performance of each module of the product be verified by using test commands.

[0058] To address the above issues, a testing method, device, and program debugging method based on multi-port communication are proposed.

[0059] Firstly, a testing method based on multi-port communication, such as... Figure 1 , Figure 1 This is a flowchart illustrating the steps of a specific embodiment of a testing method based on multi-port communication according to the present invention; including:

[0060] Step 100: Initialize the physical UART serial port, create the BLE UART service serial port, and define the physical UART serial port data receiving logic and the BLE UART service serial port data receiving logic.

[0061] In this embodiment, the device is developed based on the Apollo4 platform and the IAR Embedded Workbench integrated development environment. It employs either a physical UART serial port or a BLE UART service serial port for communication, enabling bidirectional communication between the device and the host computer. The device communicates with the host computer via UART serial port using a USB-to-serial cable. Alternatively, the device can communicate with the host computer via BLE UART service.

[0062] In one possible implementation, such as Figure 2 , Figure 2 for Figure 1 A flowchart of a specific embodiment of step 100 is shown below; step 100 includes: step 110, configuring the clock information of the physical UART serial port; step 120, configuring the communication baud rate, data bits, stop bits, parity bits and flow control information of the physical UART serial port.

[0063] In this embodiment, the physical UART serial port is first initialized and configured, including clock information, communication baud rate, data bits, stop bits, parity bits, and flow control information. When connected to the host computer, UART serial communication can be performed via a USB to serial cable.

[0064] In one possible implementation, such as Figure 3 , Figure 3 for Figure 2 The flowchart of a specific embodiment following step 120 is shown below; step 100 further includes: step 130, parsing the test data received by the physical UART serial port to obtain the factory test instruction flag of the test data; step 140, if the factory test instruction flag exists, continuing to receive and buffer according to the data format of the factory test instruction, and after receiving, performing integrity verification on the factory test instruction.

[0065] In one possible implementation, such as Figure 4 , Figure 4 for Figure 3 A flowchart illustrating a specific embodiment of step 140 is shown below; step 140 includes: step 141, determining whether the verification value of the factory test instruction is equal to the local verification value; step 142, if the verification value of the factory test instruction is equal to the local verification value, then sending the factory test instruction to the UART task module in the form of a message.

[0066] In this embodiment, the serial port data receiving and processing logic is designed to parse the received data. If the factory test instruction flag is found, the data is received and buffered according to the factory test instruction format. After the data is received, the integrity of the factory test instruction is checked. If the local check value is equal to the received check value, it means that the instruction is complete. Then, the instruction is sent to the UART task module (factory test task) in the form of a message for further parsing.

[0067] In one possible implementation, such as Figure 5 , Figure 5 for Figure 1 The flowchart of another specific embodiment of step 100 is shown below; step 100 includes: step 150, defining the BLE UART service attribute list, adding the BLE UART service to the BLE service list, and registering the data receiving callback function; step 160, using the data receiving callback function to forward the test data to the UART task module.

[0068] In one possible implementation, such as Figure 6 , Figure 6 for Figure 5A flowchart of a specific embodiment of step 160 is shown below; step 160 includes: step 161, parsing the test data received by the BLE UART service serial port to determine whether the first byte of the test data is a factory test instruction flag. If it is a factory test instruction flag, then continue to receive and buffer it; step 162, after the test data is received, perform integrity verification on the factory test instruction.

[0069] In one possible implementation, such as Figure 7 , Figure 7 for Figure 6 A flowchart of a specific embodiment of step 162 is shown below; step 162 includes: step 1621, determining whether the verification value of the factory test instruction is equal to the local verification value; step 1622, if the verification value of the factory test instruction is equal to the local verification value, further determining whether the factory test instruction belongs to this core, if so, sending the factory test instruction to the UART task module in the form of a message for re-parsing, otherwise calling the inter-core communication interface to send it to the peer core for processing.

[0070] In this embodiment, the main functions are to create a BLE UART service serial port service, define a BLE UART service attribute list, add the BLE UART service to the BLE service list, register a data receiving callback function, and use the data receiving callback function to implement the logic of forwarding test data from the host computer to the UART task module. The received data is parsed, and if the first byte is a factory test instruction flag, instruction integrity verification is performed. If the local checksum is equal to the received checksum, the instruction is considered complete. Then, it is determined whether the instruction belongs to this core. If so, it is sent to the UART task module (factory test task) in message form for further parsing; otherwise, the inter-core communication interface is called to send it to the peer core for processing.

[0071] Step 200: Obtain the UART task module, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or BLE UARTservice serial port, obtain the factory test commands of each functional module, and forward the factory test commands to each functional module for execution to obtain the test results.

[0072] In this embodiment, the main purpose is to design the parsing logic for test instructions. Specifically, a UART task is first created, the module function verification instructions are parsed, the test instructions are distributed to each module for execution, and after the test is completed, the test results are sent to the UART / BLE UART service port.

[0073] Step 300: Transmit the test results to the host computer via the physical UART serial port or the BLE UART service serial port.

[0074] In this embodiment, by defining the physical UART serial port data receiving logic and the BLE UART service serial port data receiving logic, and using the UART task module to parse the factory test command data transmitted from the physical UART serial port or the BLE UART service serial port, the factory test commands of each functional module are obtained, and the factory test commands are forwarded to each functional module for execution. This solves the problem in the prior art that the functions and performance of each module of the product cannot be verified by using test commands.

[0075] Secondly, a program debugging method based on multi-port communication, such as... Figure 8 , Figure 8 This is a flowchart illustrating the steps of a specific embodiment of a program debugging method based on multi-port communication according to the present invention; including:

[0076] Step 400: Obtain debugging information using the physical UART serial port or BLE UART service serial port, and forward the debugging information to the UART task module in the form of a message. Step 500: Define a UART debugging information sending interface, call the UART debugging information sending interface to send debugging information to the physical UART serial port or BLE UART service serial port, and forward it to the host computer for real-time monitoring.

[0077] In this embodiment, the UART / BLE UART service port data forwarding logic is first determined. Specifically, the UART task module is first registered, and the data is loaded into a message and sent to the UART task module through the physical UART serial port / BLE UART service serial port.

[0078] Secondly, the design determines the multi-port sending logic for debugging information. Specifically, first, a UART debugging information sending interface is defined, and the UART debugging information sending interface is called to send debugging information. Then, the physical UART serial port or BLE UARTservice serial port is called to send the debugging information to the host computer for real-time monitoring.

[0079] In this embodiment, debugging information is sent to the physical UART serial port or BLE UART service serial port by calling the UART debugging information sending interface, and then forwarded to the host computer for real-time monitoring, which solves the problem that the program running status cannot be monitored in real time during whole-machine debugging in the prior art.

[0080] Thirdly, a testing device based on multi-port communication, such as... Figure 9 , Figure 9 This is a schematic diagram of a specific embodiment of a testing device based on multi-port communication according to the present invention; including:

[0081] Define module 601, which is used to initialize the physical UART serial port, create the BLE UART service serial port, and define the physical UART serial port data receiving logic and the BLE UART service serial port data receiving logic.

[0082] Functional test module 602 is used to obtain the UART task module, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or BLE UART service serial port, obtain the factory test commands of each functional module, forward the factory test commands to each functional module for execution, and obtain the test results.

[0083] The forwarding module 603 is used to transmit test results to the host computer via the physical UART serial port or the BLE UART service serial port.

[0084] Furthermore, module 601 includes:

[0085] The first initialization unit is used to configure the clock information of the physical UART serial port, and to configure the communication baud rate, data bits, stop bits, parity bits and flow control information of the physical UART serial port.

[0086] The first verification unit is used to parse the test data received by the physical UART serial port to obtain the factory test instruction flag of the test data. If the factory test instruction flag exists, it continues to receive and buffer according to the data format of the factory test instruction. After receiving, it performs integrity verification on the factory test instruction and determines whether the verification value of the factory test instruction is equal to the local verification value. If the verification value of the factory test instruction is equal to the local verification value, it sends the factory test instruction to the UART task module in the form of a message.

[0087] The second initialization unit is used to define the BLE UART service attribute list, add the BLE UART service to the BLE service list, and register the data receiving callback function.

[0088] The second verification unit is used to parse the test data received by the BLE UART service serial port to determine whether the first byte of the test data is a factory test instruction flag. If it is, the system continues to receive and buffer the data. After the test data is received, the system performs an integrity check on the factory test instruction to determine whether the check value of the factory test instruction is equal to the local check value. If the check value of the factory test instruction is equal to the local check value, the system further determines whether the factory test instruction belongs to this core. If so, the system sends the factory test instruction to the UART task module in the form of a message for further parsing; otherwise, it calls the inter-core communication interface to send it to the peer core for processing.

[0089] The present invention implements a testing method, apparatus, and program debugging method based on multi-port communication. By defining physical UART serial port data receiving logic and BLE UART service serial port data receiving logic, and using the UART task module to parse the factory test command data transmitted from the physical UART serial port or BLE UART service serial port, the factory test commands of each functional module are obtained and forwarded to each functional module for execution. This solves the problem in the prior art that the functions and performance of each module of the product cannot be verified by using test commands. By calling the UART debugging information sending interface to send debugging information to the physical UART serial port or BLE UART service serial port and forwarding it to the host computer for real-time monitoring, this solves the problem in the prior art that the program running status cannot be monitored in real time during whole-machine debugging.

[0090] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A testing method based on multi-port communication, characterized in that it includes: Step 100: Initialize the physical UART serial port, create the BLE UART service serial port, and define the data receiving logic of the physical UART serial port and the data receiving logic of the BLE UART service serial port; Step 200: Obtain the UART task module, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or the BLE UART service serial port, obtain the factory test commands of each functional module, and forward the factory test commands to each functional module for execution to obtain the test results. Step 300: Transmit the test results to the host computer via the physical UART serial port or the BLE UART service serial port.

2. The test method based on multi-port communication according to claim 1, characterized in that, Step 100 includes: Step 110: Configure the clock information of the physical UART serial port; Step 120: Configure the communication baud rate, data bits, stop bits, parity bits, and flow control information of the physical UART serial port.

3. The test method based on multi-port communication according to claim 2, characterized in that, Step 100 further includes: Step 130: Parse the test data received by the physical UART serial port to obtain the factory test instruction flag of the test data; Step 140: If the factory test instruction flag exists, continue to receive and cache the data according to the factory test instruction data format. After receiving, perform integrity verification on the factory test instruction.

4. The test method based on multi-port communication according to claim 3, characterized in that, Step 140 includes: Step 141: Determine whether the verification value of the factory test command is equal to the local verification value; Step 142: If the verification value of the factory test command is equal to the local verification value, then the factory test command is sent to the UART task module in the form of a message.

5. The test method based on multi-port communication according to claim 1, characterized in that, Step 100 includes: Step 150: Define the BLE UART service attribute list, add the BLE UART service to the BLE UART service attribute list, and register the data receiving callback function; Step 160: Use the data receiving callback function to forward the test data to the UART task module.

6. The test method based on multi-port communication according to claim 5, characterized in that, Step 160 includes: Step 161: Parse the test data received by the BLE UART service serial port to determine whether the first byte of the test data is the factory test instruction flag. If it is the factory test instruction flag, continue to receive and buffer the data. Step 162: After the test data is received, perform an integrity check on the factory test command.

7. The test method based on multi-port communication according to claim 6, characterized in that, Step 162 includes: Step 1621: Determine whether the verification value of the factory test command is equal to the local verification value; Step 1622: If the verification value of the factory test instruction is equal to the local verification value, then further determine whether the factory test instruction belongs to this core. If so, send the factory test instruction to the UART task module in the form of a message for re-parsing; otherwise, call the inter-core communication interface to send it to the peer core for processing.

8. A program debugging method based on multi-port communication, characterized in that, include: Step 400: Obtain debugging information using the physical UART serial port or BLE UART service serial port, and forward the debugging information to the UART task module in the form of a message; Step 500: Define a UART debug information sending interface, call the UART debug information sending interface to send debug information to the physical UART serial port or BLE UART service serial port, and forward it to the host computer for real-time monitoring.

9. A testing apparatus based on multi-port communication, employing the testing method based on multi-port communication as described in any one of claims 1-7, comprising: The definition module is used to initialize the physical UART serial port, create the BLE UART service serial port, and define the data receiving logic of the physical UART serial port and the data receiving logic of the BLE UART service serial port. The functional test module is used to obtain the UART task module, and use the UART task module to parse the factory test command data transmitted from the physical UART serial port or the BLE UART service serial port, obtain the factory test commands of each functional module, forward the factory test commands to each functional module for execution, and obtain the test results. The forwarding module is used to transmit the test results to the host computer via the physical UART serial port or the BLE UART service serial port.

10. The testing device based on multi-port communication according to claim 9, characterized in that, The definition module includes: The first initialization unit is used to configure the clock information of the physical UART serial port, and to configure the communication baud rate, data bits, stop bits, parity bits and flow control information of the physical UART serial port. The first verification unit is used to parse the test data received by the physical UART serial port to obtain the factory test instruction flag of the test data. If the factory test instruction flag exists, the data is received and buffered according to the data format of the factory test instruction. After the reception is completed, the integrity of the factory test instruction is verified to determine whether the verification value of the factory test instruction is equal to the local verification value. If the verification value of the factory test instruction is equal to the local verification value, the factory test instruction is sent to the UART task module in the form of a message. The second initialization unit is used to define the BLE UART service attribute list, add BLE UART services to the BLEservice list, and register data receiving callback functions. The second verification unit is used to parse the test data received by the BLE UART service serial port to determine whether the first byte of the test data is a factory test instruction flag. If it is the factory test instruction flag, it continues to receive and buffer the data. After the test data is received, it performs an integrity check on the factory test instruction to determine whether the check value of the factory test instruction is equal to the local check value. If the check value of the factory test instruction is equal to the local check value, it further determines whether the factory test instruction belongs to this core. If so, it sends the factory test instruction to the UART task module in the form of a message for further parsing; otherwise, it calls the inter-core communication interface to send it to the peer core for processing.