Disclosure of Invention
Therefore, it is necessary to provide a method and a system for testing a PCBA board, a testing device, and a micro control unit for solving the above technical problems, and by using such a testing method, the manual intervention hardware can be reduced, and the production quality can be improved, so that the labor cost can be reduced, and the user experience can be improved, and the technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for testing a PCBA board, which is applied to a test device, and the method includes:
reading a test configuration table of the PCBA;
burning a test program to the PCBA board;
sending a function test request to a micro control unit according to the test configuration table so that the micro control unit sends a function test starting instruction to the PCBA according to the function test request;
and receiving a test result sent by the micro control unit, determining whether the PCBA is normal according to the test result, and if the PCBA is normal, performing formal program burning on the PCBA.
In some other embodiments, before the reading the test configuration table of the PCBA board, the method further comprises:
receiving a voltage test result of the PCBA board sent by a micro-control unit;
and sending serial port test information to the PCBA according to the voltage test result so as to confirm whether the serial port is normal or not according to feedback information of the PCBA on the serial port test information.
In some other embodiments, the reading the test configuration table of the PCBA board includes:
and acquiring configuration data of the PCBA by identifying the bar code on the PCBA, and integrating the configuration data of the PCBA into the test configuration table.
In some other embodiments, the sending a functional test request to a micro control unit according to the test configuration table, so that the micro control unit sends a functional test starting instruction to the PCBA board according to the functional test request includes:
selecting a function option to be tested according to the test configuration table, and generating a corresponding function test request according to the function option;
and sending the function test request to a micro control unit so that the micro control unit tests the corresponding function of the PCBA board according to the function test request.
In a second aspect, an embodiment of the present invention further provides a method for testing a PCBA board, which is applied to a control unit, and the method includes:
receiving a function test request sent by test equipment, and sending a function test starting instruction to the PCBA board according to the function test request;
sending a request for obtaining a test result to the PCBA at intervals of preset time;
and receiving a test result of the PCBA, and sending the test result to the test equipment.
In some other embodiments, before receiving the functional test request sent by the test device, the method further includes:
and providing voltage for the PCBA board so as to enable the PCBA board to carry out voltage test, receiving a voltage test result of the PCBA board, and sending the voltage test result to the test equipment so as to enable the test equipment to test the serial port of the PCBA board.
In a third aspect, an embodiment of the present invention further provides a testing apparatus, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described method applied to testing of the PCBA board of a device.
In a fourth aspect, an embodiment of the present invention further provides a micro control unit, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described method applied to the test PCBA board of a micro-control unit.
In a fifth aspect, an embodiment of the present invention further provides a system for testing a PCBA board, where the system for testing a PCBA board includes the above-mentioned test equipment and a micro control unit.
In a sixth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a testing device, the testing device is caused to execute the above method applied to testing a PCBA board of the testing device.
Compared with the prior art, the invention has the beneficial effects that: the method and system for testing the PCBA board, the testing device and the micro-control unit are different from the prior art. The testing equipment burns a testing program into the PCBA by reading a testing configuration table of the PCBA, tests a function item according to the read testing configuration table, sends a function testing request of the function item to the micro control unit, and the micro control unit sends a function testing starting instruction to the PCBA after receiving the function testing request, so that the PCBA opens a testing function and performs corresponding function testing according to the function testing instruction. And after obtaining the test result, the micro control unit sends the test result to test equipment, the test equipment judges whether the PCBA board is normal or not according to the test result, and if the PCBA board is normal, the program burning is carried out on the PCBA board. Through the testing mode, manual intervention hardware can be reduced, and production quality is improved, so that labor cost is reduced, and user experience is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the invention. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts. The terms "first", "second", "third", and the like used in the present invention do not limit data and execution order, but distinguish the same items or similar items having substantially the same function and action.
The method for testing the PCBA board provided by the embodiment of the present invention is applied to the application scenario shown in fig. 1, in the embodiment of the present invention, the application scenario is a system for testing the PCBA board, and is used for testing the PCBA board, and the application scenario 1 includes a test device 10, a micro control unit 20, and a PCBA board 30. The test device 10 is in communication connection with the micro control unit 20 through a serial bus to perform information interaction, the test device can be a notebook computer, a desktop computer and the like with a serial interface, the test device 10 is in communication connection with the PCBA board 30 through the serial bus to perform information interaction, and the micro control unit 20 is in communication connection with the PCBA board 30 through the serial bus to perform information interaction.
It should be noted that the method provided in the embodiment of the present application may be further extended to other suitable application scenarios, and is not limited to the application scenario shown in fig. 1. Fig. 1 schematically shows a test device 10, a micro control unit 20 and a PCBA board 30, and in an actual application process, the application environment may further include more test devices 10, micro control units 20 and PCBA boards 30.
As shown in fig. 2, an embodiment of the present invention provides a method for testing a PCBA board, which is applied to a testing device, and the method includes:
step S201, reading the test configuration table of the PCBA.
When the PCBA is tested, the configuration data of the PCBA needs to be read, and the configuration data of the PCBA is analyzed and sorted, so that a test configuration table is obtained.
In some other embodiments, to ensure that the test of the PCBA board can be performed successfully, as shown in fig. 3, before the reading the test configuration table of the PCBA board, the method further includes:
and S301, receiving a voltage test result of the PCBA board sent by the micro control unit.
Before reading a test configuration table of the PCBA, firstly, carrying out power-on self-test on the PCBA to ensure that subsequent tests can be carried out normally, wherein the power-on self-test is to provide rated voltage of the PCBA for the PCBA through a micro control unit, and the PCBA can carry out function operation of the PCBA under the rated voltage. After the micro control unit provides rated voltage for the PCBA, the PCAB board performs functional operation, feeds back a voltage test result of power-on self test to the micro control unit, and sends the voltage test result to test equipment after the micro control unit receives the voltage test result.
Step S302, serial port test information is sent to the PCBA according to the voltage test result, and whether the serial port is normal is confirmed according to feedback information of the PCBA on the serial port test information.
And after receiving the voltage test result, the test equipment judges whether the PCBA can normally work under the rated voltage according to the voltage test result, and if the PCBA can normally work, tests whether the serial port of the PCBA can normally communicate. The test equipment sends serial port test information to the PCBA, and the PCBA sends feedback information to the test equipment according to the serial port test information after receiving the serial port test information. If the test equipment can receive the feedback information, the serial port of the PCBA board can normally communicate, and if the test equipment does not receive the feedback information of the serial port test information of the PCBA board, the serial port of the PCBA board cannot normally communicate.
After the PCBA is subjected to the tests of power-on self test and serial port communication, if the power-on self test and the serial port communication of the PCBA are normal, reading a test configuration table of the PCBA. In some embodiments, the reading of the test configuration table of the PCBA board may be performed by scanning a barcode on the PCBA board, reading configuration data of the PCBA board carried in the barcode after scanning, and analyzing and sorting the configuration data after obtaining the configuration data of the PCBA board, so as to integrate the configuration table into the test configuration table.
In other embodiments, the test equipment stores the type of the PCBA board and configuration data corresponding to the type of the PCBA board, and the test equipment extracts the type information of the PCBA board from the barcode by scanning the barcode on the PCBA board, and obtains a test configuration table corresponding to the PCBA board according to the type of the PCBA board.
Step S202, burning a test program to the PCBA.
In the embodiment of the invention, because the PCBA board needs to be tested, the test program needs to be burned, so that the test program can test the functional items when the functional items in the configuration table of the PCBA board need to be tested subsequently.
Step S203, sending a function test request to a micro control unit according to the test configuration table, so that the micro control unit sends a function test starting instruction to the PCBA board according to the function test request.
In the embodiment of the invention, after the test equipment acquires the test configuration table of the PCBA, the test equipment generates a function test request according to the test configuration table and sends the function test request to the micro control unit, so that the micro control unit sends a function test starting instruction to the PCBA according to the function test request.
In some embodiments, as shown in fig. 4, the sending a functional test request to a micro control unit according to the test configuration table, so that the micro control unit sends a functional test starting instruction to the PCBA board according to the functional test request includes:
step S401, selecting the function option to be tested according to the test configuration table, and generating a corresponding function test request according to the function option.
After the test program is burned, the test equipment can select the functional items to be tested according to the actual conditions and the functional items in the configuration test table, and generate corresponding functional test requests according to the selected functional items.
And step S402, sending the function test request to a micro control unit, so that the micro control unit tests the corresponding function of the PCBA board according to the function test request.
After receiving a function test request sent by test equipment, the micro control unit generates a function test starting instruction according to the function test request and sends the function test starting instruction to the PCBA. And the PCBA board starts the function test after receiving the function test starting instruction, and tests corresponding functions according to the received function test instruction after starting the function test.
And step S204, receiving the test result sent by the micro control unit, determining whether the PCBA board is normal according to the test result, and if the PCBA board is normal, burning a program on the PCBA.
After the micro control unit sends the function test instruction to the PCBA board, a request for obtaining a test result is sent to the PCBA board every preset time, and the preset time can be set according to an actual situation, preferably, can be set to 20 ms. After receiving the request for obtaining the test result sent by the micro control unit, the PCBA queries the test result of the currently tested function item and sends the test result to the micro control unit. And after receiving the test result, the micro control unit sends the test result to the test equipment, and after receiving the test result, the test equipment records the test result. And after the test items to be tested are all tested, the test equipment judges whether the PCBA is normal or not according to the recorded test result, and if the PCBA is normal, a formal program is burned into the PCBA.
In some embodiments, when all functional items to be tested are tested, the PCBA board sends feedback information that all functional items have been tested to the micro control unit, the micro control unit sends the feedback information to the testing device after receiving the feedback information, the testing device judges whether the PCBA board is normal according to the recorded testing result after receiving the feedback information, and if the PCBA board is normal, a formal program is burned into the PCBA board.
The embodiment of the invention has the advantages that the micro control unit provides the PCBA with the rated voltage for normal operation of the PCBA, so that the PCBA can be subjected to power-on self test, the voltage test result is fed back to the micro control unit, the micro control unit tests the serial port of the PCBA after receiving the voltage test result, and if the serial port of the PCBA can normally communicate, the test equipment obtains the test configuration table of the PCBA by scanning the bar code on the PCBA. After obtaining the test configuration table, burning a test program onto the PCBA board, after burning is completed, selecting a function item to be tested according to the test configuration table, generating a function test request according to the selected function item, sending the function test request to the micro control unit, and after receiving the function test request, the micro control unit generating a function test instruction according to the function test request, and sending the function test instruction to the PCBA board. After receiving the function test instruction, the PCBA board starts a test function according to the function test instruction and tests a corresponding function according to the function test instruction. After the micro control unit sends the function test instruction, a test result acquisition request is sent to the PCBA at each preset time, after the PCBA receives the test result acquisition request, the test result of the function item which is tested at present is sent to the micro control unit, after the micro control unit receives the test result, the test result is sent to the test equipment, and the test equipment records the test result after receiving the test result. After the PCBA completes the test of all the functional items in the functional test instruction, sending feedback information of complete test to the micro control unit, after the micro control unit receives the feedback result, sending the feedback result to the test equipment, after the test equipment receives the feedback information, judging whether the PCBA is normal according to the recorded test result, and if so, burning a formal program into the PCBA. Through the testing mode, manual intervention hardware can be reduced, and production quality is improved, so that labor cost is reduced, and user experience is improved.
As shown in fig. 5, an embodiment of the present invention further provides a method for testing a PCBA board, which is applied to a micro control unit, and the method includes:
step S501, receiving a function test request sent by a test device, and sending a function test starting instruction to the PCBA according to the function test request.
After the test equipment acquires the test configuration table of the PCBA board, the test equipment generates a function test request according to the test configuration table, and the micro control unit generates a function test starting instruction according to the function test request after receiving the function test request sent by the test equipment, and sends the function test starting instruction to the PCBA board. And the PCBA board starts the function test after receiving the function test starting instruction, and tests corresponding functions according to the received function test instruction after starting the function test.
In some other embodiments, before the receiving the functional test request sent by the test device, the method further includes: and providing voltage for the PCBA board so as to enable the PCBA board to carry out voltage test, receiving a voltage test result of the PCBA board, and sending the voltage test result to the test equipment so as to enable the test equipment to test the serial port of the PCBA board.
Before testing the PCBA board, firstly, carrying out power-on self-test on the PCBA to ensure that subsequent tests can be carried out normally, wherein the power-on self-test is to provide rated voltage of the PCBA board for the PCBA board through a micro-control unit, and the PCBA board can carry out function operation of the PCBA board under the rated voltage. After the micro control unit provides rated voltage for the PCBA, the PCAB board performs functional operation, feeds back a voltage test result of power-on self test to the micro control unit, and sends the voltage test result to test equipment after the micro control unit receives the voltage test result.
And after receiving the voltage test result, the test equipment judges whether the PCBA can normally work under the rated voltage according to the voltage test result, and if the PCBA can normally work, tests whether the serial port of the PCBA can normally communicate. The test equipment sends serial port test information to the PCBA, and the PCBA sends feedback information to the test equipment according to the serial port test information after receiving the serial port test information. If the test equipment can receive the feedback information, the serial port of the PCBA board can normally communicate, and if the test equipment does not receive the feedback information of the serial port test information of the PCBA board, the serial port of the PCBA board cannot normally communicate.
And step S502, sending a request for obtaining a test result to the PCBA at intervals of preset time.
After the micro control unit sends the function test instruction to the PCBA board, a request for obtaining a test result is sent to the PCBA board at intervals of preset time, the preset time can be set according to actual conditions, and preferably, the preset time can be set to 20 ms.
And S503, receiving the test result of the PCBA board, and sending the test result to the test equipment.
After receiving the request for obtaining the test result sent by the micro control unit, the PCBA queries the test result of the currently tested function item and sends the test result to the micro control unit. And after receiving the test result, the micro control unit sends the test result to the test equipment, and after receiving the test result, the test equipment records the test result. When all functional items to be tested are tested, the PCBA board sends feedback information that all functional items are tested to the micro control unit, the micro control unit sends the feedback information to the testing equipment after receiving the feedback information, the testing equipment judges whether the PCBA board is normal according to the recorded testing result after receiving the feedback information, and if the PCBA board is normal, a formal program is burned into the PCBA board.
As shown in fig. 6, a test procedure of the method for testing a PCBA board according to the embodiment of the present invention is as follows:
little the control unit provides rated voltage for the PCBA board, so that the PCBA board is gone up the electricity and is tested by oneself to guarantee that follow-up test can normally go on, it provides the rated voltage of PCBA board for the PCBA board through little the control unit to go up the electricity and tests by oneself, and the PCBA board can carry out PCBA board function operation under the rated voltage. After the micro control unit provides rated voltage for the PCBA, the PCAB board performs functional operation, feeds back a voltage test result of power-on self test to the micro control unit, and sends the voltage test result to test equipment after the micro control unit receives the voltage test result.
And after receiving the voltage test result, the test equipment judges whether the PCBA can normally work under the rated voltage according to the voltage test result, and if the PCBA can normally work, tests whether the serial port of the PCBA can normally communicate. The test equipment sends serial port test information to the PCBA, and the PCBA sends feedback information to the test equipment according to the serial port test information after receiving the serial port test information. If the test equipment can receive the feedback information, the serial port of the PCBA board can normally communicate, and if the test equipment does not receive the feedback information of the serial port test information of the PCBA board, the serial port of the PCBA board cannot normally communicate.
After the PCBA is subjected to the tests of power-on self test and serial port communication, if the power-on self test and the serial port communication of the PCBA are normal, the PCBA needs to be tested, so that the PCBA needs to be burned, and the functional items in the PCBA configuration table need to be tested subsequently, and the functional items can be tested by the test program.
And reading a test configuration table of the PCBA. In some embodiments, the reading of the test configuration table of the PCBA board may be performed by scanning a barcode on the PCBA board, reading configuration data of the PCBA board carried in the barcode after scanning, and analyzing and sorting the configuration data after obtaining the configuration data of the PCBA board, so as to integrate the configuration table into the test configuration table. The test equipment can select the functional items to be tested according to the functional items in the configuration test table and the actual situation, generate corresponding functional test requests according to the selected functional items and send the test requests to the micro control unit.
After receiving a function test request sent by test equipment, the micro control unit generates a function test starting instruction according to the function test request and sends the function test starting instruction to the PCBA. And the PCBA board starts the function test after receiving the function test starting instruction, and tests corresponding functions according to the received function test instruction after starting the function test.
After the micro control unit sends the function test instruction to the PCBA board, a request for obtaining a test result is sent to the PCBA board every preset time, and the preset time can be set according to an actual situation, preferably, can be set to 20 ms. After receiving the request for obtaining the test result sent by the micro control unit, the PCBA queries the test result of the currently tested function item and sends the test result to the micro control unit. And after receiving the test result, the micro control unit sends the test result to the test equipment, and after receiving the test result, the test equipment records the test result. When all functional items to be tested are tested, the PCBA board sends feedback information that all functional items are tested to the micro control unit, the micro control unit sends the feedback information to the testing equipment after receiving the feedback information, the testing equipment judges whether the PCBA board is normal according to the recorded testing result after receiving the feedback information, and if the PCBA board is normal, a formal program is burned into the PCBA board.
Fig. 7 is a schematic diagram of a hardware structure of a test device according to an embodiment of the present invention, where the hardware structure 10 of the test device includes:
one or more first processors 101 and a first memory 102, and one first processor 101 is taken as an example in fig. 7.
The first processor 101 and the first memory 102 may be connected by a bus or other means, and fig. 7 illustrates an example of connection by a bus.
The first memory 102, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The first processor 101 executes various functional applications and data processing of the test equipment, i.e. the method of testing a PCBA board, which implements the above-described method embodiments, by running the non-volatile software programs, instructions and modules stored in the first memory 102.
The first memory 102 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the test equipment, and the like. In addition, the first memory 102 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the first memory 102 may optionally include memory located remotely from the first processor 101, which may be connected to the test equipment over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the first memory 102 and, when executed by the one or more first processors, perform the above-described method of testing a PCBA board as applied to embodiments of a test device.
Fig. 8 is a schematic diagram of a hardware structure of a micro control unit according to an embodiment of the present invention, where the hardware structure 20 of the micro control unit includes:
one or more second processors 201 and a second memory 202, and one second processor 201 is taken as an example in fig. 8.
The second processor 201 and the second memory 202 may be connected by a bus or other means, and fig. 8 illustrates an example of a connection by a bus.
The second memory 202, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The second processor 201 executes various functional applications and data processing of the micro control unit by running the non-volatile software programs, instructions and modules stored in the second memory 202, i.e. implements the above-described method of testing a PCBA board applied to the embodiment on the micro control unit side.
The second memory 202 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the micro control unit, and the like. In addition, the second memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the second memory 202 optionally comprises a memory located remotely from the second processor 201, and these remote memories may be connected to the micro control unit via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the second memory 202 and, when executed by the one or more second processors, perform the above-described method of testing a PCBA board as applied to embodiments of a micro-control unit.
Embodiments of the present application provide a non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by one or more processors, such as one of the processors 101 of fig. 7, cause the one or more processors to perform a method of testing a PCBA board in any of the method embodiments described above.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.