A vehicle-mounted controller data storage test method, device, equipment and medium

By generating and executing power-down data storage test cases, the problem of delayed problem discovery in vehicle controller data storage testing was solved, enabling early discovery and efficient testing during the development phase, and improving the reliability and coverage of data storage.

CN116627742BActive Publication Date: 2026-04-21DEEPAL AUTOMOBILE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DEEPAL AUTOMOBILE TECH CO LTD
Filing Date
2023-05-29
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies for testing data storage in vehicle controllers cannot promptly identify underlying storage problems, leading to delays in development, high costs in terms of manpower and resources, and insufficient test coverage.

Method used

By obtaining the power-down data storage configuration information of the target vehicle controller, multiple power-down data storage test cases are generated. The host computer controls the power supply to wake up the controller for data reading and writing, and executes the test cases. The first and second data variables are compared to obtain the test results.

Benefits of technology

The discovery of data storage issues in the vehicle controller during the development phase improved test coverage, saved manpower, material resources, and time costs, reduced the probability of false positives in manual testing, and enhanced the reliability of data storage in the integrated hardware and software of the vehicle controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116627742B_ABST
    Figure CN116627742B_ABST
Patent Text Reader

Abstract

This application relates to the field of vehicle electronic testing technology, and provides a method, apparatus, device, and medium for testing data storage of an on-board controller. The method includes: acquiring power-down data storage configuration information of a target on-board controller; generating multiple power-down data storage test cases based on the power-down data storage configuration information; powering on the target on-board controller through a power supply connected to the target on-board controller, waking up the target on-board controller to perform data read / write, and calling a first data variable of the target on-board controller during data read / write; executing multiple power-down data storage test cases to control the target on-board controller to perform power-down data storage and / or data read / write, and calling a second data variable of the target on-board controller during power-down data storage; comparing the first data variable and the second data variable to obtain the data storage test result, saving manpower, material resources, and time costs, and improving the reliability of data storage integrated into the on-board controller's hardware and software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle electronic testing technology, specifically to a method, apparatus, equipment, and medium for testing data storage of an on-board controller. Background Technology

[0002] With the development of automotive electronics technology, the functions of automotive electronic and electrical devices are becoming increasingly complex, encompassing multiple functions such as entertainment, driving, safety, anti-theft, and energy monitoring. The amount of data that needs to be monitored, processed, and stored for these functions is also increasing. In this context, only thorough and comprehensive automated testing can ensure the integrity of the hardware and software integration and storage functions of the vehicle controller. Data storage testing is used to verify the performance of the controller module's hardware and software integration. For example, data storage testing may include performing hundreds or thousands of power-down data variable storage and power-on data variable retrieval tests on the communication module, and verifying the normality of its storage status while the communication module is powered on.

[0003] Existing controller data storage testing methods are all based on HIL (Hardware-in-the-Loop) testing, whole-vehicle testing, and real-vehicle testing for vehicle controller data storage testing. These methods suffer from time lag in identifying storage problems and cannot resolve them promptly. For example, Chinese patent CN114675626A discloses a vehicle controller testing platform and method, providing a way to test one or more power domain controllers on a single hardware rack. This not only enables multi-power domain, multi-controller development and debugging at the hardware level but also allows for modular software development and debugging of multi-power domain controllers. While this solution can simulate a real external environment to test various functions of the vehicle controller, it also... Ultimately, the actual functionality of the vehicle is used to verify the controller's storage status, but it cannot test the underlying storage situation of the driver software and hardware integration. For developers, when problems occur, they cannot intuitively determine the location of the problem, and the loop-in-the-loop testing time is delayed in the development phase, which can easily delay the development schedule. Chinese patent CN114647593A discloses a storage automation testing method and device with dynamically adjustable resources, which provides a technology for automatically allocating test resources according to the priority of test tasks to achieve resource control, and determining whether test cases can be executed in parallel based on the classification algorithm of test cases. Although this solution can perform automated storage testing, it is applied to web systems and focuses on test task priority and test resource allocation, which is not suitable for the field of vehicle controllers.

[0004] Therefore, how to detect the underlying data storage of the vehicle controller and discover data storage problems in the controller during the development phase is an urgent problem to be solved. Summary of the Invention

[0005] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a method, apparatus, device and medium for testing data storage of vehicle controllers, so as to solve the problem of how to detect the underlying data storage of vehicle controllers and discover data storage problems of controllers during the development stage.

[0006] To achieve the above and other related objectives, this application provides a method for testing data storage of an on-board controller, the method comprising:

[0007] Obtain the power-down data storage configuration information of the target vehicle controller;

[0008] Based on the power-down data storage configuration information, multiple power-down data storage test cases are generated;

[0009] Power is supplied to the target vehicle controller via a power source connected to the target vehicle controller, thereby waking up the target vehicle controller to perform data reading and writing, and calling the first data variable when the target vehicle controller performs data reading and writing.

[0010] The multiple power-down data storage test cases are executed to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and to call the second data variable when the target vehicle controller performs power-down data storage;

