Test method and device, storage medium and program product
By canceling the application's read and write permissions to the cache area and comparing the data information before and after sleep, the problem of poor accuracy and reliability of the controller's non-volatile memory area test is solved, and the accuracy and reliability of the test are improved.
Patent Information
- Application Number
- CN202411071399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-20
AI Technical Summary
In the prior art, the target variables to be stored in nonvolatile storage before sleeping of the controller are inaccurately acquired, resulting in low accuracy and poor reliability of nonvolatile storage abnormal judgment.
By sending instructions to the read and write controller, canceling the application's read and write permissions to the cache area, sending a sleep instruction to the controller to be tested, writing data information to the non-volatile memory area and the test memory area, and comparing the data after wake-up Information to determine the test results of nonvolatile storage areas.
Improve the testing accuracy and reliability of the controller's non-volatile memory area, and avoid the problem of inconsistency in memory area information caused by application data modification.
Smart Images

Figure CN119170082A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile technology, in particular to the field of automobile controller testing technology, and specifically to a testing method, device, storage medium and program product. Background Art
[0002] With the continuous development of the automotive industry, new energy, intelligent driving, and unmanned driving have become the main development directions of today's automobiles. As a result, the corresponding controllers (electronic control units, ECUs) and software functions are becoming increasingly complex. The use of non-volatile memory (NVM) in controllers is also becoming more and more frequent. Therefore, it is necessary to test the non-volatile storage in the controller to determine the reliability of the non-volatile storage.
[0003] At present, it is possible to obtain the target variables to be stored in the non-volatile storage before the controller goes into sleep mode, and to obtain the target variables stored in the non-volatile storage after the controller wakes up; by comparing the target variables to be stored in the non-volatile storage before sleep mode with the target variables stored in the non-volatile storage after wakeup, it is determined whether there is an abnormality in the non-volatile storage.
[0004] However, in the related art, there is a problem that the target variables to be stored in the non-volatile storage before the controller goes into sleep mode may not be accurately obtained, resulting in an inability to accurately determine whether there is an abnormality in the non-volatile storage, and there are problems of low test accuracy and poor reliability of test results. Summary of the invention
[0005] According to the first aspect provided by the present application, a test method, device, storage medium and program product are provided to at least solve the technical problems of low test accuracy and poor reliability of test results in the related art. The technical solution of the present application includes: sending a first instruction to a read-write controller; the read-write controller is used to control the read and write permissions of the application program to the cache area of the controller to be tested; the first instruction is used to indicate the cancellation of the read and write permissions of the application program to the cache area; sending a sleep instruction to the controller to be tested, and writing the data information in the cache area to the non-volatile storage area and the test storage area; sending a wake-up instruction to the controller to be tested, and reading the data information in the non-volatile storage area and the data information in the test storage area; comparing the data information in the non-volatile storage area with the data information in the test storage area to obtain the test result of the non-volatile storage area, and the test result is used to indicate whether there is an abnormality in the non-volatile storage area.
[0006] In a possible implementation, the data information in the non-volatile storage area is compared with the data information in the test storage area to obtain a test result of the non-volatile storage area, including: when the data information in the non-volatile storage area and the data information in the test storage area are the same, determining the test result to be a first test result, and the first test result is used to indicate that there is no abnormality in the non-volatile storage area; when the data information in the non-volatile storage area and the data information in the test storage area are different, determining the test result to be a second test result, and the second test result is used to indicate that there is an abnormality in the non-volatile storage area.
[0007] In one possible implementation, the data information includes a data name and a data value corresponding to the data name; the method also includes: obtaining the data name corresponding to the controller to be tested; writing the data information in the cache area into a non-volatile storage area and a test storage area, including: reading the data value corresponding to the data name in the cache area based on the data name; writing the data name and the data value into the non-volatile storage area and the test storage area.
[0008] In a possible implementation, reading the data information in the nonvolatile storage area and the data information in the test storage area includes: reading the data value in the nonvolatile storage area and the data value in the test storage area based on the data name corresponding to the controller to be tested.
[0009] In one possible implementation, the application corresponds to multiple data; the data information in the non-volatile storage area is compared with the data information in the test storage area to obtain a test result of the non-volatile storage area, including: for each of the data, the data information of the target data in the non-volatile storage area is compared with the data information of the target data in the test storage area to obtain a target test result of the non-volatile storage area, the target data is one of the multiple data, and the target test result is used to indicate whether the non-volatile storage area can correctly store the data information of the target data; when the target test result of each of the data is used to indicate that the non-volatile storage area can correctly store the data information of the target data, the test result is determined to be a third test result, and the third test result is used to indicate that the non-volatile storage area can correctly store the data information of each of the data.
[0010] In a possible implementation, the method further includes: sending a second instruction to the read-write controller, where the second instruction is used to control the read-write controller to grant the application program read-write permissions.
[0011] According to a second aspect provided by the present application, a testing device is provided, including: a sending module, a testing module and a processing module; the sending module is used to send a first instruction to a read-write controller; the read-write controller is used to control the read and write permissions of an application program to a cache area of a controller to be tested; the first instruction is used to indicate the cancellation of the read and write permissions of the application program to the cache area; the sending module is also used to send a sleep instruction to the controller to be tested; the processing module is used to write data information in the cache area to a non-volatile storage area and a test storage area; the sending module is also used to send a wake-up instruction to the controller to be tested; the processing module is also used to read data information in the non-volatile storage area and data information in the test storage area; the testing module is used to compare the data information in the non-volatile storage area with the data information in the test storage area to obtain a test result of the non-volatile storage area, and the test result is used to indicate whether there is an abnormality in the non-volatile storage area.
[0012] In a possible implementation, the testing device further includes a determination module; the determination module is used to, when the data information in the non-volatile storage area is the same as the data information in the test storage area, determine that the test result is a first test result, and the first test result is used to indicate that there is no abnormality in the non-volatile storage area; the determination module is also used to, when the data information in the non-volatile storage area is different from the data information in the test storage area, determine that the test result is a second test result, and the second test result is used to indicate that there is an abnormality in the non-volatile storage area.
[0013] In one possible implementation, the data information includes a data name and a data value corresponding to the data name; the testing device also includes an acquisition module; the acquisition module is used to obtain the data name corresponding to the controller to be tested; the processing module is specifically used to read the data value corresponding to the data name in the cache area based on the data name; the processing module is also specifically used to write the data name and the data value into the non-volatile storage area and the test storage area.
[0014] In a possible implementation manner, the processing module is specifically configured to read the data value in the non-volatile storage area and the data value in the test storage area based on the data name corresponding to the controller to be tested.
[0015] In one possible implementation, the application corresponds to multiple data; the testing device also includes a determination module; the testing module is specifically used to compare, for each of the data, the data information of the target data in the non-volatile storage area and the data information of the target data in the test storage area to obtain a target test result of the non-volatile storage area, the target data being one of the multiple data, and the target test result being used to indicate whether the non-volatile storage area can correctly store the data information of the target data; the determination module is used to determine that the test result is a third test result when the target test result of each of the data is used to indicate that the non-volatile storage area can correctly store the data information of the target data, and the third test result is used to indicate that the non-volatile storage area can correctly store the data information of each of the data.
[0016] In a possible implementation manner, the sending module is further used to send a second instruction to the read-write controller, where the second instruction is used to control the read-write controller to grant the application program read-write permission.
[0017] According to a third aspect provided by the present application, a testing device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute instructions to implement the method of the above-mentioned first aspect and any possible implementation manner thereof.
[0018] According to the fourth aspect provided by the present application, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor of the testing device, the testing device is enabled to execute the method in the above-mentioned first aspect and any possible implementation manner thereof.
[0019] According to a fifth aspect provided by the present application, a computer program product is provided, the computer program product comprising computer instructions, and when the computer instructions are executed on a test device, the test device executes the method of the first aspect and any possible implementation manner thereof.
[0020] Therefore, the above technical features of the present application have the following beneficial effects:
[0021] (1) In the case where the read and write permissions of the application program for mixed access are not cancelled, there may be a time difference in the process of the test device writing the data information in the cache area into the non-volatile storage area and the test storage area. During the time difference, the application program may modify the data information in the cache area. At this time, regardless of whether the non-volatile storage area is working normally, the data information stored in the non-volatile storage area and the data information in the test storage area are different. Therefore, there is a problem that it is impossible to detect whether the non-volatile storage area is working normally due to the modification of the data in the cache area by the application program. Based on this, the above-mentioned sending of the first instruction to the read-write controller can cancel the read and write permissions of the application program for the cache area, so that in the process of detecting the controller to be tested, there will be no problem that the data information in the non-volatile storage area and the test storage area are different due to the modification of the data in the cache area by the application program. Afterwards, a sleep instruction is sent to the controller to be tested, and the data information in the cache area is written into the non-volatile storage area and the test storage area. In addition, the data information in the non-volatile storage area and the data information in the test storage area are compared to obtain the test result of the non-volatile storage area. By comparing the data information in the non-volatile storage area with the data information in the test storage area, it is determined whether the data information in the non-volatile storage area is consistent with the data information in the test storage area, and it is possible to determine whether the non-volatile storage area stores the data information in the cache area completely and accurately. In this way, the accuracy and reliability of the non-volatile storage area test of the controller are improved.
[0022] (2) Obtain the data name corresponding to the controller to be tested. Read the data value corresponding to the data name in the cache area based on the data name. And write the data name and data value into the non-volatile storage area and the test storage area. In this way, the data information in the cache area can be reliably written into the non-volatile storage area and the test storage area.
[0023] (3) When the target test result of each data is used to indicate that the non-volatile storage area can correctly store the data information of the target data, it means that each data can be completely and accurately stored in the non-volatile storage area. At this time, the test result is determined to be the third test result.
[0024] It should be noted that the technical effects brought about by any implementation method in the second to fifth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here.
[0025] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.
[0027] Figure 1 is a schematic diagram of the architecture of a test system according to an exemplary embodiment;
[0028] Figure 2 is a schematic structural diagram of a testing device 101 according to an exemplary embodiment;
[0029] Figure 3 is a schematic diagram of another architecture of a test system according to an exemplary embodiment;
[0030] Figure 4 is a flow chart of a testing method according to an exemplary embodiment;
[0031] Figure 5 is a flow chart of another testing method according to an exemplary embodiment;
[0032] Figure 6 is a flow chart of another testing method according to an exemplary embodiment;
[0033] Figure 7 is a flow chart of another testing method according to an exemplary embodiment;
[0034] Figure 8 is a flow chart of another testing method according to an exemplary embodiment;
[0035] Fig. 9 is a structural schematic diagram of a testing device according to an exemplary embodiment;
[0036] Fig.10 It is a schematic structural diagram of a testing device according to an exemplary embodiment. DETAILED DESCRIPTION
[0037] In order to enable ordinary persons in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0039] With the continuous development of the automotive industry, new energy, intelligent driving, and unmanned driving have become the main development directions of today's automobiles. As a result, the corresponding controller and software functions are becoming more and more complex. The use of non-volatile memory (NVM) in the controller is also becoming more and more frequent. Therefore, it is necessary to test the non-volatile memory in the controller to determine the reliability of the non-volatile memory.
[0040] At present, it is possible to obtain the target variables to be stored in the non-volatile storage before the controller goes into sleep mode, and to obtain the target variables stored in the non-volatile storage after the controller wakes up; by comparing the target variables to be stored in the non-volatile storage before sleep mode with the target variables stored in the non-volatile storage after wakeup, it is determined whether there is an abnormality in the non-volatile storage.
[0041] However, in the related art, there is a problem that the target variables to be stored in the non-volatile storage before the controller goes into sleep mode may not be accurately obtained, resulting in an inability to accurately determine whether there is an abnormality in the non-volatile storage, and there are problems of low test accuracy and poor reliability of test results.
[0042] In order to solve the above problems, the present application provides a test method, including: sending a first instruction to a read-write controller; the read-write controller is used to control the application's read and write permissions to the cache area of the controller to be tested; the first instruction is used to indicate the cancellation of the application's read and write permissions to the cache area; sending a sleep instruction to the controller to be tested, and writing the data information in the cache area to the non-volatile storage area and the test storage area; sending a wake-up instruction to the controller to be tested, and reading the data information in the non-volatile storage area and the data information in the test storage area; comparing the data information in the non-volatile storage area with the data information in the test storage area to obtain a test result of the non-volatile storage area, and the test result is used to indicate whether there is an abnormality in the non-volatile storage area. In the case where the application's read and write permissions to the mixed access are not cancelled, there may be a time difference in the process of the test device writing the data information in the cache area to the non-volatile storage area and the test storage area, and there may be a situation in which the application modifies the data information in the cache area during the time difference. At this time, regardless of whether the non-volatile storage area works normally, the data information stored in the non-volatile storage area and the data information in the test storage area are different. Therefore, there is a problem that the non-volatile storage area cannot be detected whether it is working normally due to the modification of the data in the cache area by the application. Based on this, the above-mentioned sending of the first instruction to the read-write controller can cancel the read and write permission of the application to the cache area, so that in the process of detecting the controller to be tested, there will be no problem that the data information in the non-volatile storage area and the test storage area is different due to the modification of the data in the cache area by the application. Afterwards, a sleep instruction is sent to the controller to be tested, and the data information in the cache area is written into the non-volatile storage area and the test storage area. In addition, the data information in the non-volatile storage area and the data information in the test storage area are compared to obtain the test result of the non-volatile storage area. By comparing the data information in the non-volatile storage area and the data information in the test storage area, it is determined whether the data information in the non-volatile storage area and the data information in the test storage area are consistent, and it can be determined whether the non-volatile storage area stores the data information in the cache area completely and accurately. In this way, the accuracy and reliability of the non-volatile storage area test of the controller are improved.
[0043] For ease of understanding, the testing method provided in this application is specifically introduced below with reference to the accompanying drawings.
[0044] like Figure 1 , which is a schematic diagram of the architecture of a test system provided in an embodiment of the present application, includes a test device 101 and a controller to be tested 102 .
[0045] The testing device 101 is used to send a sleep instruction or a wake-up instruction to the controller to be tested 102; or to write the data information of the application program of the controller to be tested 102 in the cache area into the non-volatile storage area.
[0046] The controller to be tested 102 includes a cache area and a non-volatile storage area; the cache area is used to temporarily store data information of the application program; the non-volatile storage area is used to store data information in the cache area when the controller to be tested 102 is dormant.
[0047] In one possible implementation, Figure 2 , which is a schematic diagram of the structure of a test device 101 provided in an embodiment of the present application, including a host computer 201 , a read-write device 202 , and a test environment device 203 .
[0048] The host computer 201 includes test software for comparing the data information in the non-volatile storage area with the data information in the test storage area.
[0049] Optionally, the host computer 201 is also used to operate the test environment; or to run the test tool; or to store offline data information.
[0050] Optionally, the host computer 201 may be a computer.
[0051] The read / write device 202 is used to write the data information in the cache area into the non-volatile storage area and the test storage area; or to read the data information in the non-volatile storage area and the data information in the test storage area.
[0052] The test environment device 203 is used to provide a test environment for the controller to be tested.
[0053] Optionally, the test environment provided by the test environment device 203 may be a test bench or a hardwar e-in-the-loop (HIL) system.
[0054] For example, taking the test environment as a ring test system as an example, a test environment corresponding to the test method is built. Figure 3 As shown, it is a schematic diagram of the architecture of another test system provided in an embodiment of the present application, including: an automated test tool 301, a control console 302, a dSPACE in-the-loop test device 303, an integrated network control and analysis device 304, and a controller to be tested 305.
[0055] The automated testing tool 301 is used to compare the data information in the non-volatile storage area with the data information in the test storage area.
[0056] In some embodiments, automated testing tool 301 is called ECU-TEST.
[0057] Optionally, ECU-TEST is used to control the control console 302 and the integrated network control and analysis device 304. In this way, instead of manual operation, manual operation on the control console 302 and the integrated network control and analysis device 304 is simulated.
[0058] The console 302 is used to send data information to the automated test tool 301 ; or to send control instructions to the dSPACE in-the-loop test device 303 or the integrated network control and analysis device 304 ; or to receive signals corresponding to the data information sent by the integrated network control and analysis device 304 .
[0059] In some embodiments, the console 302 may be referred to as a Control Desk or a host computer.
[0060] The dSPACE in-the-loop test device 303 is used to control the controller to be tested 305 based on the in-the-loop test system.
[0061] In some embodiments, dSPACE in-the-loop test device 303 may be referred to as dSPACE HIL.
[0062] Optionally, the dSPACE HIL and Control Desk are connected via a communication cable.
[0063] Optionally, the communication cable may be a 100BASE-T1 standard cable.
[0064] The integrated network control and analysis device 304 is used to write the data information in the cache area into the non-volatile storage area and the test storage area; or to read the data information in the non-volatile storage area and the data information in the test storage area.
[0065] In some embodiments, the integrated network control and analysis device 304 may be referred to as integrated network control and analysis (INCA) hardware.
[0066] Optionally, the INCA hardware and the host computer are connected via a USB cable for transmitting control instructions from the host computer's INCA software to the INCA hardware and real-time signals fed back by the INCA hardware to the host computer.
[0067] The controller to be tested 305 includes a cache area and a non-volatile storage area.
[0068] In some embodiments, the controller to be tested 305 and the dSPACE in-the-loop test device 303 are connected via communication to simulate the connection between the controller to be tested 305 and the vehicle wiring harness, and are used to transmit real-time interactive signals between the controller to be tested 305 and the dSPACE in-the-loop test device 303.
[0069] In some embodiments, the controller to be tested 305 and the above-mentioned INCA hardware are connected via a controller area network (CAN) standard cable for transmitting real-time interactive signals between the INCA hardware and the controller to be tested 305 .
[0070] In a possible implementation, the above test method can also be tested in a real car environment. In this case, the system architecture of the test system does not include a host computer.
[0071] The test method is described in detail below with reference to the flow chart.
[0072] Figure 4 is a flow chart of a testing method according to an exemplary embodiment. Figure 4 As shown, the test method includes S401-S404:
[0073] S401. Send a first instruction to a read / write controller.
[0074] The read / write controller is used to control the application program's read / write permissions to the buffer area of the controller to be tested. The first instruction is used to instruct the application program to cancel the read / write permissions to the buffer area.
[0075] It should be understood that the application program is a program running on the controller to be tested.
[0076] In some embodiments, the cache area may be referred to as a transit storage area.
[0077] In a possible implementation, the testing device sends the first instruction to the read-write controller via a wired cable.
[0078] In a possible implementation, the testing device may send a first instruction to the read-write controller in response to a test start instruction from a user.
[0079] S402: Send a sleep instruction to the controller to be tested, and write the data information in the buffer area into the non-volatile storage area and the test storage area.
[0080] It should be understood that the sleep instruction is used to trigger the controller to be tested to sleep. The non-volatile storage area storage is used to provide the controller to be tested with data information stored in the non-volatile storage area when the controller to be tested is awakened, so that the controller to be tested can obtain the data information before sleep. The data information stored in the test storage area is used for the test device to retain the data information in the cache area for comparison with the data information stored in the non-volatile storage area after awakening.
[0081] It should be understood that, if the read and write permissions of the application program for mixed access are not revoked, there may be a time difference in the process of the test device writing the data information in the cache area into the non-volatile storage area and the test storage area, and within this time difference, the application program may modify the data information in the cache area. At this time, regardless of whether the non-volatile storage area is working normally, the data information stored in the non-volatile storage area and the data information in the test storage area are not the same. Therefore, there is a problem that it is impossible to detect whether the non-volatile storage area is working normally due to the modification of the cache area data by the application program.
[0082] Based on this, the above-mentioned sending of the first instruction to the read-write controller can cancel the application's read and write permissions to the cache area, so that during the detection of the controller to be tested, there will be no problem of different data information in the non-volatile storage area and the test storage area due to the application's modification of the data in the cache area.
[0083] S403: Send a wake-up instruction to the controller to be tested, and read the data information in the non-volatile storage area and the data information in the test storage area.
[0084] It should be understood that the wake-up instruction is used to trigger the control to be tested to be woken up.
[0085] In a possible implementation manner, the data information includes a data name and a data value corresponding to the data name.
[0086] In a possible implementation, based on the data name corresponding to the controller to be tested, the data value in the non-volatile storage area and the data value in the test storage area are read.
[0087] S404: Compare the data information in the non-volatile storage area with the data information in the test storage area to obtain a test result of the non-volatile storage area.
[0088] The test result is used to indicate whether there is an abnormality in the non-volatile storage area.
[0089] It should be understood that by comparing the data information in the non-volatile storage area with the data information in the test storage area to determine whether the data information in the non-volatile storage area is consistent with the data information in the test storage area, it is possible to determine whether the non-volatile storage area has completely and accurately stored the data information in the cache area. In the case that the non-volatile storage area has completely and accurately stored the data information in the cache area, it can be determined that the non-volatile storage area is normal.
[0090] In a possible implementation, when the data information in the non-volatile storage area is the same as the data information in the test storage area, the test result is determined to be a first test result, and the first test result is used to indicate that there is no abnormality in the non-volatile storage area. When the data information in the non-volatile storage area is different from the data information in the test storage area, the test result is determined to be a second test result, and the second test result is used to indicate that there is an abnormality in the non-volatile storage area.
[0091] It should be understood that, when the data information in the non-volatile storage area and the data information in the test storage area are the same, it means that the non-volatile storage area has completely and accurately stored the data information in the cache area. At this time, the test result is determined to be the first test result; when the data information in the non-volatile storage area and the data information in the test storage area are different, it means that the non-volatile storage area has not completely and accurately stored the data information in the cache area. At this time, the test result is determined to be the second test result.
[0092] In a possible implementation, a second instruction is sent to the read-write controller, where the second instruction is used to control the read-write controller to grant the application program read-write permissions.
[0093] It should be understood that after the test of the controller to be tested is completed, the application program's read and write permissions to the cache area should be restored. At this time, a second instruction can be sent to the read and write controller. In this way, it can be ensured that the test result of the controller to be tested is normal and it can work normally.
[0094] In the embodiment of the present application, when the read and write permission of the application program for mixed access is not cancelled, there may be a time difference in the process of the test device writing the data information in the cache area into the non-volatile storage area and the test storage area, and there may be a situation in which the application program modifies the data information in the cache area during the time difference. At this time, regardless of whether the non-volatile storage area works normally, the data information stored in the non-volatile storage area and the data information in the test storage area are not the same. Therefore, there is a problem that the non-volatile storage area cannot be detected whether it works normally due to the modification of the data in the cache area by the application program. Based on this, the above-mentioned sending of the first instruction to the read-write controller can cancel the read and write permission of the application program to the cache area, so that in the process of detecting the controller to be tested, there will be no problem that the data information in the non-volatile storage area and the test storage area are different due to the modification of the data in the cache area by the application program. Afterwards, a sleep instruction is sent to the controller to be tested, and the data information in the cache area is written into the non-volatile storage area and the test storage area. In addition, the data information in the non-volatile storage area and the data information in the test storage area are compared to obtain the test result of the non-volatile storage area. By comparing the data information in the non-volatile storage area with the data information in the test storage area, it is determined whether the data information in the non-volatile storage area is consistent with the data information in the test storage area, and it is possible to determine whether the non-volatile storage area stores the data information in the cache area completely and accurately. In this way, the accuracy and reliability of the non-volatile storage area test of the controller are improved.
[0095] In one possible implementation, Figure 5 As shown, the test method further includes S501:
[0096] S501. Obtain the data name corresponding to the controller to be tested.
[0097] In a possible implementation, the data name corresponding to the controller to be tested may be determined by determining information (such as type, name, or identifier) of the data name corresponding to the controller to be tested.
[0098] In a possible implementation, the data name corresponding to the controller to be tested can be obtained by querying the correspondence between the determination information and the data name through the data name determination information corresponding to the controller to be tested. The correspondence between the determination information and the data name includes multiple data name determination information and the data name corresponding to each data name determination information.
[0099] Optionally, the data name corresponding to the controller to be tested may include one or more.
[0100] In some embodiments, the data information stored in the buffer area may be variable information, and the data name is the variable name.
[0101] Writing the data information in the cache area to the non-volatile storage area and the test storage area, including S502-S503:
[0102] S502: Read the data value corresponding to the data name in the cache area based on the data name.
[0103] In one possible implementation, an index value corresponding to the data name can be obtained, where the index value is used to indicate the storage location of the data name in the cache area; based on the index value, the data value corresponding to the data name is read from the storage location corresponding to the data name in the cache area.
[0104] S503: Write the data name and data value into the non-volatile storage area and the test storage area.
[0105] In a possible implementation, an index value may be assigned to a data name, and the data name and data value may be written into a non-volatile storage area or a test storage area based on the index value.
[0106] In the embodiment of the present application, the data name corresponding to the controller to be tested is obtained. Based on the data name, the data value corresponding to the data name in the cache area is read. The data name and the data value are written into the non-volatile storage area and the test storage area. In this way, the data information in the cache area can be reliably written into the non-volatile storage area and the test storage area.
[0107] In a possible implementation, an application corresponds to multiple data. Figure 4 The embodiment shown, as Figure 6 As shown, the data information in the non-volatile storage area is compared with the data information in the test storage area to obtain the test result of the non-volatile storage area, including S601-S602:
[0108] S601. For each data, compare the data information of the target data in the non-volatile storage area with the data information of the target data in the test storage area to obtain a target test result of the non-volatile storage area, where the target data is one of multiple data, and the target test result is used to indicate whether the non-volatile storage area can correctly store the data information of the target data.
[0109] S602. When the target test result of each data is used to indicate that the non-volatile storage area can correctly store data information of the target data, determine that the test result is a third test result, and the third test result is used to indicate that the non-volatile storage area can correctly store data information of each data.
[0110] It should be understood that when the target test result of each data is used to indicate that the non-volatile storage area can correctly store the data information of the target data, it means that each data can be completely and accurately stored in the non-volatile storage area. At this time, the test result is determined to be the third test result.
[0111] In one possible implementation, when there is a target test result for each data that is used to indicate that the non-volatile storage area cannot correctly store the data information of the target data, it means that there is data that cannot be completely and accurately stored in the non-volatile storage area. At this time, the test result is determined to be the fourth test result, and the fourth test result is used to indicate that the non-volatile storage area cannot accurately store the data information of each data.
[0112] In a possible implementation, the target test result of the target data can be used to indicate that the non-volatile storage area cannot accurately store the data information of the target data, and generate the fifth test information, the fifth test information is used to indicate that the non-volatile storage area cannot correctly store the target data. In this way, the tester can take corresponding processing measures on the target data based on the fact that the non-volatile storage cannot correctly store the target data.
[0113] Exemplarily, the storage log of the non-volatile storage area may be queried based on the target data to determine the reason why the non-volatile storage area cannot correctly store the target data.
[0114] In a possible implementation, data reading and writing of the non-volatile storage area or the cache area or the test storage area may be accomplished through an extended calibration protocol (XCP).
[0115] For example, Figure 7 FIG. 1 is a flow chart of another testing method provided in an embodiment of the present application, including:
[0116] S701, perform a power-on operation.
[0117] At this time, the corresponding ECU under test enters the running state.
[0118] S702. Change the corresponding value to Value1 according to the variable name, and store Value1 in the data dictionary of the host computer.
[0119] At this time, the ECU will store the value of Value1 into the transfer storage area.
[0120] S703: Execute a power-off operation.
[0121] At this time, the corresponding ECU under test enters the sleep process, and the ECU writes Value1 into the NVM storage area.
[0122] S704: Determine whether the tested ECU is in sleep mode.
[0123] S705: If the tested ECU is in sleep mode, a power-on operation is performed.
[0124] At this time, the corresponding ECU under test is woken up.
[0125] In a possible implementation, if the tested ECU is in sleep mode, the waiting process continues.
[0126] S706 . Read the corresponding variable value Value2 in the NVM test storage area according to the controller NVM variable name list, and read the data value of the corresponding variable in the NVM storage area into the NVM test storage area.
[0127] In a possible implementation, the data reading process is implemented by a read-write device.
[0128] S707, determine whether the read NVM variable value Value2 is equal to the NVM variable value Value1 corresponding to the host computer data dictionary. If they are not equal, it is determined that the storage fails. If they are equal, it is determined that the storage is successful.
[0129] In one possible implementation, when the test environment is a test bench or a virtual in-the-loop system, an automatic test case can be generated through a python script, the test environment and equipment can be called, and any optional test method provided in the embodiments of the present application can be executed.
[0130] For example, the controller to be tested can be tested based on automatic test cases, such as Figure 8 FIG. 1 is a flow chart of another testing method provided in an embodiment of the present application, including:
[0131] S801. Obtain a list of controller NVM variable names.
[0132] In a possible implementation, the observed variables of the controller NVM should be distinguished by using specific identifiers.
[0133] For example, XXX_Day_EngOnLocalDate_NR represents the day when the engine is started, where NR is a specific identifier of NVM. A list of observed variables can be obtained according to the identifier.
[0134] S802. Create an offline data dictionary NVM.txt on the host computer.
[0135] In a possible implementation, the data dictionary format is: {NVM variable name 1: NVM variable value 1, NVM variable name 2: NVM variable value 2, ...}.
[0136] S804. Use the python script to create an automatic test case for ECU-TEST to change the corresponding NVM variable value to Value1 and write the Value1 variable value into the host computer offline data dictionary.
[0137] In one possible implementation, read the NVM variable name 1 in the first row of the NVM variable name list, define the value Value1 to be assigned to variable name 1, call the API corresponding to ECU-TEST based on NVM variable name 1, create a test step for using INCA to write the NVM variable value Value1 corresponding to NVM variable name 1, and then create a test step for writing NVM variable name 1 and NVM variable value Value1 to the data dictionary. Execute the above steps in a loop and use a python script to create test steps for all variables in the controller's NVM variable name list.
[0138] S804. Use a python script to create an automatic test case for ECU-TEST to read the value Value2 in the NVM test storage area according to the controller NVM variable name list and compare it with the NVM variable value Value1 corresponding to the host computer data dictionary.
[0139] In a possible implementation, according to the NVM variable name 1 in the first row of the NVM variable name list, a test step is created to read the NVM variable value 1 from the data dictionary and use it as the historical NVM variable value Value1. According to the NVM variable name 1, the API of the ECU-TEST write and read variable step is called to create a test step to use INCA to read the current NVM variable value Value2 corresponding to the NVM variable name 1 and compare it with the historical NVM variable value Value1. If they are equal, it is determined that the test has passed, and if they are not equal, it is determined that the test has failed. The above steps are executed in a loop, and the test steps of all variables in the controller NVM variable name list are created using a python script.
[0140] S805. According to the real-time status of the ECU-TEST test project and the actual project test requirements, the automatic test case created above is inserted before the power-off step of the required original conventional test case N; the test case created above is inserted after the power-on step of the conventional test case N+1 connected with the conventional test case N.
[0141] In a possible implementation, different insertion steps may be performed under different connection use cases according to project testing requirements.
[0142] S806. Use ECU-TEST software to run the entire test project, and then you can get the corresponding NVM test results.
[0143] The above mainly introduces the scheme provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the test device or the test device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0144] The embodiment of the present application can exemplarily divide the functional modules of the test device or the test device according to the above method. For example, the test device or the test device may include various functional modules corresponding to the various functional divisions, or two or more functions may be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0145] Fig. 9 FIG. 1 is a schematic diagram showing a structure of a testing device according to an exemplary embodiment. Fig. 9 The testing device includes: a sending module 901, a testing module 902 and a processing module 903.
[0146] The sending module 901 is used to send a first instruction to the read-write controller. The read-write controller is used to control the read-write permission of the application program to the buffer area of the controller to be tested. The first instruction is used to instruct to cancel the read-write permission of the application program to the buffer area.
[0147] The sending module 901 is further used to send a sleep instruction to the controller to be tested.
[0148] The processing module 903 is used to write the data information in the buffer area into the non-volatile storage area and the test storage area. The sending module 901 is also used to send a wake-up instruction to the controller to be tested.
[0149] The processing module 903 is also used to read the data information in the non-volatile storage area and the data information in the test storage area.
[0150] The test module 902 is used to compare the data information in the non-volatile storage area with the data information in the test storage area to obtain a test result of the non-volatile storage area, and the test result is used to indicate whether there is an abnormality in the non-volatile storage area.
[0151] In a possible implementation manner, the testing device further includes a determination module 904 .
[0152] The determination module 904 is used to determine that the test result is a first test result when the data information in the non-volatile storage area is the same as the data information in the test storage area. The first test result is used to indicate that there is no abnormality in the non-volatile storage area.
[0153] The determination module 904 is further configured to determine that the test result is a second test result when the data information in the non-volatile storage area is different from the data information in the test storage area, and the second test result is configured to indicate that an abnormality exists in the non-volatile storage area.
[0154] In a possible implementation manner, the data information includes a data name and a data value corresponding to the data name.
[0155] The testing device further includes an acquisition module 905 .
[0156] The acquisition module 905 is used to acquire the data name corresponding to the controller to be tested.
[0157] The processing module 903 is specifically configured to read a data value corresponding to the data name in the cache area based on the data name.
[0158] The processing module 903 is further specifically configured to write the data name and the data value into the non-volatile storage area and the test storage area.
[0159] In a possible implementation, the processing module 903 is specifically configured to read the data value in the non-volatile storage area and the data value in the test storage area based on the data name corresponding to the controller to be tested.
[0160] In a possible implementation manner, the application corresponds to a plurality of data. The testing device further includes a determination module 904 .
[0161] The test module 902 is specifically used to compare the data information of the target data in the non-volatile storage area with the data information of the target data in the test storage area for each data, to obtain a target test result of the non-volatile storage area, where the target data is one of multiple data, and the target test result is used to indicate whether the non-volatile storage area can correctly store the data information of the target data.
[0162] The determination module 904 is used to determine that the test result is a third test result when each target test result of the data is used to indicate that the non-volatile storage area can correctly store the data information of the target data. The third test result is used to indicate that the non-volatile storage area can correctly store the data information of each data.
[0163] In a possible implementation, the sending module 901 is further configured to send a second instruction to the read-write controller, where the second instruction is configured to control the read-write controller to grant the application program read-write permissions.
[0164] It should be noted that those skilled in the art can understand that Fig.10 The test device structure shown in the figure does not constitute a limitation on the test device, and the test device may include Fig.10 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.
[0165] The processor 1001 is the control center of the test device. It uses various interfaces and lines to connect various parts of the entire test device. By running or executing software programs and / or modules stored in the memory 1002 and calling data stored in the memory 1002, it performs various functions of the test device and processes data, thereby monitoring the test device as a whole. The processor 1001 may include one or more processing units. Optionally, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications.
[0166] The memory 1002 may be used to store software programs and various data. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional module (such as a determination unit, a processing unit, etc.), etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0167] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1002 including instructions. The instructions can be executed by a processor 1001 of a testing device to implement the method in the above embodiment.
[0168] Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0169] In an exemplary embodiment, the present application also provides a computer program product including one or more instructions, and the one or more instructions can be executed by the processor 1001 of the test device to complete the method in the above embodiment.
[0170] It should be noted that when the instructions in the above-mentioned computer-readable storage medium or one or more instructions in the computer program product are executed by the processor of the test device, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect as the above-mentioned method can be achieved. To avoid repetition, they will not be repeated here.
[0171] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0172] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0173] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0175] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the full classification part or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute the full classification part or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD and other media that can store program code.
[0176] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A testing method, characterized in that: include: Sending a first instruction to a read-write controller; the read-write controller is used to control the read and write permissions of the application program to the cache area of the controller to be tested; The first instruction is used to instruct to cancel the application's read and write permissions to the cache area; Sending a sleep instruction to the controller to be tested, and writing the data information in the buffer area into the non-volatile storage area and the test storage area; Sending a wake-up instruction to the controller to be tested, and reading the data information in the non-volatile storage area and the data information in the test storage area; The data information in the non-volatile storage area is compared with the data information in the test storage area to obtain a test result of the non-volatile storage area, wherein the test result is used to indicate whether there is an abnormality in the non-volatile storage area.
2. The method according to claim 1, characterized in that The comparing the data information in the non-volatile storage area with the data information in the test storage area to obtain the test result of the non-volatile storage area includes: In a case where the data information in the non-volatile storage area is the same as the data information in the test storage area, determining that the test result is a first test result, wherein the first test result is used to indicate that there is no abnormality in the non-volatile storage area; In a case where the data information in the non-volatile storage area is different from the data information in the test storage area, the test result is determined to be a second test result, and the second test result is used to indicate that an abnormality exists in the non-volatile storage area.
3. The method according to claim 2, characterized in that The data information includes a data name and a data value corresponding to the data name; The method further comprises: Obtain the data name corresponding to the controller to be tested; Writing the data information in the cache area into the non-volatile storage area and the test storage area includes: Reading a data value corresponding to the data name in the cache area based on the data name; The data name and the data value are written into the nonvolatile storage area and the test storage area.
4. The method according to claim 3, characterized in that Reading the data information in the non-volatile storage area and the data information in the test storage area includes: Based on the data name corresponding to the controller to be tested, the data value in the non-volatile storage area and the data value in the test storage area are read.
5. The method according to claim 1, characterized in that The application corresponds to a plurality of data; the data information in the non-volatile storage area is compared with the data information in the test storage area to obtain the test result of the non-volatile storage area, including: For each of the data, compare the data information of the target data in the non-volatile storage area with the data information of the target data in the test storage area to obtain a target test result of the non-volatile storage area, wherein the target data is one of the multiple data, and the target test result is used to indicate whether the non-volatile storage area can correctly store the data information of the target data; When the target test result of each of the data is used to indicate that the non-volatile storage area can correctly store the data information of the target data, the test result is determined to be a third test result, and the third test result is used to indicate that the non-volatile storage area can correctly store the data information of each of the data.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: A second instruction is sent to the read-write controller, where the second instruction is used to control the read-write controller to grant the application program read-write permissions.
7. A testing device, characterized in that: It includes a sending module, a testing module and a processing module; The sending module is used to send a first instruction to the read-write controller; the read-write controller is used to control the application's read and write permissions to the cache area of the controller to be tested; the first instruction is used to instruct to cancel the application's read and write permissions to the cache area; The sending module is further used to send a sleep instruction to the controller to be tested; The processing module is used to write the data information in the cache area into the non-volatile storage area and the test storage area; The sending module is further used to send a wake-up instruction to the controller to be tested; The processing module is further used to read the data information in the non-volatile storage area and the data information in the test storage area; The test module is used to compare the data information in the non-volatile storage area with the data information in the test storage area to obtain a test result of the non-volatile storage area, and the test result is used to indicate whether there is an abnormality in the non-volatile storage area.
8. A testing device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of a test device, the test device is capable of performing the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises computer instructions, which, when executed on a test device, enable the test device to perform the method according to any one of claims 1 to 6.
