Stability test method and device of vehicle-mounted system, electronic equipment and storage medium
By combining central processor, memory and parallel stress testing, the problem of vehicle system stability test errors and single test types is solved, achieving more accurate stability assessment and discovering potential load vulnerabilities.
Patent Information
- Application Number
- CN202410869587.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-15
AI Technical Summary
The stability test of the existing vehicle system has large test errors, cannot provide sufficient test pressure, and has a single test type, which cannot fully reflect the stability of the vehicle system.
Using a combination of CPU stress testing, memory stress testing, and CPU and memory parallel stress testing, the vehicle-mounted system is comprehensively tested through different types of test methods, and a weighted sum is performed based on the test duration and test scores to determine the vehicle-mounted system. System stability level.
It improves the accuracy and referenceability of the test results, can more intuitively reflect the stability of the vehicle system, discovers potential load vulnerabilities in the central processor and memory, and ensures the reliability of the test results.
Smart Images

Figure CN118779168A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a stability testing method, device, electronic device and storage medium for a vehicle-mounted system. Background Art
[0002] With the development of the vehicle field, the demand for functional integration is increasing day by day, which increases the load on the vehicle system and requires a large amount of data processing and data analysis to ensure the stability of the vehicle system during use.
[0003] Before the vehicle system leaves the factory, it is usually manually randomly checked and tested, which has obvious test errors and cannot give the vehicle system enough test pressure, resulting in the test results not being able to truly reflect the stability of the vehicle system. At the same time, the existing tests are generally of a single type and can only expose problems with a single application in the vehicle system, but cannot reflect problems with the entire vehicle system. Summary of the invention
[0004] In view of the above problems, the present application provides a stability testing method, device, electronic device and storage medium for a vehicle-mounted system, which are used to perform multiple types of stress tests on the vehicle-mounted system to comprehensively test the stability of the vehicle-mounted system.
[0005] According to one aspect of the present application, a stability testing method for an in-vehicle system is provided, the stability testing method comprising: performing a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the in-vehicle system to obtain scores for each test; wherein the test duration corresponding to the central processing unit and memory parallel stress test is greater than the test duration corresponding to the central processing unit stress test and the memory stress test; summing the products of each test score and their corresponding preset weighting coefficients, and determining the stability level of the in-vehicle system based on the calculated sum.
[0006] In an optional manner, the vehicle-mounted system includes a main system and a sub-system; the vehicle-mounted system is subjected to a CPU stress test, a memory stress test, and a CPU and memory parallel stress test to obtain various test scores, further comprising: binding a preset number of threads to a core corresponding to the sub-system, controlling each thread to perform cumulative operations, and controlling the main system to monitor whether a designated process crashes within a first preset time period; recording a first operation time from the start time of the cumulative operation to the time when the designated process crashes; and calculating a test score corresponding to the CPU stress test based on the first operation time and the first preset time period.
[0007] In an optional manner, the vehicle-mounted system is subjected to a CPU stress test, a memory stress test, and a CPU and memory parallel stress test to obtain various test scores, and further includes: determining a target occupancy rate based on the current remaining memory capacity of the subsystem; occupying the current remaining memory capacity according to the target occupancy rate, and controlling the main system to monitor whether the designated process crashes within the first preset time period; recording a second computing time from the start time of memory occupancy to the time when the designated process crashes; and calculating a test score corresponding to the memory stress test based on the second computing time and the first preset time period.
[0008] In an optional manner, determining the target occupancy speed based on the current remaining memory capacity of the vehicle-mounted system further includes: if the current remaining memory capacity of the subsystem is greater than a first preset threshold, using the preset first memory occupancy speed as the target occupancy speed; if the current remaining memory capacity of the subsystem is less than or equal to the first preset threshold, using the preset second memory occupancy speed as the target occupancy speed; wherein the preset first memory occupancy speed is greater than the preset second memory occupancy speed.
[0009] In an optional manner, the vehicle-mounted system is subjected to a CPU stress test, a memory stress test, and a CPU and memory parallel stress test to obtain scores for each test, and further includes: simultaneously performing a CPU stress test and a memory stress test on the vehicle-mounted system, and controlling the main system to monitor whether the designated process crashes within a second preset time period; wherein the second preset time period is greater than the first preset time period; recording a third computing time period from the start time of the parallel test to the time when the designated process crashes; and calculating the test score corresponding to the CPU and memory parallel stress test based on the ratio between the third computing time period and the second preset time period.
[0010] In an optional manner, the stability testing method also includes: if the test score corresponding to the CPU stress test is less than a preset test score, it indicates that there is a CPU load vulnerability in the vehicle system; if the test score corresponding to the memory stress test is less than the preset test score, it indicates that there is a memory load vulnerability in the vehicle system.
[0011] In an optional manner, determining the stability level of the vehicle-mounted system based on the calculated sum value further includes: matching the calculated sum value with a preset score to obtain a successfully matched preset score; and using the preset stability level corresponding to the successfully matched preset score as the stability level of the vehicle-mounted system.
[0012] According to another aspect of the present application, a stability testing device for a vehicle-mounted system is provided, and the stability testing device includes: a testing module, used to perform a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle-mounted system to obtain scores for each test; wherein the test duration corresponding to the central processing unit and memory parallel stress test is greater than the test duration corresponding to the central processing unit stress test and the memory stress test; a determination module, used to sum the products of each test score and their corresponding preset weighting coefficients, and determine the stability level of the vehicle-mounted system based on the calculated sum.
[0013] According to one aspect of the present application, an electronic device is provided, including: a controller; and a memory for storing one or more programs, which, when executed by the controller, perform the above-mentioned stability testing method.
[0014] According to one aspect of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned stability testing method.
[0015] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned stability testing method.
[0016] This application introduces CPU stress test, memory stress test, CPU and memory parallel stress test, and comprehensively tests the stability of the vehicle system through different types of test methods. In the test process, the test duration of the corresponding test is considered, and the factors affecting the accuracy of the test results are considered from different levels, so as to ensure the reference and accuracy of the test results. At the same time, this application sums the products of each test result and the corresponding preset weighting coefficient, and determines the accurate stability level of the vehicle system based on the sum value. The stability level can more intuitively reflect the stability of the vehicle system.
[0017] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 It is a flowchart of a stability testing method of a vehicle-mounted system shown in an exemplary embodiment of the present application.
[0020] Figure 2 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for testing the stability of an in-vehicle system.
[0021] Figure 3 It is a schematic diagram of the structure of an exemplary vehicle-mounted system of the present application.
[0022] Figure 4 is based on Figure 3 Detailed structural diagram of the vehicle system shown.
[0023] Figure 5 It is a flowchart of a CPU stress test shown in an exemplary embodiment of the present application.
[0024] Figure 6 It is a flowchart of a memory stress test shown in an exemplary embodiment of the present application.
[0025] Figure 7 1 is a schematic diagram of the structure of a stability testing device for a vehicle-mounted system shown in an exemplary embodiment of the present application.
[0026] Figure 8 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0027] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0028] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0029] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0030] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0031] Before existing vehicle systems leave the factory, they are generally manually randomly tested, which results in obvious test errors and fails to provide sufficient test pressure on the vehicle systems, causing the test results to fail to truly reflect the stability of the vehicle systems. At the same time, existing tests are generally of a single type and can only expose problems with a single application in the vehicle system, but cannot reflect problems with the entire vehicle system.
[0032] To this end, one aspect of the present application provides a method for testing the stability of a vehicle-mounted system. Figure 1 , Figure 1 1 is a flow chart of a stability test method of a vehicle-mounted system shown in an exemplary embodiment of the present application. The stability test method at least includes S110 to S120, which are described in detail as follows:
[0033] S110: Performing a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle system to obtain test scores for each test; wherein the test duration corresponding to the central processing unit and memory parallel stress test is greater than the test duration corresponding to the central processing unit stress test and the memory stress test.
[0034] The CPU (Central Processing Unit) is one of the main devices of an electronic computer and a core component in a computer. Its main function is to interpret computer instructions and process data in computer software. The CPU is the core component responsible for reading instructions, decoding instructions and executing instructions for all operations in the computer. In this embodiment, the stress test for the central processing unit includes but is not limited to floating-point accumulation calculations, so as to test the processing power and stress resistance of the central processing unit of the vehicle system through high computing requirements.
[0035] Memory is an important component of a computer, also known as internal memory and main memory. It is used to temporarily store the calculation data in the CPU, as well as the data exchanged with external memory such as the hard disk. It is a bridge for communication between the external memory and the CPU. All programs in the computer are run in the memory. The strength of the memory performance affects the overall performance of the computer. As long as the computer starts running, the operating system will transfer the data that needs to be calculated from the memory to the CPU for calculation. When the calculation is completed, the CPU will transmit the result. The operation of the memory determines the overall speed of the computer. In this embodiment, the stress test on the memory includes but is not limited to the memory occupancy method, the memory consumption method, etc., and the pressure resistance of the vehicle system memory is tested by reducing the remaining available memory.
[0036] The CPU and memory parallel stress test refers to the simultaneous stress test of the CPU and memory. Because a single CPU stress test or a single memory stress test can only partially reflect the stress resistance of the CPU or memory, and cannot know the comprehensive stress resistance of the vehicle system, this embodiment combines different factors that affect the stability of the vehicle system on the basis of a single type of stress test, and extends the test time of the multi-factor combined test, which improves the accuracy of the vehicle system stability level to a certain extent.
[0037] Furthermore, if the test score corresponding to the CPU stress test is less than the preset test score, it indicates that the vehicle system has a CPU load vulnerability; if the test score corresponding to the memory stress test is less than the preset test score, it indicates that the vehicle system has a memory load vulnerability. The preset test score can be adjusted according to actual conditions, and this embodiment does not limit its specific value.
[0038] For example, the preset test score is 60 points. If the test score corresponding to the CPU stress test is less than 60 points, it indicates that there is a CPU load vulnerability in the vehicle system; if the test score corresponding to the memory stress test is less than 60 points, it indicates that there is a memory load vulnerability in the vehicle system.
[0039] S120: performing a sum operation on the products of each test score and the corresponding preset weighting coefficient, and determining the stability level of the vehicle system according to the calculated sum.
[0040] This embodiment does not limit the specific values of each preset weighting coefficient. The influence of each test score on the stability level can be adaptively adjusted by adjusting the values of the corresponding preset weighting coefficients.
[0041] Exemplarily, the calculated sum is matched with the preset score to obtain the preset score of successful matching; the preset stability level corresponding to the preset score of successful matching is used as the stability level of the vehicle-mounted system. The preset score interval of successful matching is determined according to the calculated sum, and the corresponding preset stability level is used as the stability level of the vehicle-mounted system. Table 1 is a relationship table between the preset score interval and the preset stability level.
[0042] Table 1: Relationship between preset score ranges and preset stability levels
[0043] Preset score range Preset stability levels (0,20] First stability level (20,40] Second stability level (40,60] Third stability level …… ……
[0044] This embodiment introduces CPU stress test, memory stress test, CPU and memory parallel stress test, and comprehensively tests the stability of the vehicle system through different types of test methods. In the test process, the test duration of the corresponding test is considered, and the factors affecting the accuracy of the test results are considered from different levels, so as to ensure the reference and accuracy of the test results. At the same time, this embodiment sums the products of each test result and the corresponding preset weighting coefficient, and determines the accurate stability level of the vehicle system based on the sum value, which can more intuitively reflect the stability of the vehicle system through the stability level.
[0045] In another exemplary embodiment of the present application, it is described in detail how to perform a CPU stress test, a memory stress test, and a CPU and memory stress test on a vehicle system to obtain various test scores. For details, please refer to Figure 2 , Figure 2 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for testing the stability of an on-vehicle system. Figure 1 The S110 shown further includes S210 to S230; wherein the vehicle-mounted system includes a main system and a sub-system, which are described in detail as follows:
[0046] S210: Bind a preset number of threads to cores corresponding to the secondary system, control each thread to perform accumulation operations, and control the primary system to monitor whether a designated process crashes within a first preset time period.
[0047] The accumulation operation may be a floating-point accumulation operation, for example, accumulation from 1.0 to 100000000.0, and looping 10,000 times. Because floating-point operations are very CPU-intensive, this accumulation algorithm is very CPU-intensive. In theory, each thread can completely occupy the CPU time slice on the corresponding core.
[0048] Each thread can perform cumulative operations step by step in sequence, and after the corresponding thread operation is completed, the next thread is controlled to perform cumulative operations. In addition, multiple threads can also perform cumulative operations in parallel, that is, multiple threads or all threads perform cumulative operations at the same time.
[0049] Because the vehicle-mounted system of this embodiment has a distinction between primary and secondary systems, it is necessary to allocate cores. For example, the vehicle-mounted system has a total of 8 cores, 2 cores are allocated to the primary system, and 6 cores are allocated to the secondary system. In the process of binding the secondary system cores and threads, each thread is bound to a core, so that the threads and cores correspond one to one, so that the number of threads and the number of cores are the same, that is, the preset number is the number of cores of the secondary system, that is, 6. The advantage of binding the core is that the CPU can be occupied by the cores to achieve step-by-step or synchronous accumulation operations in the form of threads, so as to meet the corresponding test requirements.
[0050] In order to control the CPU load and increase the pressure, the threads are started in the order of every two minutes. Thread 1 is started first, and thread 2 is started two minutes later and runs on core 3. And so on. Finally, 6 threads run at the same time. The total stress test lasts 15 minutes. Theoretically, when 6 threads run at the same time, the CPU load will reach the highest. From the start of thread 1 to the start of thread 6 within 15 minutes, if the system can continue to run and the main system does not monitor the crash of the qvm process, it means that there is no problem with the CPU load of the vehicle system in a short time. If the process crashes, it means that there is a CPU load vulnerability in the vehicle system and the vulnerability needs to be further repaired.
[0051] The main system monitors the qvm process (the designated process in this embodiment) and records the crash time of the qvm process within a preset time period.
[0052] Among them, the main system mainly runs instrument-related programs and manages qvm processes, which can directly access hardware resources; the secondary system mainly runs related programs of the vehicle's central control entertainment information screen, and its operating system runs in the qvm process of the main system, and its access to hardware resources is obtained indirectly through the main system.
[0053] S220: Recording the first operation duration from the start time of the cumulative operation to the time when the specified process crashes.
[0054] If the process does not crash within the first preset time, the first operation time is not recorded, that is, the first operation time is empty, and there is no need to perform corresponding calculations, and the test score corresponding to the CPU stress test is directly determined to be full marks.
[0055] In some embodiments, if the process does not crash within a first preset time period, the first operation time period is recorded as the first preset time period. For example, if the first preset time period is 15 minutes, the first operation time period is recorded as 15 minutes, so that the test score corresponding to the CPU stress test obtained by subsequent calculation is full marks.
[0056] S230: Calculate a test score corresponding to the CPU stress test according to the first operation duration and the first preset duration.
[0057] Exemplarily, the first operation duration is divided by the first preset duration, and the obtained quotient is multiplied by the preset value to obtain the test score corresponding to the CPU stress test. For example, the first operation duration is 10 minutes, the first preset duration is 15 minutes, and the preset value is 100, then the test score corresponding to the CPU stress test is (10 / 15)×100≈66.7. For another example, the first preset duration is 15 minutes, the preset value is 100, and the specified process does not crash within the 15 minutes, then the first operation duration is recorded as 15 minutes, then the test score corresponding to the CPU stress test is (15 / 15)×100=100.
[0058] In this embodiment, the main and secondary systems cooperate with each other. Each core of the secondary system is bound to a thread, and corresponding accumulation operations are performed in the form of threads. The main system acts as a monitoring end to monitor the specified process to complete the central processing unit stress test.
[0059] In another exemplary embodiment of the present application, it is further described how to calculate the test score corresponding to the memory stress test, that is, in the following example: Figure 1 The S110 shown also includes S240 to S270, which are described in detail as follows:
[0060] S240: Determine a target occupancy rate according to the current remaining memory capacity of the subsystem.
[0061] This embodiment can adjust the memory occupancy rate in real time according to the real-time remaining memory capacity of the subsystem, wherein the target occupancy rate can be determined by simply comparing the current remaining memory capacity with the corresponding preset threshold.
[0062] Exemplarily, if the current remaining memory capacity of the subsystem is greater than a first preset threshold, the preset first memory occupancy rate is used as the target occupancy rate; if the current remaining memory capacity of the subsystem is less than or equal to the first preset threshold, the preset second memory occupancy rate is used as the target occupancy rate; wherein the preset first memory occupancy rate is greater than the preset second memory occupancy rate.
[0063] For example, the total memory of the vehicle system is 12GB, and the total memory allocated to the subsystem is 7.7GB. If the current remaining memory capacity of the subsystem is greater than 0.77GB (10% of the total memory), the target occupancy rate is 50MB / second; if the current remaining memory capacity of the subsystem is less than 0.77GB (10% of the total memory), the target occupancy rate is 10MB / second. Because the subsystem has a memory recycling mechanism and the available memory of the subsystem changes dynamically, the memory occupancy rate in this embodiment changes in real time with the change of the available memory of the subsystem.
[0064] S250: occupying the remaining capacity of the current memory according to the target occupation speed, and controlling the main system to monitor whether the designated process crashes within a first preset time period.
[0065] S260: Recording a second operation duration from the start time of memory usage to the time when the specified process crashes.
[0066] If the process does not crash within the first preset time, the second operation time is not recorded, that is, the second operation time is empty, and there is no need to perform corresponding calculations, and the test score corresponding to the memory stress test is directly determined to be full marks.
[0067] In some embodiments, if the process does not crash within the first preset time period, the second operation time period is recorded as the first preset time period. For example, if the first preset time period is 15 minutes, the second operation time period is recorded as 15 minutes, so that the test score corresponding to the memory stress test obtained by subsequent calculation is full marks.
[0068] S270: Calculate a test score corresponding to the memory stress test according to the second operation duration and the first preset duration.
[0069] Exemplarily, the second operation duration is divided by the first preset duration, and the obtained quotient is multiplied by the preset value to obtain the test score corresponding to the memory stress test. For example, the second operation duration is 5 minutes, the first preset duration is 15 minutes, and the preset value is 100, then the test score corresponding to the CPU stress test is (5 / 15)×100≈33.3. For another example, the first preset duration is 15 minutes, the preset value is 100, and the specified process does not crash within the 15 minutes, then the second operation duration is recorded as 15 minutes, then the test score corresponding to the memory stress test is (15 / 15)×100=100.
[0070] In another exemplary embodiment of the present application, it is further described how to calculate the test scores corresponding to the CPU and memory parallel stress tests, that is, in the following example: Figure 1 The S110 shown also includes S280 to S282, which are described in detail as follows:
[0071] S280: Performing a central processing unit stress test and a memory stress test on the vehicle-mounted system simultaneously, and controlling the main system to monitor whether a specified process crashes within a second preset time period; wherein the second preset time period is greater than the first preset time period.
[0072] For example, in the process of single CPU stress test and memory stress test, the test duration can be set shorter, for example, a uniform test duration of 15 minutes. For CPU and memory parallel stress test (i.e., CPU stress test and memory stress test are performed simultaneously), a test duration of 24 hours is set, and a 24-hour composite multiple stress load test is performed to verify the stability of the vehicle system under long-term load.
[0073] S281: Record the third operation duration from the start time of the parallel test to the time when the specified process crashes.
[0074] If the process does not crash within the second preset time, the third operation time is not recorded, that is, the third operation time is empty, and there is no need to perform corresponding calculations, and the test scores corresponding to the CPU and memory parallel stress tests are directly determined to be full marks.
[0075] In some embodiments, if the process does not crash within the second preset time period, the third operation time period is recorded as the second preset time period. For example, if the second preset time period is 24 hours, the third operation time period is recorded as 24 hours, so that the test scores corresponding to the CPU and memory parallel stress tests obtained based on subsequent calculations are full marks.
[0076] S282: Calculate and obtain a test score corresponding to the CPU and memory parallel stress test according to a ratio between the third operation duration and the second preset duration.
[0077] Exemplarily, the third operation duration is divided by the second preset duration, and the obtained quotient is multiplied by the preset value to obtain the test score corresponding to the CPU and memory parallel stress test. For example, the third operation duration is 4 hours, the second preset duration is 24 hours, and the preset value is 100, then the test score corresponding to the CPU and memory parallel stress test is (4 / 24)×100≈16.7. For another example, the second preset duration is 24 hours, the preset value is 100, and the specified process does not crash within the 24 hours, then the third operation duration is recorded as 24 hours, then the test score corresponding to the CPU and memory parallel stress test is (24 / 24)×100=100.
[0078] In another exemplary embodiment of the present application, the above-mentioned vehicle-mounted system is exemplarily described. Figure 3 , Figure 3 Schematic diagram of the structure of an exemplary vehicle-mounted system of the present application. Figure 3 As shown, the vehicle system is an Android system. The main system of the Android vehicle system is Qnx OS. As the host, it mainly runs instrument-related programs and manages qvm processes. QnxOS can directly access hardware resources; the secondary system is Android OS. As the guest, it mainly runs programs related to the central control entertainment information screen. The operating system runs in the qvm process in Qnx OS, and its access to hardware resources is indirectly accessed through Qnx OS.
[0079] The CPU of the Android car system has 8 cores, of which 2 large cores are allocated to the Qnx OS system, and the remaining 6 cores are allocated to the Android OS. The Android car system has a total memory of 12GB, of which 7.7GB is allocated to the Android OS system (the above configuration can be configured by different car manufacturers). Since Android OS will run many applications, there are inevitably many resource-consuming applications, which will cause the CPU load to be too high, that is, the CPU is used too high and the memory is too large, which will eventually cause the Android OS to crash due to excessive CPU or memory load, and the corresponding qvm process in Qnx OS crashes. Among them, the multiple stress test APK in the AndroidOS system is used to perform corresponding tests; the keep-alive service can ensure that the multiple stress test APK will be run again after being killed by the system, so as to achieve the ability to detect the stability of the vehicle system for a long time. The service detects whether the multiple stress test application process exists every 10 seconds. If not, the application process is restarted. For details, please refer to Figure 4 , Figure 4 is based on Figure 3 Detailed structural diagram of the vehicle system shown.
[0080] The multiple stress test APK passes the CPU stress test to maximize the CPU resource usage, and passes the memory stress test to maximize the memory resource usage. The 24-hour long-term stress test is a multiple stress test that combines the CPU and memory at the same time. Among them, the multiple stress test apk may be killed by the system due to the high CPU load, and the application may appear ANR. It may be killed by the system's OOM mechanism when the system memory is insufficient because of the high memory usage. The function of the keep-alive service is to regularly check whether the application is dead. If it is dead, the application will be pulled up again to continue the stress test. The Qnx OS system monitors whether the qvm process crashes and restarts. For example, when the multiple stress apk is performing the CPU stress test, if the qvm process crashes and restarts, the vehicle system has a high CPU load vulnerability; if the multiple stress apk is performing the memory stress test, if the qvm process crashes and restarts, the vehicle system has a high memory load vulnerability; or if the long-term composite stress test (central processing unit and memory parallel stress test) crashes, there is a mixed load vulnerability.
[0081] The CPU stress test flow chart is as follows: Figure 5 As shown. The created 6 threads are bound to the cores corresponding to the subsystem, thread 1 is bound to core 2 (because the Qnx OS system uses cores 0 and 1, and the remaining cores 2 to 7 are reserved for the Android OS system), thread 2 is bound to core 3, and so on, thread 6 is bound to core 7. The advantage of binding the core is that the CPU can be controlled by core. Thread 1 is bound to core 2, which means that thread 1 can only run on core 2.
[0082] Control each thread to perform floating-point accumulation operations, from 1.0 to 100000000.0, loop 10000 times, and control the main system to monitor whether the qvm process crashes within 15 minutes. Specifically, in order to control the CPU load and increase the pressure, the threads are started in the order of every two minutes. The first thread to be started is thread 1, and thread 2 is started two minutes later, running on core 3, and so on. Finally, 6 threads are run at the same time, and the total pressure test is 15 minutes. Theoretically, when 6 threads are running at the same time, the CPU load will reach the highest. From the start of thread 1 to the start of thread 6 within 15 minutes, if the system can continue to run, and the Qnx OS system does not monitor the crash of the qvm process, it means that the vehicle system has no problem with the CPU load in a short period of time. If the process crashes, it means that there is a CPU load vulnerability in the vehicle system, which needs to be further repaired.
[0083] The flowchart of memory stress test is as follows: Figure 6As shown in the figure. Android applications can only occupy a maximum of 512MB of Java Heap memory. If the value exceeds this, the OOM mechanism will be triggered and the system will kill the application. If the application wants to occupy more memory, it can only occupy more memory through Native C++. In theory, the memory of the Android OS system can be exhausted. Therefore, the memory occupation method of this application is to apply for memory allocation in Native C++.
[0084] Exemplarily, the total memory allocated by the Android OS system is 7.7GB. If the current remaining memory capacity of the Android OS system is greater than 0.77GB (10% of the total memory), the target occupancy rate is 50MB / second; if the current remaining memory capacity of the Android OS system is less than 0.77GB (10% of the total memory), the target occupancy rate is 10MB / second. Because the Android OS system has a memory recovery mechanism and the available memory of the Android OS system changes dynamically, the memory occupancy rate in this embodiment changes in real time with the change of the available memory of the Android OS system. In theory, the available memory of the Android OS system will be occupied by the stress test APK. The memory stress test time is 15 minutes. If the Android OS system can continue to run and Qnx OS does not monitor the qvm process crash and restart, it means that the Android OS system has no problem with memory load in a short time. If the Android OS system crashes, it means that there is a memory load vulnerability in the vehicle system and further vulnerability repair is required.
[0085] Another aspect of the present application also provides a stability testing device for a vehicle-mounted system, such as Figure 7 As shown, Figure 7 : is a schematic diagram of a stability test device for a vehicle-mounted system according to an exemplary embodiment of the present application. The stability test device 700 includes:
[0086] The test module 710 is used to perform a CPU stress test, a memory stress test, and a CPU and memory parallel stress test on the vehicle system to obtain test scores for each item; wherein the test duration corresponding to the CPU and memory parallel stress test is greater than the test duration corresponding to the CPU stress test and the memory stress test.
[0087] The determination module 730 is used to sum the products of each test score and the corresponding preset weighting coefficient, and determine the stability level of the vehicle system according to the calculated sum.
[0088] In another exemplary embodiment, the vehicle system includes a main system and a subsystem; the test module 710 further includes:
[0089] The binding unit is used to bind a preset number of threads to the cores corresponding to the secondary system, control each thread to perform accumulation operations, and control the main system to monitor whether the specified process crashes within a first preset time period.
[0090] The first recording unit is used to record a first operation duration from the start time of the cumulative operation to the time when the specified process crashes.
[0091] The first calculation unit is used to calculate a test score corresponding to the central processing unit stress test according to the first operation duration and the first preset duration.
[0092] In another exemplary embodiment, the testing module 710 further includes:
[0093] The first determining unit is used to determine a target occupancy rate according to the current remaining memory capacity of the secondary system.
[0094] The first monitoring unit is used to occupy the current remaining memory capacity according to the target occupation speed, and control the main system to monitor whether the specified process crashes within a first preset time period.
[0095] The second recording unit is used to record a second operation duration from the start time of memory occupation to the time when the specified process crashes.
[0096] The second calculation unit is used to calculate a test score corresponding to the memory stress test according to the second operation duration and the first preset duration.
[0097] In another exemplary embodiment, the first determining unit further includes:
[0098] The first determination section is used to set a preset first memory occupancy rate as a target occupancy rate if the current remaining memory capacity of the secondary system is greater than a first preset threshold.
[0099] The second determination section is used to use a preset second memory occupancy rate as a target occupancy rate if the current remaining memory capacity of the secondary system is less than or equal to a first preset threshold; wherein the preset first memory occupancy rate is greater than the preset second memory occupancy rate.
[0100] In another exemplary embodiment, the testing module 710 further includes:
[0101] The second monitoring unit is used to perform a central processing unit stress test and a memory stress test on the vehicle-mounted system at the same time, and control the main system to monitor whether a specified process crashes within a second preset time period; wherein the second preset time period is greater than the first preset time period.
[0102] The third recording unit is used to record a third operation duration from the start time of the parallel test to the crash time of the specified process.
[0103] The third calculation unit is used to calculate the test score corresponding to the central processing unit and memory parallel stress test according to the ratio between the third operation time and the second preset time.
[0104] In another exemplary embodiment, the stability testing device 700 further includes:
[0105] The first vulnerability module is used to indicate that a CPU load vulnerability exists in the vehicle system if the test score corresponding to the CPU stress test is less than a preset test score.
[0106] The second vulnerability module is used to indicate that a memory load vulnerability exists in the vehicle system if the test score corresponding to the memory stress test is less than a preset test score.
[0107] In another exemplary embodiment, the determination module 730 further includes:
[0108] The matching unit is used to match the calculated sum value with a preset score to obtain a preset score for successful matching.
[0109] The stability level determination unit is used to use the preset stability level corresponding to the preset score of successful matching as the stability level of the vehicle-mounted system.
[0110] The stability test device of the present application introduces CPU stress test, memory stress test, and CPU and memory parallel stress test, and comprehensively tests the stability of the vehicle system through different types of test methods. In the test process, the test duration of the corresponding test is considered, and the factors affecting the accuracy of the test results are considered from different levels, so as to ensure the reference and accuracy of the test results. At the same time, the stability test device of the present application sums the products of each test result and the corresponding preset weighting coefficient, and determines the accurate stability level of the vehicle system based on the sum value, which can more intuitively reflect the stability of the vehicle system through the stability level.
[0111] It should be noted that the stability testing device provided in the above embodiment and the stability testing method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.
[0112] Another aspect of the present application provides an electronic device, including: a controller; a memory for storing one or more programs, when the one or more programs are executed by the controller, the above-mentioned stability testing method is executed.
[0113] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.
[0114] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0115] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0116] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, 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, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0117] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.
[0118] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0119] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0120] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0121] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the stability test method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0122] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the stability test method provided in each of the above embodiments.
[0123] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0124] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0125] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A stability testing method for a vehicle-mounted system, characterized in that: The stability testing method comprises: Performing a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle-mounted system to obtain test scores for each item; wherein the test duration corresponding to the central processing unit and memory parallel stress test is greater than the test duration corresponding to the central processing unit stress test and the memory stress test; The products of each test score and the corresponding preset weighting coefficient are summed up, and the stability level of the vehicle-mounted system is determined based on the calculated sum.
2. The stability testing method according to claim 1, characterized in that: The vehicle-mounted system includes a main system and a secondary system; The performing of a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle-mounted system to obtain various test scores further includes: Binding a preset number of threads to the core corresponding to the secondary system, controlling each thread to perform accumulation operation, and controlling the primary system to monitor whether a specified process crashes within a first preset time period; Record the first operation duration from the start time of the cumulative operation to the time when the specified process crashes; A test score corresponding to the central processing unit stress test is calculated according to the first operation duration and the first preset duration.
3. The stability testing method according to claim 2, characterized in that: The step of performing a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle-mounted system to obtain various test scores further includes: Determining a target occupancy rate according to the current remaining memory capacity of the subsystem; Occupying the remaining capacity of the current memory according to the target occupation speed, and controlling the main system to monitor whether the designated process crashes within the first preset time period; Recording a second operation duration from the start time of memory occupation to the time when the designated process crashes; A test score corresponding to the memory stress test is calculated according to the second operation duration and the first preset duration.
4. The stability testing method according to claim 3, characterized in that: The step of determining the target occupancy speed according to the current remaining memory capacity of the vehicle-mounted system further includes: If the current remaining memory capacity of the subsystem is greater than a first preset threshold, the preset first memory occupancy rate is used as the target occupancy rate; If the current remaining memory capacity of the subsystem is less than or equal to the first preset threshold, the preset second memory occupancy rate is used as the target occupancy rate; wherein the preset first memory occupancy rate is greater than the preset second memory occupancy rate.
5. The stability testing method according to claim 2, characterized in that: The step of performing a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle-mounted system to obtain various test scores further includes: Performing a central processing unit stress test and a memory stress test on the vehicle-mounted system at the same time, and controlling the main system to monitor whether the designated process crashes within a second preset time period; wherein the second preset time period is greater than the first preset time period; Recording a third operation duration from the start time of the parallel test to the crash time of the designated process; According to the ratio between the third operation duration and the second preset duration, a test score corresponding to the central processing unit and memory parallel stress test is calculated and obtained.
6. The stability testing method according to any one of claims 1 to 5, characterized in that: The stability testing method also includes: If the test score corresponding to the CPU stress test is less than the preset test score, it indicates that there is a CPU load vulnerability in the vehicle system; If the test score corresponding to the memory stress test is less than the preset test score, it indicates that there is a memory load vulnerability in the vehicle system.
7. The stability testing method according to any one of claims 1 to 5, characterized in that: Determining the stability level of the vehicle-mounted system according to the calculated sum value further includes: The calculated sum is matched with a preset score to obtain a preset score for successful matching; The preset stability level corresponding to the preset score of successful matching is used as the stability level of the vehicle-mounted system.
8. A stability testing device for a vehicle-mounted system, characterized in that: The stability testing device comprises: A test module, used for performing a central processing unit stress test, a memory stress test, and a central processing unit and memory parallel stress test on the vehicle-mounted system to obtain test scores for each item; wherein the test duration corresponding to the central processing unit and memory parallel stress test is greater than the test duration corresponding to the central processing unit stress test and the memory stress test; The determination module is used to sum the products of each test score and the corresponding preset weighting coefficient, and determine the stability level of the vehicle-mounted system according to the calculated sum.
9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by the controller, enables the controller to implement the stability testing method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the stability testing method according to any one of claims 1 to 7.
Citation Information
Cited By
Dual-system memory monitoring method, vehicle-mounted system, vehicle, equipment and storage medium
CN119226096A