[0011] The first data variable and the second data variable are compared to obtain the data storage test results.

[0012] In one embodiment of this application, multiple power-down data storage test cases are generated based on the power-down data storage configuration information, including:

[0013] Based on the power-down data storage configuration information, the first condition variable value corresponding to the power-down of the target vehicle controller key is determined, wherein the power-down of the key is used to control the target controller to enter a sleep state;

[0014] Based on the value of the first condition variable, a first test case, a second test case, and a third test case are generated corresponding to the power-off after the target vehicle controller completes storage. The first test case is used to indicate that the power is cut off after real-time storage is completed, the second test case is used to indicate that no read / write task is executed and the power is cut off after non-real-time storage is completed, and the third test case is used to indicate that read / write task is executed and the power is cut off after non-real-time storage is completed.

[0015] Based on the value of the first condition variable, a fourth test case and a fifth test case are generated corresponding to the power-off when the target vehicle controller storage is not completed. The fourth test case is used to indicate power-off when real-time storage is not completed, and the fifth test case is used to indicate power-off when non-real-time storage is not completed.

[0016] In one embodiment of this application, multiple power-down data storage test cases are generated based on the power-down data storage configuration information, including:

[0017] Based on the power-down data storage configuration information, the second condition variable value corresponding to the constant power supply of the target vehicle controller is determined, wherein the constant power supply is used to control the target controller to enter a power-off state;

[0018] Based on the second condition variable, a sixth test case and a seventh test case are generated corresponding to the power-off of the target vehicle controller after storage completion. The sixth test case is used to indicate power-off when real-time storage is completed, and the seventh test case is used to indicate power-off when non-real-time storage is completed.

[0019] Based on the second condition variable, an eighth test case and a ninth test case are generated corresponding to the power-off when the target vehicle controller storage is not completed. The eighth test case is used to indicate power-off when real-time storage is not completed, and the ninth test case is used to indicate power-off when non-real-time storage is not completed.

[0020] In one embodiment of this application, executing the plurality of power-down data storage test cases includes:

[0021] Call the preset execution count and execution order corresponding to each of the power-off data storage test cases;

[0022] According to the preset number of executions and execution order, each of the power-off data storage test cases is executed sequentially.

[0023] In one embodiment of this application, after obtaining the data storage test results, the method further includes:

[0024] According to the preset storage block classification, the first and second data variables of the target vehicle controller with normal data storage function are sorted by column, and the sorted first and second data variables are displayed according to the execution order of the multiple power-down data storage test cases. If the first and second data variables are identical, the data storage function of the target vehicle controller is normal; and / or,

[0025] According to the preset storage block classification, the first and second data variables of the target vehicle controller with abnormal data storage function are sorted by column, and the sorted first and second data variables are displayed according to the execution order of the multiple power-down data storage test cases. If the first data variable and the second data variable are inconsistent, the data storage function of the target vehicle controller is abnormal.

[0026] In one embodiment of this application, powering on the target vehicle controller via a power source connected to the target vehicle controller includes:

[0027] According to the preset first initialization time and first voltage, the power supply is controlled to provide the target vehicle controller with the first voltage for the first time within the first initialization time, and the first current value corresponding to the first power supply is called.

[0028] If the first current value is greater than the preset power supply current threshold, then according to the preset second initialization time and second voltage, the power supply is controlled to provide a second power supply to the target vehicle controller through the second voltage within the second initialization time to wake up the target vehicle controller, and the second current value corresponding to the second power supply is called. The second current value is used to indicate whether the target vehicle controller is in working state.

[0029] In one embodiment of this application, after calling the second current value corresponding to the second power supply, the method further includes:

[0030] The second current value is compared with a preset operating current threshold.

[0031] If the second current value is greater than the operating current threshold, then the status information of the target vehicle controller is invoked;

[0032] If the status information of the target vehicle controller is normal, then the code file in the target vehicle controller is called to obtain the first data variable when the target vehicle controller performs data reading and writing through the code file.

[0033] In one embodiment of this application, an on-board controller data storage testing device is also provided, the device comprising:

[0034] The information acquisition module is used to acquire the power-off data storage configuration information of the target vehicle controller;

[0035] The test case generation module is used to generate multiple power-off data storage test cases based on the power-off data storage configuration information.

[0036] The power-on control module is used to power on the target vehicle controller through a power supply connected to the target vehicle controller, so as to wake up the target vehicle controller to perform data reading and writing, and call the first data variable when the target vehicle controller performs data reading and writing;

[0037] The power-down control module is used to execute the multiple power-down data storage test cases to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and to call the second data variable when the target vehicle controller performs power-down data storage;

[0038] The test result generation module is used to compare the first data variable and the second data variable to obtain the data storage test result.

[0039] In one embodiment of this application, an electronic device is also provided, the electronic device comprising:

[0040] One or more processors;

[0041] A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the vehicle controller data storage test method as described above.

[0042] In one embodiment of this application, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a computer's processor, causes the computer to perform the vehicle controller data storage test method as described above.

[0043] The beneficial effects of this invention are:

[0044] First, the power-down data storage configuration information of the target vehicle controller is obtained. Then, based on the power-down data storage configuration information, multiple power-down data storage test cases are generated. Next, the target vehicle controller is powered on via a power source connected to it to wake it up for data reading and writing, and a first data variable is invoked during data reading and writing. Then, the multiple power-down data storage test cases are executed to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and a second data variable is invoked during power-down data storage. Finally, the first and second data variables are compared to obtain the data storage test results. In this invention, the vehicle controller data storage testing method can be directly applied to a host computer. The host computer first generates multiple test cases based on the power-off data storage configuration information, which can include the key power-off data storage status and the normal power-off data storage status of the vehicle controller, increasing the data storage coverage. Through the host computer, data storage testing can be performed on multiple vehicle controllers during the development phase to discover controller data storage problems, greatly saving manpower, material resources, and time costs. By acquiring the data variables of the vehicle controller's power-on read / write data and power-off storage data, and comparing the underlying data, the test results are obtained, avoiding the probability of manual testing errors. Repeatable testing is possible, effectively improving the reliability of the integrated data storage of the vehicle controller's hardware and software.

[0045] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0046] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0047] Figure 1 This is a schematic diagram illustrating the implementation environment of an on-board controller data storage test method, as shown in an exemplary embodiment of this application.

[0048] Figure 2 This is a schematic flowchart illustrating an exemplary embodiment of the vehicle controller data storage test method of this application;

[0049] Figure 3 This is a schematic diagram illustrating the test case design process of an exemplary embodiment of this application;

[0050] Figure 4 This is a schematic diagram illustrating the test case implementation process of an exemplary embodiment of this application;

[0051] Figure 5 This is a schematic diagram of the main framework of a test script shown in an exemplary embodiment of this application;

[0052] Figure 6 This is a flowchart illustrating a vehicle controller data storage test method according to another exemplary embodiment of this application;

[0053] Figure 7 This is a block diagram illustrating an exemplary embodiment of the vehicle controller data storage test apparatus of this application;

[0054] Figure 8 A schematic diagram of the structure of a computer system suitable for an electronic device according to an embodiment of this application is shown. Detailed Implementation

[0055] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0056] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0057] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0058] First, it's important to clarify that data storage testing is used to verify the integrated hardware and software performance of the controller module. For example, data storage testing may include hundreds or thousands of power-down data variable storage and power-on data variable retrieval tests on the communication module, verifying the success of the storage process while the communication module is powered on. Power-down storage is divided into two parts: the vehicle controller energizing itself by the key and energizing itself by a constant power source, i.e., entering sleep mode and entering a power-off state. The timing of power-down storage is as follows: energizing the key after storage is complete; energizing itself by a constant power source after storage is complete; energizing itself by a constant power source during storage; performing power-down storage before real-time storage is complete; powering on again during power-down storage; and powering on again after reading data but before running application layer tasks.

[0059] Current data storage testing methods have the following drawbacks:

[0060] Based on HIL-in-the-loop testing, whole vehicle testing, and real vehicle testing, problems were found to be delayed in the testing time, and problems could not be resolved in a timely manner.

[0061] It cannot effectively save manpower, material resources, and time costs;

[0062] The large amount of information stored in the data variables makes manual comparison and verification difficult and prone to oversight;

[0063] Due to time and manpower constraints, the time interval between the normal power-off and the key power-off is random when storage is not completed, and the number of tests is limited.

[0064] Therefore, this application proposes a method, apparatus, device, and medium for testing data storage of vehicle controllers to solve the above problems.

[0065] The following explains the technical terms used in this application:

[0066] Trace32: As a truly integrated and universal system simulator, Trace32 can be combined into various solutions, supporting network solutions, laboratory standalone solutions, and remote fiber optic solutions. It has a fully modular, building block structure, supports JTAG (Joint Test Action Group, an embedded interface) and BDM interface (a debugging interface) and all CPUs (Central Processing Units), and can provide powerful functions such as software analysis, port analysis, waveform analysis, and software testing.

[0067] CMM files: Standard Practice (the scripting language for Lauderbach simulation testing tools) scripts have the .cmm extension, therefore Practice scripts can also be called CMM scripts. CMM scripts can be used for: automated testing, creating graphical interface tools, initializing and configuring Trace32 software.

[0068] Variables: Variables in cmm scripts are called macros. They are essentially strings stored in memory. Macros in cmm scripts can be created and modified at any time.

[0069] GPIB: An interface bus or connection system used to connect electronic test instruments to a central controller for automated testing.

[0070] Figure 1 This is a schematic diagram illustrating the implementation environment of an on-board controller data storage test method, as shown in an exemplary embodiment of this application.

[0071] Reference Figure 1 As shown, the implementation environment may include a host computer 101, a debugging tool 102, a target vehicle controller 103, and a power supply 104. It should be noted that in this embodiment, the host computer 101 may be, for example, a desktop computer, the power supply 104 may be, for example, a programmable power supply, and the debugging tool 102 may be, for example, a Trace32. The host computer is connected to the programmable power supply via a GPIB-USB tool, and the target vehicle controller is connected to the host computer via the Trace32. One power supply from the programmable power supply powers the target vehicle controller, and the other power supply provides a wake-up signal to the target vehicle controller. The host computer uses Python (a programming language) to control and store test content through Trace32 API commands.

[0072] The technical solution provided in this application embodiment can be applied to the host computer 101. The host computer 101 is used to obtain the net power request value output by the vehicle controller 102 and implement the vehicle controller data storage test method in this invention based on the net power request value. After obtaining the actual control parameters, the actual control parameters are transmitted to the voltage converter 103 to control the input current request value of the voltage converter. By controlling the voltage through the host computer 101, the programmable power supply current information is obtained, and the target vehicle controller is powered on and off based on the current information of the programmable power supply. Based on the programmable power supply current information obtained after the host computer 101 turns the programmable power supply on or off, and the software power-off conditions read from the Trace32 software, the target vehicle controller data storage test is performed.

[0073] In one embodiment of this application, the host computer 101 obtains the power-down data storage configuration information of the target vehicle controller; generates multiple power-down data storage test cases based on the power-down data storage configuration information; powers on the target vehicle controller through a power source connected to the target vehicle controller to wake up the target vehicle controller for data reading and writing, and calls the first data variable when the target vehicle controller is performing data reading and writing; executes the multiple power-down data storage test cases to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and calls the second data variable when the target vehicle controller is performing power-down data storage; compares the first data variable and the second data variable to obtain the data storage test result. In this embodiment, the vehicle controller data storage testing method can be directly applied to the host computer. The host computer first generates multiple test cases based on the power-off data storage configuration information, which can include the key power-off data storage status and the normal power-off data storage status of the vehicle controller, increasing the data storage coverage. Through the host computer, data storage testing can be performed on multiple vehicle controllers during the development phase to discover controller data storage problems, greatly saving manpower, material resources, and time costs. The data variables of the vehicle controller's power-on read / write data and power-off storage data are obtained, and the test results are obtained by comparing the underlying data, avoiding the probability of manual testing errors. Repeatable testing is possible, effectively improving the reliability of data storage in the integrated hardware and software of the vehicle controller.

[0074] The above section introduced the exemplary implementation environment of the technical solution of this application. Next, we will continue to introduce the vehicle controller data storage test method of this application.

[0075] To address the problem of how to detect the underlying data storage of vehicle controllers and identify data storage issues during the development phase in the prior art, embodiments of this application propose a vehicle controller data storage testing method, a vehicle controller data storage testing device, an electronic device, a computer-readable storage medium, and a computer program product. These embodiments will be described in detail below.

[0076] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating an exemplary embodiment of the vehicle controller data storage test method, which can be applied to... Figure 1 The implementation environment is shown. It should be understood that this method can also be applied to other exemplary implementation environments and specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.

[0077] like Figure 2 As shown, in an exemplary embodiment, the vehicle controller data storage test method includes at least steps S210 to S250, which are described in detail below:

[0078] Step S210: Obtain the power-down data storage configuration information of the target vehicle controller;

[0079] Step S220: Generate multiple power-down data storage test cases based on the power-down data storage configuration information;

[0080] Step S230: Power on the target vehicle controller through the power supply connected to the target vehicle controller to wake up the target vehicle controller to perform data reading and writing, and call the first data variable when the target vehicle controller performs data reading and writing.

[0081] Step S240: Execute multiple power-down data storage test cases to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and call the second data variable when the target vehicle controller performs power-down data storage;

[0082] Step S250: Compare the first data variable and the second data variable to obtain the data storage test results.

[0083] It should be noted that the power-down data storage configuration information of the target vehicle controller in this embodiment includes: preset voltage and current condition values ​​for the target vehicle controller key power-down, preset voltage and current condition values ​​for the target vehicle controller under constant power-down, and may also include preset real-time storage condition values.

[0084] For example, a Python script is used to control Trace32 and write test case scripts. After powering on the target vehicle controller via Trace32, the target vehicle controller code file is loaded, and the controller under test is controlled to read and write the input cmm file to read and write the internal variable values ​​of the vehicle controller program. Using the Python library provided by Trace32, control code is written for Trace32, test cases are executed, and test results are obtained based on the variable values ​​stored during test case execution. A Python script is used to control the power-on and power-off of the programmable power supply vehicle controller. After setting the power-on and power-off voltages, API (Application Programming Interface) commands are used to control the power-off method and timing of the target vehicle controller. According to the test requirements, Python is used to generate data variables stored during power-off, capture data variables read during power-on, and analyze the conditions for determining whether the test passes or fails. Based on the test data from the above steps, a test report is output, and test problems can be analyzed based on the test results and test log files.

