CN115562250B - Method and device for testing functions of micro-control unit - Google Patents

Method and device for testing functions of micro-control unit Download PDF

Info

Publication number
CN115562250B
CN115562250B CN202211395584.8A CN202211395584A CN115562250B CN 115562250 B CN115562250 B CN 115562250B CN 202211395584 A CN202211395584 A CN 202211395584A CN 115562250 B CN115562250 B CN 115562250B
Authority
CN
China
Prior art keywords
function
control unit
micro control
communication
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211395584.8A
Other languages
Chinese (zh)
Other versions
CN115562250A (en
Inventor
王红光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
iFlytek Co Ltd
Original Assignee
iFlytek Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by iFlytek Co Ltd filed Critical iFlytek Co Ltd
Priority to CN202211395584.8A priority Critical patent/CN115562250B/en
Publication of CN115562250A publication Critical patent/CN115562250A/en
Application granted granted Critical
Publication of CN115562250B publication Critical patent/CN115562250B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The invention relates to the technical field of function test, and provides a method and a device for testing the functions of a micro control unit, wherein the method comprises the steps of firstly establishing communication connection with the micro control unit based on communication service with an auxiliary test unit, and executing a test case script corresponding to a function to be tested of the micro control unit; then, based on the test case script, calling a function module script corresponding to the function to be tested, and based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data; and finally, receiving an execution result fed back by the micro control unit, realizing the acquisition of a test result and completing the test. The method has no dependence on the SOC function, can expose the problems generated by the MCU function in time, greatly reduces the problem analysis cost and has stronger practicability. Moreover, the method does not need manual verification, and has high testing efficiency and low testing cost.

Description

Method and device for testing functions of micro-control unit
Technical Field
The invention relates to the technical field of function testing, in particular to a method and a device for testing functions of a micro control unit.
Background
The cockpit area controller generally includes a Micro Controller Unit (MCU) and a System On Chip (SOC). MCU mainly realizes functions such as power management, general-purpose input/output interface (GPIO) Signal detection, the car accuse car is established control and Digital Signal Processing (DSP) control of passenger cabin territory, and the car accuse car is established control and can be including air conditioner regulation, seat regulation and window control etc.. The SOC mainly realizes functions such as a liquid crystal instrument and a head-up display system (HUD) which have high requirements for real-time performance and security level, and functions such as navigation, vehicle setting, multimedia playing which have high requirements for extensibility.
Data interaction is required to be carried out between the MCU and the SOC, for example, the SOC needs to transmit signals to the MCU for setting some liquid crystal instruments, and then the signals are transmitted to a target element by the MCU through a whole vehicle network; the state information such as the vehicle speed, the alarm state (Telltale), the battery power, the air conditioner state and the like received by the MCU from the whole vehicle network also needs to be sent to the SOC first, and then the SOC displays the state information on the liquid crystal instrument.
In the prior art, because MCU function belongs to bottom basic capability in the cabin domain controller, can the priority design realize, and whether MCU function realizes normally, need wait in the cabin domain controller complete realization of SOC function can verify, need the application function of artifical check cabin domain promptly, and then test the MCU function indirectly, for example, carry out the air conditioner through air conditioner APP and open the operation, whether observing the air conditioner again and opening, it opens the order and gives the air conditioner to indirectly verify MCU whether correct through whole car network, verify simultaneously whether MCU correctly receives the state information of opening that comes from the air conditioner and show for air conditioner APP.
In the MCU function testing method in the prior art, the dependence on the SOC function is high, and due to manual verification, the defects of low testing efficiency, high testing cost, low testing coverage of the MCU function, problem exposure lag, high problem analysis cost and the like exist.
Disclosure of Invention
The invention provides a method and a device for testing the functions of a micro control unit, which are used for overcoming the defects in the prior art.
The invention provides a method for testing the function of a micro control unit, which comprises the following steps:
establishing communication connection with a micro control unit based on communication service with an auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested;
based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data;
receiving an execution result fed back by the micro control unit;
the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
According to the function testing method of the micro control unit provided by the invention, the function module script comprises an interface function of the function module corresponding to the function to be tested, and the interface function is obtained by mapping based on the function information of the function to be tested in the target communication protocol.
According to the function test method of the micro control unit provided by the invention, the establishment of the communication connection with the micro control unit based on the communication service with the auxiliary test unit comprises the following steps:
establishing a communication connection with the auxiliary test unit based on the communication service;
and establishing communication connection between the auxiliary test unit and the micro control unit based on a first communication process, wherein the communication protocol of the first communication process is the target communication protocol.
According to the function test method of the micro control unit provided by the invention, the communication service is used for orienting a local port to an external port corresponding to the micro control unit;
correspondingly, the establishing of the communication connection with the auxiliary test unit based on the communication service comprises:
creating a second communication process based on the communication service, and binding the local port in the second communication process;
and establishing a communication connection with the auxiliary test unit based on the second communication process and a third communication process which is created by the auxiliary test unit and is bound with the external port.
According to the function test method of the micro control unit provided by the invention, the auxiliary test unit is a third-party device or a pipeline service module of the micro control unit in the system-on-chip.
According to the function test method of the micro-control unit, the micro-control unit belongs to one of an intelligent driving domain, a vehicle body control domain and a cockpit domain.
The method for testing the function of the micro control unit further comprises the following steps:
recording the generated logs in real time; and/or the presence of a gas in the gas,
and recording the execution result.
The invention also provides a device for testing the function of the micro control unit, which comprises:
the communication module is used for establishing communication connection with the micro control unit based on communication service between the communication module and the auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit and calling a function module script corresponding to the function to be tested;
the test module is used for sending test data to the micro control unit based on the function module script so that the micro control unit executes the function to be tested based on the test data;
the receiving module is used for receiving the execution result fed back by the micro control unit;
the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the program, the functional test method of the micro control unit is realized.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of functional testing of a microcontrol unit as in any one of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a method of testing the functionality of a microcontrol unit as claimed in any one of the above.
The method and the device for testing the function of the micro control unit have no dependence on the SOC function, can expose the problem generated by the MCU function in time, greatly reduce the problem analysis cost and have stronger practicability. Moreover, the method does not need manual verification, and has high testing efficiency and low testing cost. In addition, the method is a function test realized on the premise of the known function to be tested, and is a white box test, so that the test coverage of the MCU function is higher.
Drawings
In order to more clearly illustrate the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic flow chart of a method for testing the function of a MCU according to the present invention;
FIG. 2 is a second schematic flow chart of the method for testing the function of the MCU according to the present invention;
FIG. 3 is a schematic structural diagram of a functional test apparatus for a MCU according to the present invention;
FIG. 4 is a second schematic structural diagram of the functional testing apparatus of micro control unit provided in the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, 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.
Because the MCU function testing method in the prior art has a high degree of dependence on the SOC function, and usually is a black box test, and needs to be verified manually, there are disadvantages of low testing efficiency, high testing cost, low testing coverage of the MCU function (i.e. the case where boundary values, abnormal scenes, etc. cannot be verified), delayed problem exposure, high problem analysis cost (the analysis sequence is usually an application development stage, an SOC function development stage, and an MCU function development stage, i.e. it is necessary to analyze whether the MCU function is generated at last), and the like. Therefore, the embodiment of the invention provides a method for testing the functions of the micro control unit, which can be used for testing the functions of the micro control unit matched with the SOC function in the application process.
Fig. 1 is a schematic flowchart of a MCU function testing method provided in an embodiment of the present invention, and as shown in fig. 1, the method includes:
s1, establishing communication connection with a micro control unit based on communication service with an auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested;
s2, sending test data to the micro control unit based on the function module script so that the micro control unit executes the function to be tested based on the test data;
s3, receiving an execution result fed back by the micro control unit;
the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
Specifically, in the MCU function testing method provided in the embodiment of the present invention, the main execution body is an MCU function testing device, the device may be configured in a computer, and the local computer may be a local computer or a cloud computer, and the local computer may be a computer, a tablet, or the like, which is not specifically limited in the embodiment of the present invention.
The MCU function test device can establish communication service with an auxiliary test unit, and the auxiliary test unit can be a pipeline service module of an MCU in an SOC, that is, an MCUPIPE service module, or a third-party device, which is not specifically limited in the embodiments of the present invention.
The auxiliary test unit is used as an information transmission medium between the MCU function test device and the MCU, and the information transmission between the MCU function test device and the MCU can be realized through the auxiliary test unit. The communication service may be established through an adb command.
Firstly, step S1 is executed, and communication connection between the MCU function testing device and the MCU is established based on communication service between the MCU function testing device and the auxiliary testing unit. The auxiliary test unit is in communication connection with the MCU function test device and the MCU, so that the MCU function test device and the MCU are also in communication connection.
It should be noted that the communication protocol between the auxiliary test unit and the MCU is the same as the communication protocol between the MCU and the SOC, and is a target communication protocol. Therefore, the communication function test between the MCU and the SOC can be realized while the MCU function test is realized, so that the MCU qualified through the MCU function test method can meet the actual requirement and can be matched with the SOC.
The target communication protocol may be one of a Universal Asynchronous Receiver/Transmitter (UART) communication protocol, a Serial Peripheral Interface (SPI) communication protocol, an Inter-Integrated Circuit (IIC) communication protocol, and a Controller Area Network (CAN) communication protocol.
And then, executing the test case script corresponding to the to-be-tested function of the micro control unit. The function to be tested refers to a function which needs to be tested whether the micro control unit is normal or not, and may include, for example, a volume adjusting function, a sound effect adjusting function, a sound adjusting function and the like of a sound module, a vehicle body control function, a vehicle control function and the like of a vehicle body vehicle control module, a power management function of a power management module, a GPIO signal detection function of a GPIO signal detection module, a DSP control function of a DSP control module and the like.
Each function to be tested of the MCU is provided with a corresponding test case script which is compiled by research personnel in advance and used for executing the test of the function to be tested. For example, if the function to be tested is a volume adjustment function and the corresponding function module is a sound module, the test case script is used to verify the volume adjustment function of the sound module of the MCU, and verify an effective channel value, an invalid channel, an invalid volume, an effective volume, or an abnormal scene, such as volume adjustment in a silent mode, respectively.
And when the test case script is executed, calling the function module script corresponding to the function to be tested through the test case script. The function module script is a script corresponding to each function module of the micro control unit, is also written by research and development personnel in advance, and is used for executing and realizing the control of the function module of the micro control unit.
For example, if the function to be tested is a volume adjustment function, the corresponding function module is a sound module, and the corresponding function module script is a sound module script (e.g., audio. For another example, if the function to be tested is a vehicle body control function, the corresponding function module is a vehicle body vehicle control module, and the corresponding function module script is a vehicle body vehicle control module script.
And then step S2 is executed, test data can be sent to the micro control unit through the functional module script, and the micro control unit executes the function to be tested according to the test data after receiving the test data. It can be understood that the test data is related data for performing a functional test included in the test case script, and may be a value of a functional parameter in the functional information of the function to be tested in the target communication protocol. For example, if the function to be tested is a volume adjustment function, the test data may include a value of a sound channel (channel), a value of a volume (volume), and the like.
And finally, executing a step S3, namely receiving an execution result corresponding to the function to be tested fed back by the micro control unit, wherein the execution result is a test result of the function to be tested.
The method for testing the functions of the micro control unit comprises the steps of firstly establishing communication connection with the micro control unit based on communication service between the micro control unit and an auxiliary test unit, and executing a test case script corresponding to a function to be tested of the micro control unit; then based on the test case script, calling a function module script corresponding to the function to be tested, and based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data; and finally, receiving an execution result fed back by the micro control unit, realizing the acquisition of a test result and finishing the test. The method has no dependence on SOC function, can expose the problem generated by MCU function in time, greatly reduces the problem analysis cost and has stronger practicability. Moreover, the method does not need manual verification, and is high in testing efficiency and low in testing cost. In addition, the method is a function test realized on the premise of the known function to be tested, and is a white box test, so that the test coverage of the MCU function is higher.
On the basis of the foregoing embodiment, in the MCU function test method provided in the embodiment of the present invention, the function module script includes an interface function of a function module corresponding to the function to be tested, and the interface function is obtained by mapping function information of the function to be tested in the target communication protocol.
Specifically, in the embodiment of the present invention, the function module script may be an interface function of a function module corresponding to the function to be tested, and the interface function may be obtained by mapping function information of the function to be tested in the target communication protocol. The function information may include a function module ID, a function ID to be tested, and a function parameter of the function to be tested, etc. For example, the function to be tested is a volume adjustment function, the corresponding function module is a sound module, and the function information of the function to be tested in the target communication protocol may include that the function module ID is 1, the function ID to be tested is 2, the function parameter 1 is a sound channel (channel), and the function parameter 2 is a volume (volume).
Further, the obtained interface function may be setVolume (channel, volume).
It can be understood that, the MCU function test device can use the interface function to implement that the function information is sent to the communication service according to the mapping table of the target communication protocol, and the communication service sends the function information to the MCU through the auxiliary test unit.
In the embodiment of the invention, the functional module script is obtained in a target communication protocol mapping mode, so that the function test result of the MCU can conform to the actual application scene of the MCU, and the control process of the functional module of the MCU can be simplified.
On the basis of the foregoing embodiment, the MCU function test method provided in the embodiment of the present invention, where the establishing of the communication connection with the MCU based on the communication service with the auxiliary test unit includes:
establishing a communication connection with the auxiliary test unit based on the communication service;
and establishing communication connection between the auxiliary test unit and the micro control unit based on a first communication process, wherein the communication protocol of the first communication process is the target communication protocol.
Specifically, in the embodiment of the present invention, when the MCU function test apparatus establishes a communication connection between itself and the MCU through a communication service between itself and the auxiliary test unit, the communication connection between itself and the auxiliary test unit may be established through a communication service between itself and the auxiliary test unit. And because the auxiliary test unit and the MCU establish communication connection based on the first communication process, the MCU function test device can automatically realize communication connection between the MCU and the auxiliary test unit. The auxiliary test unit can establish a first communication process, and then establishes communication connection with the MCU through the first communication process.
The communication protocol of the first communication process is a target communication protocol, and taking the target communication protocol as the UART communication protocol as an example, the first communication process is a UART process.
In the embodiment of the invention, the communication connection with the auxiliary test unit can be quickly established by means of the communication connection established between the auxiliary test unit and the micro control unit based on the first communication process, so that the function test efficiency of the MCU is improved.
On the basis of the above embodiment, in the MCU function test method provided in the embodiments of the present invention, the communication service is configured to direct a local port to an external port corresponding to the micro control unit; correspondingly, the establishing of the communication connection with the auxiliary test unit based on the communication service comprises the following steps:
creating a second communication process based on the communication service, and binding the local port in the second communication process;
and establishing a communication connection with the auxiliary test unit based on the second communication process and a third communication process which is created by the auxiliary test unit and is bound with the external port.
Specifically, the communication service in the embodiment of the present invention may be configured to direct a local port to an external port corresponding to the MCU, where the local port may be a communication port of a hardware device carrying the MCU function test apparatus, the hardware device may be a computer, and the communication port of the hardware device may be 6100. The external port corresponding to the MCU may be an external communication port in the MCU home region, and if the MCU home region is a cockpit domain, the external port corresponding to the MCU may be 7100.
When the communication service is established through the adb command, the communication service establishment command may be expressed as: adb forward tcp:6100 tcp. When the auxiliary test unit is an MCUPIPE service unit in the SOC of the cabin domain, the MCUPIPE service unit may be started through the adb command, and the MCUPIPE service unit start command may be represented as: adb shell mcupipe.
Accordingly, when the MCU function test apparatus establishes a communication connection with the auxiliary test unit according to the communication service, a second communication process may be created through the communication service, and a local port may be bound in the second communication process.
Thereafter, a communication connection with the auxiliary test unit can be established according to the second communication process and a third communication process which is created by the auxiliary test unit and is bound with the external port. Namely, after the local port is bound in the second communication process, the first data sending operation and the first data receiving operation of the MCU function testing device side between the MCU function testing device and the auxiliary testing unit can be realized. The first data transmission operation may include: the communication service analyzes the test data, encapsulates the analysis result according to a target communication protocol, and then sends the encapsulation result to the auxiliary test unit through a second communication process; the first data receiving operation may include: the communication service analyzes the data from the auxiliary test unit according to a target communication protocol, feeds an analysis result back to the MCU function test device, and displays the result through hardware equipment bearing the MCU function test device.
The auxiliary test unit may create a third communication process and bind the external port in the third communication process. After the external port is bound in the third communication process, the second data transmission operation and the second data receiving operation of the auxiliary test unit side between the MCU function test device and the auxiliary test unit can be realized. The second data transmission operation may include: receiving data sent by the MCU through a target communication protocol, packaging according to the requirement of a communication protocol corresponding to a third communication process, and sending a packaging result to the communication service of the MCU function testing device through the communication protocol corresponding to the third communication process; the second data receiving operation may include: and analyzing the data sent by the MCU function testing device, sending the data to the MCU through a target communication protocol, finishing function response by the MCU, and feeding back an execution result.
Here, the second communication process and the third communication process may be the same, and both may be socket processes.
In the embodiment of the invention, the communication connection between the MCU function test device and the auxiliary test unit is established by establishing the communication process and binding the port in the communication process, so that the establishment process of the communication connection is ensured to be quicker.
On the basis of the above embodiment, in the MCU function test method provided in the embodiment of the present invention, the MCU may belong to any one of the intelligent driving domain, the vehicle body control domain, and the cockpit domain, that is, whichever MCU in the intelligent driving domain, the vehicle body control domain, and the cockpit domain may be used to perform the function test on the MCU by using the MCU function test method provided in the embodiment of the present invention.
On the basis of the above embodiment, the MCU function test method provided in the embodiment of the present invention further includes:
recording the generated logs in real time; and/or the presence of a gas in the gas,
and recording the execution result.
Specifically, in the embodiment of the present invention, during the process of executing steps S1 to S3, automatically generated logs may be recorded in real time for troubleshooting, execution result analysis, and the like of the MCU function test device. The log content may include time, tag (Tag), etc., and the log type may include error, info, debug, etc.
Besides, the execution result can be recorded, so that the statistics and detailed recording of the execution result can be realized. Here, the log and the execution result may be recorded in different locations, which may facilitate a user to timely and quickly view the log and/or the execution result generated during the testing process.
On the basis of the above embodiment, the MCU function test method provided in the embodiment of the present invention further includes:
recording the equipment information and the function to be tested of the MCU home region, and controlling the equipment corresponding to the equipment information.
Specifically, in the embodiment of the present invention, before performing steps S1 to S3, the device information and the function to be tested in the MCU home area may be recorded, and the device corresponding to the device information is controlled to switch, so as to control the execution progress of the test process. Here, the device information may be related information of the device involved in testing the function under test, such as a device ID, device performance parameters, and the like.
In the embodiment of the invention, the equipment is controlled in a unified way, so that the test progress can be accurately grasped, and the influence on the execution result due to the control difference of the equipment is avoided.
Fig. 2 is a schematic diagram of a complete flow of the MCU function test method provided in the embodiment of the present invention, and as shown in fig. 2, the method includes:
starting a test case script;
establishing communication connection between the MCU function testing device and the MCU;
executing a test case script corresponding to a to-be-tested function of the MCU, and calling a function module script corresponding to the to-be-tested function;
the MCU executes a function to be tested;
the MCU feeds back an execution result to the MCU function testing device;
and the MCU function testing device records the execution result.
In summary, the method for testing the functions of the micro control unit provided in the embodiment of the present invention utilizes the thinking of white box testing, analyzes the functional requirements of the MCU, realizes the dependency on the MCU, combines the system architecture design of the MCU attributive region, designs the test case with pertinence, and uses the auxiliary test unit to replace the application layer APP to verify the functions of the MCU. Moreover, the test case script has high reusability under the condition that the system architecture design of the MCU attributive area does not change fundamentally. The testing method can fully verify the functions, boundary values, abnormal scenes and the like of the MCU, the MCU function test is independent, the white box test verification of the MCU function is realized, and the quality improvement is obviously improved.
As shown in fig. 3, on the basis of the above embodiment, an embodiment of the present invention provides a micro control unit function testing apparatus, including:
the communication module 31 is used for establishing communication connection with the micro control unit based on communication service with the auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested;
a test module 32, configured to send test data to the micro control unit based on the function module script, so that the micro control unit executes the function to be tested based on the test data;
a receiving module 33, configured to receive an execution result fed back by the micro control unit;
the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
As shown in fig. 4, the functional test apparatus for a micro control unit provided in the embodiment of the present invention may further include a test case module, an equipment management module, a test report module, a log management module, and a communication service module in a detailed manner according to functions.
The test case module is used for storing a test case script;
the device management module is used for recording the device information and the functions to be tested of the MCU attribution area and controlling the devices corresponding to the device information;
the test report module is used for recording an execution result;
the log management module is used for recording the generated logs in real time;
the communication service module is used for establishing communication service with the auxiliary test unit and establishing communication connection with the MCU based on the communication service.
In fig. 4, taking the example that the auxiliary testing unit is the MCUPIPE service module, the MCUPIPE service module establishes a communication connection with a communication module in the MCU through the UART communication process, and the MCUPIPE service module establishes a communication connection with the MCU function testing apparatus through the SOCKET communication process. Meanwhile, the MCUPIPE service module also has a data analysis function.
In fig. 4, besides the communication module, the functional modules in the MCU further include a power management module, a sound module, a vehicle body control module, and a GPIO signal detection module, and the functions corresponding to the modules can be used as the functions to be tested.
Specifically, the functions of the modules in the micro control unit function testing apparatus provided in the embodiment of the present invention correspond to the operation flows of the steps in the embodiments of the methods one to one, and the implementation effects are also consistent.
Fig. 5 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 5: a Processor (Processor) 510, a communication Interface (Communications Interface) 520, a Memory (Memory) 530 and a communication bus 540, wherein the Processor 510, the communication Interface 520 and the Memory 530 communicate with each other via the communication bus 540. Processor 510 may call logic instructions in memory 530 to perform the microcontrol unit function test method provided in the various embodiments described above, the method including: establishing communication connection with a micro control unit based on communication service with an auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested; based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data; receiving an execution result fed back by the micro control unit; the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
In addition, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing the method for testing the function of the mcu provided in the above methods, the method comprising: establishing communication connection with a micro control unit based on communication service with an auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested; based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data; receiving an execution result fed back by the micro control unit; the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for testing the functionality of a micro-control unit provided by the above methods, the method comprising: establishing communication connection with a micro control unit based on communication service with an auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested; based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data; receiving an execution result fed back by the micro control unit; the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system-on-chip.
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. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
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; 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 such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A method for testing the function of a micro control unit is characterized by comprising the following steps:
establishing communication connection with a micro control unit based on communication service with an auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit, and calling a function module script corresponding to the function to be tested; the function module script is a script corresponding to each function module of the micro control unit and is used for executing and realizing the control of the function module of the micro control unit;
based on the function module script, sending test data to the micro control unit so that the micro control unit executes the function to be tested based on the test data;
receiving an execution result fed back by the micro control unit;
the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system level chip;
the establishing of the communication connection with the micro control unit based on the communication service with the auxiliary test unit comprises the following steps:
establishing a communication connection with the auxiliary test unit based on the communication service;
the auxiliary test unit and the micro control unit establish communication connection based on a first communication process, wherein a communication protocol of the first communication process is the target communication protocol;
the communication service is used for orienting a local port to an external port corresponding to the micro control unit; correspondingly, the establishing of the communication connection with the auxiliary test unit based on the communication service comprises:
creating a second communication process based on the communication service, and binding the local port in the second communication process;
and establishing a communication connection with the auxiliary test unit based on the second communication process and a third communication process which is created by the auxiliary test unit and is bound with the external port.
2. The method for testing the functions of the mcu as claimed in claim 1, wherein the functional module script comprises an interface function of the functional module corresponding to the function to be tested, and the interface function is mapped based on the functional information of the function to be tested in the target communication protocol.
3. The mcu function test method of any one of claims 1-2, wherein the auxiliary test unit is a third party device or a pipeline service module of the mcu in the system-on-a-chip.
4. The method for testing the function of a microcontrol unit according to any one of claims 1-2, wherein the microcontrol unit belongs to one of an intelligent driving domain, a vehicle body control domain and a cockpit domain.
5. The mcu functionality test method of any one of claims 1-2, further comprising:
recording the generated logs in real time; and/or the presence of a gas in the gas,
and recording the execution result.
6. A microcontrol unit functionality test apparatus, comprising:
the communication module is used for establishing communication connection with the micro control unit based on communication service between the communication module and the auxiliary test unit, executing a test case script corresponding to a function to be tested of the micro control unit and calling a function module script corresponding to the function to be tested; the function module script is a script corresponding to each function module of the micro control unit and is used for executing and realizing the control of the function module of the micro control unit;
the test module is used for sending test data to the micro control unit based on the function module script so that the micro control unit executes the function to be tested based on the test data;
the receiving module is used for receiving the execution result fed back by the micro control unit;
the communication protocol between the auxiliary test unit and the micro control unit is a target communication protocol between the micro control unit and a system level chip;
the communication module is specifically configured to:
establishing a communication connection with the auxiliary test unit based on the communication service;
the auxiliary test unit and the micro control unit establish communication connection based on a first communication process, wherein a communication protocol of the first communication process is the target communication protocol;
the communication service is used for orienting a local port to an external port corresponding to the micro control unit; correspondingly, the communication module is further specifically configured to:
creating a second communication process based on the communication service, and binding the local port in the second communication process;
and establishing a communication connection with the auxiliary test unit based on the second communication process and a third communication process which is created by the auxiliary test unit and is bound with the external port.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method for testing the functionality of a microcontrol unit according to any of claims 1-5 when executing the program.
8. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the micro-control unit functional test method according to any one of claims 1-5.
CN202211395584.8A 2022-11-09 2022-11-09 Method and device for testing functions of micro-control unit Active CN115562250B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211395584.8A CN115562250B (en) 2022-11-09 2022-11-09 Method and device for testing functions of micro-control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211395584.8A CN115562250B (en) 2022-11-09 2022-11-09 Method and device for testing functions of micro-control unit

Publications (2)

Publication Number Publication Date
CN115562250A CN115562250A (en) 2023-01-03
CN115562250B true CN115562250B (en) 2023-04-07

Family

ID=84767755

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211395584.8A Active CN115562250B (en) 2022-11-09 2022-11-09 Method and device for testing functions of micro-control unit

Country Status (1)

Country Link
CN (1) CN115562250B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645811B (en) * 2009-09-02 2012-07-04 中兴通讯股份有限公司 Device and method for automatically testing embedded system
US9170921B2 (en) * 2014-01-24 2015-10-27 Bank Of America Corporation Application testing automation
US9772934B2 (en) * 2015-09-14 2017-09-26 Palantir Technologies Inc. Pluggable fault detection tests for data pipelines
CN114878186A (en) * 2022-04-28 2022-08-09 东风汽车集团股份有限公司 Automatic testing device and method for vehicle-mounted equipment
CN115079675A (en) * 2022-07-18 2022-09-20 浙江吉利控股集团有限公司 ECU testing device, testing method and testing system

Also Published As

Publication number Publication date
CN115562250A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
US20170046884A1 (en) Personal vehicle diagnosis system and method based on mobile intelligent terminal
CN111341296B (en) Voice control response test method, tester and storage medium
EP3141974A1 (en) Personal vehicle diagnosis system and method based on mobile intelligent terminal
CN109740222B (en) Testing device and system for automobile networking scene
US11845451B2 (en) Automobile diagnostic method, apparatus, device and system, and diagnostic connection device
CN110278543B (en) Method and device for updating control system of automobile and storage medium
CN104483959A (en) Fault simulation and test system
CN113377088A (en) Instant communication automobile remote diagnosis and detection method, electronic equipment and storage medium
CN110979208A (en) Vehicle-mounted intelligent information terminal
US20200388089A1 (en) Title method, apparatus and system for processing vehicle diagnosis case and diagnosis device
CN110347539B (en) Test method, device, system, computing device and medium applied to server
CN115629599B (en) CAN bus simulation test method and system
JP2017524949A (en) Car diagnostic method by voice from smartphone
CN114996168A (en) Multi-device cooperative test method, test device and readable storage medium
CN114745312B (en) Vehicle-mounted Ethernet test system and method
CN110806922B (en) Script execution method, device, equipment and storage medium
CN115562250B (en) Method and device for testing functions of micro-control unit
CN105946747B (en) Control method and vehicle mainboard in vehicle
CN112214228A (en) Vehicle-mounted instrument upgrading method, device and system
CN110336712B (en) Method and device for capturing empty packet by mobile terminal, storage medium and mobile terminal
CN111263100A (en) Video call method, device, equipment and storage medium
CN115951596A (en) Real vehicle signal simulation method and vehicle signal interaction system
CN112788640B (en) Communication equipment testing method and device, storage medium and terminal
US20190155710A1 (en) Method and server for testing a system network
CN113542372A (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant