CN115562250A - 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
CN115562250A
CN115562250A CN202211395584.8A CN202211395584A CN115562250A CN 115562250 A CN115562250 A CN 115562250A CN 202211395584 A CN202211395584 A CN 202211395584A CN 115562250 A CN115562250 A CN 115562250A
Authority
CN
China
Prior art keywords
function
control unit
micro control
test
communication
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.)
Granted
Application number
CN202211395584.8A
Other languages
Chinese (zh)
Other versions
CN115562250B (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)
  • Maintenance And Management Of Digital Transmission (AREA)
  • Test And Diagnosis Of Digital Computers (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 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.

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). The MCU mainly realizes the functions of power management, general-purpose input/output (GPIO) Signal detection, vehicle control vehicle equipment control and Digital Signal Processing (DSP) control of a cabin domain, and the vehicle control vehicle equipment control can comprise air conditioner regulation, seat regulation, window control and the like. 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 between the MCU and the SOC, for example, the SOC needs to transmit signals to the MCU for setting on the liquid crystal instrument, 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;
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;
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 communication connection with the micro control unit is established based on the communication service between the micro control unit and the auxiliary test unit, and the method 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 provided by the invention, 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 function testing device 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 is high in testing efficiency and low in testing cost. In addition, the method is a function test realized on the premise of knowing the 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 needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow chart of a method for testing the function of a micro control unit 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 obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to 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 flow chart 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, 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;
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 the MCU in the SOC, i.e., 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 via 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 executing step S2, sending test data to the micro control unit through the function module script, and executing the function to be tested according to the test data after the micro control unit receives the test data. It can be understood that the test data is related data for performing a function test included in the test case script, and may be a value of a function parameter in the function 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 the step S3, and receiving an execution result corresponding to the function to be tested, which is 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 completing 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 above embodiment, in the MCU function test method provided in this 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 mapped based on the 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 issue the function information 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 the communication service between itself and the auxiliary test unit, the MCU function test apparatus may establish a communication connection with the auxiliary test unit through the 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 create 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.
And then, the 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 adopt the MCU function test method provided in the embodiment of the present invention to perform the function test on the MCU.
On the basis of the foregoing 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 atmosphere,
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 test.
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 executing steps S1 to S3, the device information and the function to be tested in the area to which the MCU belongs may be recorded, and the device corresponding to the device information may be 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 manner, 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 function of the micro control unit provided in the embodiment of the present invention utilizes the thought of white box testing, by analyzing the function requirement of the MCU and realizing the dependency on the MCU, and combining the system architecture design of the MCU home area, a test case is designed in a targeted manner, and the auxiliary test unit replaces the application layer APP to verify the function of the MCU. Moreover, the test case script has high reusability under the condition that the system architecture design of the MCU attributive region 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 between the auxiliary test unit and the communication module, 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 microcontrol unit function testing apparatus 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, the functional modules in the MCU include a power management module, a sound module, a car body control module, a GPIO signal detection module, and the like, in addition to the communication module, and the functions corresponding to the modules can be tested as 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.
Furthermore, 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 software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) 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 stored 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. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various 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 (10)

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;
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.
2. The mcu function test method of claim 1, wherein the function module script comprises an interface function of a function module corresponding to the function to be tested, and the interface function is mapped based on the function information of the function to be tested in the target communication protocol.
3. The mcu functional test method of claim 1, wherein the establishing of the communication connection with the mcu based on the communication service with the auxiliary test unit comprises:
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.
4. The mcu functional test method of claim 3, wherein the communication service is configured to direct a local port to a corresponding external port of the mcu; 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.
5. The MCU functional test method of any one of claims 1-4, wherein the auxiliary test unit is a third party device or a pipeline service module of the MCU in the SOC.
6. The method for testing the functionality of a microcontrol unit according to any one of claims 1 to 4, wherein the microcontrol unit belongs to one of a smart driving domain, a vehicle body control domain and a cockpit domain.
7. The micro-control unit functional test method of any of claims 1-4, further comprising:
recording the generated logs in real time; and/or the presence of a gas in the gas,
and recording the execution result.
8. 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 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.
9. 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-7 when executing the program.
10. 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-7.
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 true CN115562250A (en) 2023-01-03
CN115562250B 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)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645811A (en) * 2009-09-02 2010-02-10 中兴通讯股份有限公司 Device and method for automatically testing embedded system
US20150212927A1 (en) * 2014-01-24 2015-07-30 Bank Of America Corporation Application Testing Automation
US20170220403A1 (en) * 2015-09-14 2017-08-03 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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101645811A (en) * 2009-09-02 2010-02-10 中兴通讯股份有限公司 Device and method for automatically testing embedded system
US20150212927A1 (en) * 2014-01-24 2015-07-30 Bank Of America Corporation Application Testing Automation
US20170220403A1 (en) * 2015-09-14 2017-08-03 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
CN115562250B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
EP3141974A1 (en) Personal vehicle diagnosis system and method based on mobile intelligent terminal
CN111341296B (en) Voice control response test method, tester and storage medium
CN110278543B (en) Method and device for updating control system of automobile and storage medium
CN105922872B (en) Vehicle control system and vehicle
CN104483959A (en) Fault simulation and test system
CN111506047B (en) Vehicle diagnosis method, device and storage medium
CN110347539B (en) Test method, device, system, computing device and medium applied to server
CN111552274A (en) Automobile diagnosis method, device, equipment, system and diagnosis connecting equipment
CN113377088A (en) Instant communication automobile remote diagnosis and detection method, electronic equipment and storage medium
US20200388089A1 (en) Title method, apparatus and system for processing vehicle diagnosis case and diagnosis device
CN110418358A (en) The bluetooth test method and device of circuit board
WO2016008077A1 (en) Method and apparatus for interconnecting intelligent terminal and vehicle terminal
CN112740627A (en) Vehicle remote diagnosis method and system
CN110806922B (en) Script execution method, device, equipment and storage medium
CN114996168A (en) Multi-device cooperative test method, test device and readable storage medium
CN107181825B (en) Online processing method of terminal equipment data
US20140130063A1 (en) Systems and methods for low overhead remote procedure calls
CN115562250B (en) Method and device for testing functions of micro-control unit
CN105946747B (en) Control method and vehicle mainboard in vehicle
WO2024066512A1 (en) Vehicle-mounted network communication event filtering method and apparatus, and device and medium
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
CN107645430B (en) Data processing method, system and related equipment
CN206658216U (en) A kind of debugging apparatus of vehicle-mounted information service system
CN112788640B (en) Communication equipment testing method and device, storage medium and terminal

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