[0085] As can be seen from steps S210 to S250 above, the solution proposed in this embodiment allows the vehicle controller data storage testing method to be directly applied to the host computer. The host computer first generates multiple test cases based on the power-off data storage configuration information, which can include the key power-off data storage status and the normal power-off data storage status of the vehicle controller, increasing the coverage of data storage. Through the host computer, data storage testing can be performed on multiple vehicle controllers during the development phase to discover controller data storage problems, greatly saving manpower, material resources, and time costs. By obtaining the data variables of the vehicle controller's power-on read / write data and power-off storage data, and comparing the underlying data, the test results are obtained, avoiding the probability of manual testing errors. Repeatable testing is possible, effectively improving the reliability of the integrated data storage of the vehicle controller's hardware and software.

[0086] In one embodiment of this application, multiple power-off data storage test cases are generated based on the power-off data storage configuration information, including:

[0087] Based on the power-down data storage configuration information, the first condition variable value corresponding to the power-down of the target vehicle controller key is determined, wherein the power-down of the key is used to control the target controller to enter a sleep state;

[0088] Based on the value of the first condition variable, a first test case, a second test case, and a third test case are generated corresponding to the power-off after the target vehicle controller completes storage. The first test case is used to indicate that the power is cut off after real-time storage is completed, the second test case is used to indicate that no read / write task is executed and the power is cut off after non-real-time storage is completed, and the third test case is used to indicate that read / write task is executed and the power is cut off after non-real-time storage is completed.

[0089] Based on the value of the first condition variable, a fourth test case and a fifth test case are generated corresponding to the power-off when the target vehicle controller storage is not completed. The fourth test case is used to indicate power-off when real-time storage is not completed, and the fifth test case is used to indicate power-off when non-real-time storage is not completed.

[0090] In one embodiment of this application, multiple power-off data storage test cases are generated based on the power-off data storage configuration information, including:

[0091] Based on the power-down data storage configuration information, the second condition variable value corresponding to the constant power supply of the target vehicle controller is determined, wherein the constant power supply is used to control the target controller to enter a power-off state;

[0092] Based on the second condition variable, a sixth test case and a seventh test case are generated corresponding to the power-off of the target vehicle controller after storage completion. The sixth test case is used to indicate power-off when real-time storage is completed, and the seventh test case is used to indicate power-off when non-real-time storage is completed.

[0093] Based on the second condition variable, an eighth test case and a ninth test case are generated corresponding to the power-off when the target vehicle controller storage is not completed. The eighth test case is used to indicate power-off when real-time storage is not completed, and the ninth test case is used to indicate power-off when non-real-time storage is not completed.

[0094] For example, see Figure 3 , Figure 3 This is a schematic diagram illustrating the test case design process of an exemplary embodiment of this application. Figure 3 As shown, select the target vehicle controller power-off method according to actual test needs. If the key powers off, power-off condition variables and variable values ​​need to be added. For the controller power-off timing, if power-off is performed before storage is completed, the power-off time needs to be set to be less than the power-off storage function's running time range T1. Whether real-time storage is required, if real-time storage is required, the real-time storage flag needs to be set. Whether power-on data reading should be performed without executing the task before power-off, if not, the programmable power supply needs to be controlled to perform a second power-on and power-off; otherwise, the test case generation ends. Figure 3The test case numbers and their corresponding situations are as follows: Test Case 1, real-time storage completes and key is powered off; Test Case 2, power on to read data but does not execute the task and then key is powered off; Test Case 3, key is powered off and stored; Test Case 4, real-time storage is not completed and key is powered off; Test Case 5, storage is not completed and key is powered off; Test Case 6, real-time storage completes and normal power is applied; Test Case 7, normal power is applied and stored; Test Case 8, real-time storage is not completed and normal power is applied; Test Case 9, storage is not completed and normal power is applied.

[0095] In one embodiment of this application, executing the plurality of power-off data storage test cases includes:

[0096] Call the preset execution count and execution order corresponding to each of the power-off data storage test cases;

[0097] According to the preset number of executions and execution order, each of the power-off data storage test cases is executed sequentially.

[0098] In one embodiment of this application, after obtaining the data storage test results, the method further includes:

[0099] According to the preset storage block classification, the first and second data variables of the target vehicle controller with normal data storage function are sorted by column, and the sorted first and second data variables are displayed according to the execution order of the multiple power-down data storage test cases. If the first and second data variables are identical, the data storage function of the target vehicle controller is normal; and / or,

[0100] According to the preset storage block classification, the first and second data variables of the target vehicle controller with abnormal data storage function are sorted by column, and the sorted first and second data variables are displayed according to the execution order of the multiple power-down data storage test cases. If the first data variable and the second data variable are inconsistent, the data storage function of the target vehicle controller is abnormal.

[0101] In one embodiment of this application, powering on the target vehicle controller via a power source connected to the target vehicle controller includes:

[0102] According to the preset first initialization time and first voltage, the power supply is controlled to provide the target vehicle controller with the first voltage for the first time within the first initialization time, and the first current value corresponding to the first power supply is called.

[0103] If the first current value is greater than the preset power supply current threshold, then according to the preset second initialization time and second voltage, the power supply is controlled to provide a second power supply to the target vehicle controller through the second voltage within the second initialization time to wake up the target vehicle controller, and the second current value corresponding to the second power supply is called. The second current value is used to indicate whether the target vehicle controller is in working state.

[0104] In one embodiment of this application, after calling the second current value corresponding to the second power supply, the method further includes:

[0105] The second current value is compared with a preset operating current threshold.

[0106] If the second current value is greater than the operating current threshold, then the status information of the target vehicle controller is invoked;

[0107] If the status information of the target vehicle controller is normal, then the code file in the target vehicle controller is called to obtain the first data variable when the target vehicle controller performs data reading and writing through the code file.

[0108] For example, see Figure 4 , Figure 4 This is a schematic diagram illustrating the test case implementation process of an exemplary embodiment of this application. First, the programmable power supply and Trace32 are initialized. The controller is powered on using V1 and V2. The controller's successful startup is determined by setting the I2 value when V2 is powered on. The Trace32 status is read to determine if the controller under test is being controlled correctly. The controller code file is loaded using API commands, and the controller starts working. The cmm file is imported and written to storage. Python is used to assign random values ​​to the variables written to storage and save the corresponding variable names and values. According to the test case, if storage is not complete, the programmable power supply V3 / V4 is powered down according to the power-down function's runtime range T1. The success of the power-down is determined by the current I3 or I4. After a power-down duration T2 or T3, the programmable power supply is powered on. Depending on the test case, it is selected whether to power on and off again. The API command reads the Trace32 status, saves the variable names and values ​​read from the cmm file, and uses a Python script to compare the corresponding written and read variable values. If they match, the test passes; otherwise, the test fails. The test results are saved, and the test ends.

[0109] In one embodiment of this application, participants Figure 5 , Figure 5 This is a schematic diagram of the main framework of a test script, as illustrated in an exemplary embodiment of this application. Figure 5 The main framework of the test script shown includes:

[0110] The test condition setting module mainly involves setting test conditions according to test needs, selecting test cases, and defining the format of the generated test report. It allows setting the voltage values ​​V1, V2, V3, and V4 of the programmable power supply, selecting test cases, setting the number of times each test case can be executed, and setting the range of sleep time T2 and sleep time T3.

[0111] Programmable power supply control module: Primarily used for initialization. It sets the two power supply channels of the programmable power supply via GPIB-USB to ensure correct controller operation. The host computer controls the programmable power supply voltage and acquires its current information. This current information is used for controller data storage testing, including: initially, the programmable power supply has no output, the controller is powered off, and the two power supply channels are connected to the controller's VBAT pin and either wake-up source pin (the wake-up source pin can be connected according to the actual controller's support). The negative terminal of the power supply is connected to the controller's GND pin. The host computer initializes the programmable power supply via GPIB-USB. After a preset initialization time, the host computer turns on the programmable power supply voltage via the first preset V1 and receives the first power-on current I1 via GPIB-USB. The host computer also turns on the wake-up voltage via the second preset V2 and receives the second operating current I2 via GPIB-USB. When the key power-off condition in the test case is met, the host computer sets the second wake-up power supply channel to the external sleep condition via the third sleep voltage V3. At this point, Trace32... The API executes the controller's sleep command and receives the third sleep current I3 of the programmable power supply via GPIB-USB. When the power condition is normal, the host computer sets the first wake-up power supply of the programmable power supply to the non-operating condition through the fourth normal voltage V4 and receives the fourth normal current I4 of the programmable power supply via GPIB-USB. After the second preset sleep time T2, the host computer controls V2 to turn on the wake-up voltage of the programmable power supply and controls Trace32 to open the internal observation variables of the controller under test via the Trace32 API command. After the third preset normal power time T3, the host computer controls V1 to turn on the power supply voltage of the programmable power supply.

[0112] The Trace32 control module is primarily used to initialize Trace32 and execute API commands to control the operation of the controller under test. It includes writing API commands for controller power-on detection, importing controller code files, controller reset and run commands, assigning power-down condition variables, importing and saving CMM files, assigning real-time storage flags, and setting breakpoints for incomplete storage before power-down.

[0113] The constraint setting module is mainly used to detect deviations in the test environment or whether the controller under test deviates from the range of certain parameters during the test. For example, if it detects that the programmable power supply or Trace32 has lost control, or that the controller under test is in an incorrect state or cannot be controlled after Trace32 executes commands, or that the current value is not within the correct operating range, then the test will terminate.

[0114] The module for capturing input cmm files calls the controller's stored function, uses Python to identify and enumerate read and write variables in the capture code by keyword, then categorizes them into blocks according to variable names, and compiles them into a callable cmm file according to the Trace32 format requirements.

[0115] Test condition discrimination module: used to discriminate and process test steps, test case implementation steps, etc.

[0116] Results processing module: Compares the values ​​of the written and read storage variables and determines the test results.

[0117] Test Report Module: Generates test report results according to format requirements, increasing data readability. For example, it categorizes input and output variable values ​​by different blocks, arranges them in columns, and displays whether the stored variables are consistent. It judges the storage result of each test case as success or failure. It stores specific test data in the execution order.

[0118] In one embodiment of this application, see Figure 6 , Figure 6 This is a flowchart illustrating a vehicle controller data storage test method, as shown in another exemplary embodiment of this application. Figure 6 The on-board controller data storage test method shown includes the following steps:

[0119] Programmable power supply initialization;

[0120] Determine if the programmable power supply initialization was successful; otherwise, exit the test.

[0121] Trace32 initialization;

[0122] Check if Trace32 initialization was successful; otherwise, exit the test.

[0123] Read test cases;

[0124] Start testing;

[0125] Test case ID (sequence flag) + 1;

[0126] Execute test cases;

[0127] Acquire data;

[0128] Verify the test results;

[0129] Determine if the test result is valid; if invalid, save the test result.

[0130] Test case execution count +1;

[0131] Determine if the test case has finished executing; otherwise, repeat the execution of the test case.

[0132] Determine if the test case ID has ended; otherwise, begin executing the next test case.

[0133] Save the test results;

[0134] Test complete.

[0135] Figure 7 This is a block diagram illustrating an exemplary embodiment of an in-vehicle controller data storage testing apparatus according to this application. The apparatus can be applied to… Figure 1 The implementation environment shown is not limited to this embodiment. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.

[0136] like Figure 7 As shown, the exemplary vehicle controller data storage test apparatus includes:

[0137] The information acquisition module 701 is used to acquire the power-off data storage configuration information of the target vehicle controller;

[0138] The test case generation module 702 is used to generate multiple power-off data storage test cases based on the power-off data storage configuration information.

[0139] The power-on control module 703 is used to power on the target vehicle controller through a power supply connected to the target vehicle controller, so as to wake up the target vehicle controller to perform data reading and writing, and call the first data variable when the target vehicle controller performs data reading and writing;

[0140] The power-down control module 704 is used to execute the plurality of power-down data storage test cases to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and to call the second data variable when the target vehicle controller performs power-down data storage;

[0141] The test result generation module 705 is used to compare the first data variable and the second data variable to obtain the data storage test result.

[0142] In this exemplary vehicle controller data storage testing device, the vehicle controller data storage testing method can be directly applied to the host computer. The host computer first generates multiple test cases based on the power-off data storage configuration information, which can include the key power-off data storage status and the normal power-off data storage status of the vehicle controller, increasing the data storage coverage. Through the host computer, data storage testing can be performed on multiple vehicle controllers during the development phase to discover controller data storage problems, greatly saving manpower, material resources, and time costs. By acquiring the data variables of the vehicle controller's power-on read / write data and power-off storage data, and comparing the underlying data, the test results are obtained, avoiding the probability of manual testing errors. Repeatable testing is possible, effectively improving the reliability of the integrated data storage of the vehicle controller's hardware and software.

[0143] It should be noted that the vehicle controller data storage testing device and the vehicle controller data storage testing method provided in the above embodiments belong to the same concept. The specific operation methods of each module and unit have been described in detail in the method embodiments and will not be repeated here. In practical applications, the vehicle controller data storage testing device provided in the above embodiments 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. This is not a limitation here.

[0144] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the vehicle controller data storage test method provided in the above embodiments.

[0145] Figure 8 A schematic diagram of a computer system suitable for an electronic device according to an embodiment of this application is shown. It should be noted that... Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0146] like Figure 8As shown, the computer system 800 includes a Central Processing Unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 802 or programs loaded from Storage Unit 808 into Random Access Memory (RAM) 803, such as performing the methods described in the above embodiments. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An Input / Output (I / O) interface 805 is also connected to the bus 804.

[0147] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.

[0148] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs various functions defined in the system of this application.

[0149] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0150] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0151] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0152] Another aspect of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the vehicle controller data storage test method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0153] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the vehicle controller data storage test method provided in the various embodiments described above.

[0154] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A method for testing data storage of an on-board controller, characterized in that, The method includes: Obtain the power-down data storage configuration information of the target vehicle controller; Based on the power-down data storage configuration information, multiple power-down data storage test cases are generated; based on the power-down data storage configuration information, a first condition variable value corresponding to the power-down of the target vehicle controller key is determined, wherein the power-down of the key is used to control the target controller to enter a sleep state; based on the first condition variable value, a first test case, a second test case, and a third test case corresponding to the power-down of the target vehicle controller after storage completion are generated, wherein the first test case is used to indicate power-off after real-time storage is completed, the second test case is used to indicate that no read / write tasks are executed and power is cut off after non-real-time storage is completed, and the third test case is used to indicate that read / write tasks are executed and power is cut off after non-real-time storage is completed; Power is supplied to the target vehicle controller via a power source connected to the target vehicle controller, thereby waking up the target vehicle controller to perform data reading and writing, and calling the first data variable when the target vehicle controller performs data reading and writing. The multiple power-down data storage test cases are executed to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and to call the second data variable when the target vehicle controller performs power-down data storage; The first data variable and the second data variable are compared to obtain the data storage test results.

2. The vehicle controller data storage test method according to claim 1, characterized in that, Based on the power-down data storage configuration information, multiple power-down data storage test cases are generated, including: Based on the value of the first condition variable, a fourth test case and a fifth test case are generated corresponding to the power-off when the target vehicle controller storage is not completed. The fourth test case is used to indicate power-off when real-time storage is not completed, and the fifth test case is used to indicate power-off when non-real-time storage is not completed.

3. The vehicle controller data storage test method according to claim 2, characterized in that, Based on the power-down data storage configuration information, multiple power-down data storage test cases are generated, including: Based on the power-down data storage configuration information, the second condition variable value corresponding to the constant power supply of the target vehicle controller is determined, wherein the constant power supply is used to control the target controller to enter a power-off state; Based on the second condition variable, a sixth test case and a seventh test case are generated corresponding to the power-off of the target vehicle controller after storage completion. The sixth test case is used to indicate power-off when real-time storage is completed, and the seventh test case is used to indicate power-off when non-real-time storage is completed. Based on the second condition variable, an eighth test case and a ninth test case are generated corresponding to the power-off when the target vehicle controller storage is not completed. The eighth test case is used to indicate power-off when real-time storage is not completed, and the ninth test case is used to indicate power-off when non-real-time storage is not completed.

4. The vehicle controller data storage test method according to claim 1, characterized in that, Execute the multiple power-down data storage test cases, including: Call the preset execution count and execution order corresponding to each of the power-off data storage test cases; According to the preset number of executions and execution order, each of the power-off data storage test cases is executed sequentially.

5. The vehicle controller data storage test method according to claim 1, characterized in that, After obtaining the data storage test results, the following is also included: According to the preset storage block classification, the first and second data variables of the target vehicle controller with normal data storage function are sorted by column, and the sorted first and second data variables are displayed according to the execution order of the multiple power-down data storage test cases. If the first and second data variables are identical, the data storage function of the target vehicle controller is normal; and / or, According to the preset storage block classification, the first and second data variables of the target vehicle controller with abnormal data storage function are sorted by column, and the sorted first and second data variables are displayed according to the execution order of the multiple power-down data storage test cases. If the first data variable and the second data variable are inconsistent, the data storage function of the target vehicle controller is abnormal.

6. The vehicle controller data storage test method according to claim 3, characterized in that, Powering on the target vehicle controller via a power source connected to the target vehicle controller includes: According to the preset first initialization time and first voltage, the power supply is controlled to provide the target vehicle controller with the first voltage for the first time within the first initialization time, and the first current value corresponding to the first power supply is called. If the first current value is greater than the preset power supply current threshold, then according to the preset second initialization time and second voltage, the power supply is controlled to provide a second power supply to the target vehicle controller through the second voltage within the second initialization time to wake up the target vehicle controller, and the second current value corresponding to the second power supply is called. The second current value is used to indicate whether the target vehicle controller is in working state.

7. The vehicle controller data storage test method according to claim 6, characterized in that, After calling the second current value corresponding to the second power supply, it also includes: The second current value is compared with a preset operating current threshold. If the second current value is greater than the operating current threshold, then the status information of the target vehicle controller is invoked; If the status information of the target vehicle controller is normal, then the code file in the target vehicle controller is called to obtain the first data variable when the target vehicle controller performs data reading and writing through the code file.

8. A vehicle-mounted controller data storage and testing device, characterized in that, The device includes: The information acquisition module is used to acquire the power-off data storage configuration information of the target vehicle controller; The test case generation module is used to generate multiple power-down data storage test cases based on the power-down data storage configuration information; determine the first condition variable value corresponding to the power-down of the target vehicle controller key based on the power-down data storage configuration information, wherein the power-down of the key is used to control the target controller to enter a sleep state; and generate a first test case, a second test case, and a third test case corresponding to the power-down of the target vehicle controller after storage completion based on the first condition variable value, wherein the first test case is used to indicate power-off after real-time storage is completed, the second test case is used to indicate that no read / write tasks are executed and power is cut off after non-real-time storage is completed, and the third test case is used to indicate that read / write tasks are executed and power is cut off after non-real-time storage is completed. The power-on control module is used to power on the target vehicle controller through a power supply connected to the target vehicle controller, so as to wake up the target vehicle controller to perform data reading and writing, and call the first data variable when the target vehicle controller performs data reading and writing; The power-down control module is used to execute the multiple power-down data storage test cases to control the target vehicle controller to perform power-down data storage and / or data reading and writing, and to call the second data variable when the target vehicle controller performs power-down data storage; The test result generation module is used to compare the first data variable and the second data variable to obtain the data storage test result.

9. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the vehicle controller data storage test method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by the computer's processor, causes the computer to perform the vehicle controller data storage test method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Storage automation testing method and device capable of dynamically adjusting resources

    CN114647593A

  • Vehicle-mounted controller test platform and test method

    CN114675626A

  • New energy vehicle driving data up-down electric storage system and control method

    CN109130866A

  • Model-in-loop test method and device

    CN110096445A