Memory performance test method and device, equipment and medium
By simulating memory usage scenarios on the car controller and selecting appropriate preset task execution applications, the test application can discover potential problems during the single board testing phase, improving the efficiency and accuracy of memory performance testing and reducing the need for subsequent troubleshooting. cost.
Patent Information
- Application Number
- CN202410824696.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-01
AI Technical Summary
During the test of the automotive controller single board, the memory usage is much lower than when the vehicle is running, and the memory performance of the controller cannot be effectively detected, making it difficult to detect potential problems in time.
By installing the test application on the target controller, query the memory sub-occupancy rate of the preset task execution application, select the application that meets the memory test requirements, simulate the memory occupancy process, collect status operating parameters, and determine the memory performance of the controller.
It improves the efficiency and accuracy of memory performance testing, can identify potential software and operating system problems during the single-board testing stage, and reduces the cost of troubleshooting in vehicle testing or market usage scenarios.
Smart Images

Figure CN118733362A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of controller performance testing, and in particular to a memory performance testing method, device, equipment and medium. Background Art
[0002] As the level of automobile electronics increases, more and more controllers in automobiles, such as ECU (Electronic Control Unit), begin to use A cores and UNIX-like operating systems such as Linux / QNX running on them.
[0003] During the development of automobiles, when a controller running the UNIX operating system is tested on a single board, its memory usage is much lower than the memory usage of the vehicle when it is running, and reliability issues on the controller system cannot be discovered in time. Therefore, how to test the memory performance of the operating system on the controller is an urgent problem that needs to be solved. Summary of the invention
[0004] The embodiments of the present application solve the technical problem in the prior art that the memory occupancy during the single-board testing of the controller is much lower than the memory occupancy during the operation of the vehicle, and thus the memory performance of the controller cannot be effectively detected by providing a memory performance testing method, device, equipment and medium. This achieves the technical effect of performing single-board testing on the controller according to the memory occupancy status when the vehicle is running to determine the memory performance of the controller.
[0005] In a first aspect, the present application provides a memory performance testing method, the method comprising:
[0006] Installing a test application on a target controller to be tested, wherein the test application matches the target controller;
[0007] The control test application queries multiple preset task execution applications installed on the target controller, and estimates the memory sub-occupancy rate required by each preset task execution application when running;
[0008] The control test application selects at least one target preset task execution application meeting the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application;
[0009] Controlling the target controller to run at least one target preset task execution application program in response to the received test start instruction based on the test application program;
[0010] Acquiring, based on the test application, state operation parameters collected from the target controller during the memory occupancy process of executing at least one target preset task execution application;
[0011] Determine the memory performance of the target controller based on the state operating parameters.
[0012] Further, the control test application selects at least one target preset task execution application meeting the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application, including:
[0013] When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a linear growth manner, the preset task execution applications are sorted in ascending order according to their corresponding memory sub-occupancy rates to obtain a linear growth sequence;
[0014] The sum of the memory sub-occupancy rates of the first N preset task execution applications in the linear growth sequence is determined as the total memory occupancy rate, where N is a positive integer; the total memory occupancy rate is less than the memory limit occupancy rate and greater than the preset memory occupancy rate;
[0015] The first N preset task execution applications are used as N target preset task execution applications that meet memory test requirements.
[0016] Further, the control test application selects at least one target preset task execution application meeting the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application, including:
[0017] When the memory test requirement includes controlling the memory occupancy rate to achieve memory changes in a step-by-step manner, the preset task execution applications are sorted in ascending order according to their corresponding memory sub-occupied rates to obtain a step-by-step growth sequence;
[0018] Filter out M preset task execution applications whose difference in memory sub-occupancy between every two preset task execution applications satisfies the step-by-step growth from the step-by-step growth sequence, and the sum of the memory sub-occupancy of the M preset task execution applications is less than the memory limit occupancy and greater than the memory preset occupancy, where M is a positive integer;
[0019] The M preset task execution applications are used as the M target preset task execution applications that meet the memory test requirements.
[0020] Further, the control test application selects at least one target preset task execution application meeting the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application, including:
[0021] When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a sinusoidal growth manner, P preset task execution applications whose memory sub-occupancy rates satisfy the sinusoidal growth are selected from various preset task execution applications, and the sum of the memory sub-occupancy rates of the P preset task execution applications is less than the memory limit occupancy rate and greater than the memory preset occupancy rate, and P is a positive integer;
[0022] The P preset task execution applications are used as at least one target preset task execution application that meets the memory test requirement.
[0023] Further, after controlling the target controller to run at least one target preset task execution application, the method further includes:
[0024] When the target controller meets the test loop condition, the target controller is reset and returns to execute the step of controlling the target controller to run at least one target preset task to execute the application until the target controller meets the preset test termination condition; the loop condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is less than the preset number; the termination condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is greater than or equal to the preset number.
[0025] Further, after controlling the target controller to run at least one target preset task execution application, the method further includes:
[0026] Control the target controller to release the memory space occupied by at least one target preset task execution application.
[0027] Furthermore, the operating status parameter includes at least one of the following status parameters:
[0028] The actual load of the target controller’s central processing unit, the variation characteristics of the actual load, the memory occupancy characteristics of the target controller, the response time of the target controller’s system, the target controller’s log, the crash status of the target controller’s system, the number of crashes of the target controller’s system, the memory leakage status of the target controller, the status snapshot of the target controller’s system, the target controller’s temperature, the running status of the target controller’s application, the trouble-free running time of the target controller, and the resource utilization of the target controller.
[0029] In a second aspect, the present application provides a memory performance testing device, the device comprising:
[0030] An installation module is used to install a test application on a target controller to be tested, the test application matching the target controller;
[0031] A query estimation module is used to control the test application to query multiple preset task execution applications installed on the target controller, and estimate the memory sub-occupancy rate required by each preset task execution application during operation;
[0032] A screening module, used to control the test application to select at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application;
[0033] a memory occupancy simulation module, configured to control the target controller to run at least one target preset task execution application program in response to a received test start instruction based on the test application program;
[0034] An operation parameter acquisition module, used for acquiring, based on the test application, state operation parameters collected from the target controller during the memory occupancy process of running at least one target preset task execution application;
[0035] The memory performance evaluation module is used to determine the memory performance of the target controller according to the state operation parameters.
[0036] Furthermore, the screening module is used to:
[0037] When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a linear growth manner, the preset task execution applications are sorted in ascending order according to their corresponding memory sub-occupancy rates to obtain a linear growth sequence;
[0038] The sum of the memory sub-occupancy rates of the first N preset task execution applications in the linear growth sequence is determined as the total memory occupancy rate, where N is a positive integer; the total memory occupancy rate is less than the memory limit occupancy rate and greater than the preset memory occupancy rate;
[0039] The first N preset task execution applications are used as N target preset task execution applications that meet memory test requirements.
[0040] Furthermore, the screening module is used to:
[0041] When the memory test requirement includes controlling the memory occupancy rate to achieve memory changes in a step-by-step manner, the preset task execution applications are sorted in ascending order according to their corresponding memory sub-occupied rates to obtain a step-by-step growth sequence;
[0042] Filter out M preset task execution applications whose difference in memory sub-occupancy between every two preset task execution applications satisfies the step-by-step growth from the step-by-step growth sequence, and the sum of the memory sub-occupancy of the M preset task execution applications is less than the memory limit occupancy and greater than the memory preset occupancy, where M is a positive integer;
[0043] The M preset task execution applications are used as the M target preset task execution applications that meet the memory test requirements.
[0044] Furthermore, the screening module is used to:
[0045] When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a sinusoidal growth manner, P preset task execution applications whose memory sub-occupancy rates satisfy the sinusoidal growth are selected from various preset task execution applications, and the sum of the memory sub-occupancy rates of the P preset task execution applications is less than the memory limit occupancy rate and greater than the memory preset occupancy rate, and P is a positive integer;
[0046] The P preset task execution applications are used as at least one target preset task execution application that meets the memory test requirement.
[0047] Furthermore, the memory usage simulation module is used to:
[0048] When the target controller meets the test loop condition, the target controller is reset and returns to execute the step of controlling the target controller to run at least one target preset task to execute the application until the target controller meets the preset test termination condition; the loop condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is less than the preset number; the termination condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is greater than or equal to the preset number.
[0049] Furthermore, the device also includes a memory release module, which is used to:
[0050] The target controller is controlled to run at least one target preset task execution application program, and the target controller is controlled to release the memory space occupied by the at least one target preset task execution application program.
[0051] Furthermore, the operating status parameter includes at least one of the following status parameters:
[0052] The actual load of the target controller’s central processing unit, the variation characteristics of the actual load, the memory occupancy characteristics of the target controller, the response time of the target controller’s system, the target controller’s log, the crash status of the target controller’s system, the number of crashes of the target controller’s system, the memory leakage status of the target controller, the status snapshot of the target controller’s system, the target controller’s temperature, the running status of the target controller’s application, the trouble-free running time of the target controller, and the resource utilization of the target controller.
[0053] In a third aspect, the present application provides an electronic device, including:
[0054] processor;
[0055] a memory for storing processor-executable instructions;
[0056] Among them, the processor is configured to execute to implement a memory performance testing method provided in the first aspect.
[0057] In a fourth aspect, the present application provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute a memory performance testing method as provided in the first aspect.
[0058] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0059] In this embodiment, a test application is installed on the target controller to be tested; the test application is controlled to query multiple preset task execution applications installed on the target controller, and the memory sub-occupancy rate required by each preset task execution application during operation is estimated; the test application is controlled to select at least one target preset task execution application that meets the memory test requirements from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application; a test start instruction is received and the test application is controlled to respond to the test start instruction, and the target controller is controlled to run at least one target preset task execution application to simulate the memory occupation process; the state operation parameters collected by the test application from the memory occupation process of the target controller are obtained; and the memory performance of the target controller is determined according to the state operation parameters. It can be seen that this embodiment can improve the efficiency and accuracy of memory performance testing by simulating the memory occupation scenario of the target controller during actual use. By simulating the memory usage in the actual operation scenario, the potential software and operating system problems of the target controller can be found in the single board test stage, which greatly reduces the probability of finding problems in the vehicle test stage or the market user usage scenario, thereby improving the test efficiency and accuracy. Discovering problems in advance during the single-board testing phase can reduce the cost of subsequent troubleshooting and resolution during the vehicle testing phase or the market phase. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0061] Figure 1 A flowchart of a memory performance testing method provided in this embodiment;
[0062] Figure 2 A schematic diagram of the structure of a memory performance testing device provided in this embodiment;
[0063] Figure 3 A schematic diagram of the structure of an electronic device provided in this embodiment. DETAILED DESCRIPTION
[0064] The embodiment of the present application solves the technical problem in the prior art that the memory occupancy during the controller single board test is far lower than the memory occupancy during the operation of the vehicle, thereby making it impossible to effectively detect the memory performance of the controller, by providing a memory performance testing method.
[0065] The technical solution of the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0066] In this embodiment, a test application is installed on the target controller to be tested; the test application is controlled to query multiple preset task execution applications installed on the target controller, and the memory sub-occupancy rate required by each preset task execution application during operation is estimated; the test application is controlled to select at least one target preset task execution application that meets the memory test requirements from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application; a test start instruction is received and the test application is controlled to respond to the test start instruction, and the target controller is controlled to run at least one target preset task execution application to simulate the memory occupation process; the state operation parameters collected by the test application from the memory occupation process of the target controller are obtained; and the memory performance of the target controller is determined according to the state operation parameters. It can be seen that this embodiment can improve the efficiency and accuracy of memory performance testing by simulating the memory occupation scenario of the target controller during actual use. By simulating the memory usage in the actual operation scenario, the potential software and operating system problems of the target controller can be found in the single board test stage, which greatly reduces the probability of finding problems in the vehicle test stage or the market user usage scenario, thereby improving the test efficiency and accuracy. Discovering problems in advance during the single-board testing phase can reduce the cost of subsequent troubleshooting and resolution during the vehicle testing phase or the market phase.
[0067] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0068] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0069] With the improvement of automobile electronics, more and more controllers in automobiles are using A cores and UNIX-like operating systems such as Linux / QNX running on them, such as ECU (Electronic Control Unit). However, compared with traditional RTOS operating systems, Linux / QNX operating systems are more complex in CPU (Central Processing Unit) memory management and support multi-task concurrent execution, which makes Linux / QNX operating systems dynamic and uncertain in memory. When the memory is too high, it may occasionally cause system crashes, application program operation abnormalities, log loss and other problems, resulting in unstable memory performance of the controller, and log loss makes it impossible to effectively analyze system problems. It can be seen that it is necessary to test the memory performance of the controller during the vehicle development process.
[0070] In the related art, when the controller is tested for single-board software, the memory test is usually performed in a way that the CPU memory remains unchanged. The memory during the test is much lower than the memory during the operation of the whole vehicle. In this way, the reliability problems of the controller system (such as application software core dump, operating system core dump and other serious problems) cannot be discovered in time during the single-board software test. If a system reliability problem occurs during the whole vehicle testing process or after the whole vehicle leaves the factory, it is difficult to troubleshoot the problem, the troubleshooting cost is high, and it will also lead to a poor user experience.
[0071] In order to solve the above problems, this embodiment provides Figure 1 A memory performance testing method is shown, the method comprising steps S11 to S16.
[0072] Step S11, installing a test application on the target controller to be tested, and matching the test application with the target controller;
[0073] Step S12, controlling the test application to query multiple preset task execution applications installed on the target controller, and estimating the memory sub-occupancy rate required by each preset task execution application when running;
[0074] Step S13, controlling the test application to select at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application;
[0075] Step S14, controlling the target controller to run at least one target preset task execution application in response to the received test start instruction based on the test application;
[0076] Step S15, obtaining, based on the test application, state operation parameters collected from the target controller during the memory occupancy process of running at least one target preset task execution application;
[0077] Step S16, determining the memory performance of the target controller according to the state operation parameters.
[0078] The execution subject of the memory performance testing method provided in this embodiment can be a test management system installed in a host computer, a mobile terminal, a load testing device, etc., and this embodiment does not limit this.
[0079] Regarding step S11 , a test application is installed on the target controller to be tested, and the test application matches the target controller.
[0080] The target controller can be any controller with a UNIX operating system installed. The test application is an independent QNX / Linux application that can be installed on the target controller independently and conveniently. The test management system installs the test application on the target controller through software updates. It usually uploads the test application to the storage medium of the target controller and ensures that the test application can run on the operating system of the target controller, that is, ensures that the test application matches the target controller. There is no need to modify the existing system. It is a flexible and efficient test program.
[0081] Regarding step S12, the control test application queries a plurality of preset task execution applications installed on the target controller, and estimates the memory sub-occupancy rate required by each preset task execution application when running.
[0082] The memory usage is usually related to the running program. The test application queries multiple preset task execution applications installed on the target controller, and the memory usage required by each preset task execution application during operation is estimated according to the program volume of each preset task execution application.
[0083] When the number of preset task execution applications on the target controller is small and the sum of the memory sub-occupancies corresponding to each preset task execution application is relatively small, the user's commonly used applications in the actual usage scenario of the entire vehicle can be installed in the target controller to solve the problem of fewer preset task execution applications and smaller sum of memory sub-occupancies in the target controller, thereby further increasing the number of preset task execution applications installed on the target controller.
[0084] For example, when the sum of the memory sub-occupancy rates corresponding to the preset task execution applications on the target controller is less than the preset memory occupancy rate, it means that the number of preset task execution applications on the target controller is small, and the sum of the memory sub-occupancy rates corresponding to the preset task execution applications is also relatively small. At this time, additional preset task execution applications can be installed on the target controller. The preset memory occupancy rate can be set according to actual conditions, for example, it can be set to 85%.
[0085] Regarding step S13, the control test application selects at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application.
[0086] Memory test requirements can be input into the test application through configuration files in formats such as JSON (JavaScript Object Notation), XML (Extensible Markup Language), YAML (YAML Aint Markup Language), and INI (initialization). JSON is a lightweight data exchange format that is easy to read and write, and is also easy for machines to parse and generate. In actual implementation, JSON format can be preferred for making configuration files.
[0087] According to different memory test requirements, different methods are used to select the corresponding target preset task execution application. This embodiment provides three different memory test requirements. In actual operation, these three memory test requirements can be used one by one or in combination with each other. This embodiment does not limit this. The three memory test requirements are:
[0088] Requirement 1: Control memory usage to achieve memory changes in a linear growth manner;
[0089] Requirement 2: Control the memory usage to achieve memory changes in a step-by-step manner;
[0090] Requirement 3: Control the memory usage to achieve memory changes in a sinusoidal manner.
[0091] These three requirements are explained as follows.
[0092] [Requirement 1] Control the memory usage rate to achieve memory changes in a linear growth manner, including steps S1311 to S1313.
[0093] Step S1311, when the memory test requirement includes controlling the memory occupancy rate to realize memory change in a linear growth manner, sorting the preset task execution applications in ascending order according to their corresponding memory sub-occupied rates to obtain a linear growth sequence;
[0094] Step S1312, the sum of the memory sub-occupancy rates of the first N preset task execution applications in the linear growth sequence is determined as the total memory occupancy rate, where N is a positive integer; the total memory occupancy rate is less than the memory limit occupancy rate and greater than the preset memory occupancy rate;
[0095] Step S1313: taking the first N preset task execution applications as N target preset task execution applications that meet the memory test requirement.
[0096] Linear growth means that the memory usage increases at a fixed rate. The fixed rate includes the memory usage growth step and the memory usage change frequency. The memory usage growth step is the smallest unit of memory usage change, which can be a frequency or a memory size. For example, it can be set to 10% or 10M. The smaller the memory usage growth step, the more detailed memory performance data can be provided, but it may increase the test time and computing burden. The larger the memory usage growth step, the less accurate the test results may be, but it can reduce the test time and resource consumption. In actual operation, users can choose the appropriate memory usage growth step according to the requirements of test time, computing burden and memory performance accuracy.
[0097] The memory usage change frequency is the fastest frequency at which the memory usage rate changes. For example, it may change once every second according to the memory usage growth step, or it may change once every 10 seconds according to the memory usage growth step. The specific frequency may also be selected and set according to actual needs.
[0098] Since the memory occupancy rate increases linearly, the preset task execution applications can be sorted in ascending order according to their corresponding memory sub-occupancy rates to obtain a linear growth sequence. For example, the linear growth sequence includes A1, A2, A3, A4, A5, A6, A7, A8, and A9, and the corresponding memory sub-occupancy rates are 5%, 5%, 15%, 15%, 25%, 25%, 35%, 46%, and 57%, respectively.
[0099] Set the memory limit occupancy rate and the memory preset occupancy rate. The memory limit occupancy rate is the maximum memory occupancy rate that the target controller can reach during the test, and the memory preset occupancy rate is the minimum memory occupancy rate that the target controller needs to reach during the test. Select N preset task execution applications from the linear growth sequence, so that the sum of the memory sub-occupancy rates corresponding to these N preset task execution applications (i.e., the total memory occupancy rate) is not only less than the memory limit occupancy rate, but also greater than the memory preset occupancy rate. For example, if the memory limit occupancy rate is 99% and the memory preset occupancy rate is 85%, then A1, A2, A3, A4, A5, A6, A7, A8, A9 can select A1, A2, A3, A4, A5, A6, and the total memory occupancy rate is 90%. That is, A1, A2, A3, A4, A5, A6 are respectively used as the target preset task execution applications.
[0100] [Requirement 2] Control the memory occupancy rate to achieve memory changes in a step-by-step manner, including steps S1321 to S1323.
[0101] Step S1321, when the memory test requirement includes controlling the memory occupancy rate to achieve memory changes in a step-by-step manner, sorting the preset task execution applications in ascending order according to their corresponding memory sub-occupancies to obtain a step-by-step growth sequence;
[0102] Step S1322, selecting M preset task execution applications whose difference in memory sub-occupancy between every two preset task execution applications satisfies the step-by-step growth from the step-by-step growth sequence, and the sum of the memory sub-occupancy of the M preset task execution applications is less than the memory limit occupancy and greater than the memory preset occupancy, where M is a positive integer;
[0103] Step S1323: Use the M preset task execution applications as the M target preset task execution applications that meet the memory test requirement.
[0104] Step-by-step growth means that the memory occupancy rate has increased significantly at a specific time point. Step-by-step growth means that there is a large difference before and after the growth. In this embodiment, each preset task execution application is first sorted in order from small to large according to the corresponding memory sub-occupancy rate, and a step-by-step growth sequence is obtained. For example, the step-by-step growth sequence includes A1, A2, A3, A4, A5, A6, A7, A8, and A9, and the corresponding memory sub-occupancy rates are 5%, 5%, 10%, 15%, 20%, 25%, 30%, 36%, and 57%, respectively.
[0105] Then, M applications with greatly different memory occupancy rates (a preset difference value can be set to determine whether the memory occupancy rates differ greatly) are selected from the step-growth sequence as target applications, and the sum of the memory sub-occupancy rates of the M preset task execution applications is less than the memory limit occupancy rate and greater than the preset memory occupancy rate.
[0106] Set the memory limit occupancy rate and the memory preset occupancy rate. The memory limit occupancy rate is the maximum memory occupancy rate that the target controller can reach during the test, and the memory preset occupancy rate is the minimum memory occupancy rate that the target controller needs to reach during the test. Select M preset task execution applications from the linear growth sequence, so that the sum of the memory sub-occupancy rates corresponding to these M preset task execution applications (i.e., the total memory occupancy rate) must not only be less than the memory limit occupancy rate, but also greater than the memory preset occupancy rate. For example, if the memory limit occupancy rate is 99% and the memory preset occupancy rate is 85%, then A1, A2, A3, A4, A5, A6, A7, A8, A9 can select A1, A3, A4, A5, A8, and the total memory occupancy rate is 86%. That is, A1, A3, A4, A5, A8 are respectively used as the target preset task execution applications.
[0107] [Requirement 3] Control the memory occupancy rate to achieve memory changes in a sinusoidal growth manner, including steps S1331 and S1332.
[0108] Step S1331, when the memory test requirement includes controlling the memory occupancy rate to realize memory change in a sinusoidal growth manner, P preset task execution applications whose memory sub-occupancy rates satisfy the sinusoidal growth are selected from various preset task execution applications, and the sum of the memory sub-occupancy rates of the P preset task execution applications is less than the memory limit occupancy rate and greater than the preset memory occupancy rate, and P is a positive integer;
[0109] Step S1332: Use the P preset task execution applications as at least one target preset task execution application that meets the memory test requirement.
[0110] Sine wave growth indicates that the memory usage rate shows periodic changes. Sine wave growth refers to the change pattern that the memory usage rate first increases and then decreases, and then continues to increase and then decreases. From each preset task execution application, the application with the smallest memory usage rate, the application with the largest memory usage rate, the application with the second smallest memory usage rate, the application with the second largest memory usage rate, etc. can be selected in sequence to determine P preset task execution applications. The sum of the memory sub-usage rates of these P preset task execution applications is less than the memory limit usage rate and greater than the memory preset usage rate.
[0111] For example, the preset task execution applications include A1, A2, A3, A4, A5, A6, A7, A8, and A9, and the corresponding memory sub-occupancy rates are 5%, 5%, 10%, 15%, 20%, 25%, 30%, 36%, and 52% respectively. The memory limit occupancy rate is 99%, and the memory preset occupancy rate is 85%. Then A1, A2, A3, A4, A5, A6, A7, A8, and A9 can select A1, A9, A2, and A8, and the total memory occupancy rate is 98%. That is, A1, A9, A2, and A8 are respectively used as the target preset task execution applications.
[0112] After installing the test application on the target controller, and after installing a new preset task execution application on the target controller, you can first reset the target controller to trigger the hardware and software reset mechanism of the target controller. After the target controller is reset, it will be powered on again, load its operating system and application, and enter a normal working state. When the target controller completes the startup process and enters a stable operating state, it can wait to receive a test startup instruction. After resetting the target controller, the memory performance test process is performed, which ensures that the target controller starts the memory performance test from a known state, thereby improving the accuracy of the memory performance test.
[0113] Regarding step S14, based on the test application, in response to the received test start instruction, the target controller is controlled to run at least one target preset task execution application.
[0114] The test management system receives a test start instruction generated by a user trigger, then drives the test application to respond to the test start instruction, and then controls the target controller to run at least one target preset task execution application to start the simulation memory occupation process.
[0115] The process of controlling the target controller to run at least one target preset task execution application corresponds to the aforementioned requirements 1, 2, and 3, and needs to be run in sequence according to the order of the target preset task execution applications corresponding to the respective requirements. For example, corresponding to requirement 1, A1, A2, A3, A4, A5, and A6 should be run in sequence; corresponding to requirement 2, A1, A3, A4, A5, and A8 should be run in sequence; corresponding to requirement 3, A1, A9, A2, and A8 should be run in sequence.
[0116] Each time a target preset task execution application is run, the next target preset task execution application may be started after the target controller operation state is in a steady state and lasts for a first preset time period.
[0117] Furthermore, step S14 can be repeatedly executed. For example, when the target controller meets the test loop condition, the target controller is reset and returns to the step of controlling the target controller to run at least one target preset task to execute the application until the target controller meets the preset test termination condition; the loop condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is less than the preset number; the termination condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is greater than or equal to the preset number.
[0118] By simulating the memory usage process multiple times, the memory performance test data can be further enriched and the accuracy of memory performance evaluation can be improved.
[0119] In addition, after each memory occupation process ends, it is necessary to control the target controller to release the memory space occupied by at least one target preset task execution application. On the one hand, this reduces the impact of the current memory occupation process on the simulation of the next memory occupation process, and on the other hand, it also reduces the impact of the current memory occupation process on the subsequent actual application process of the target controller.
[0120] Regarding step S15, based on the test application, the state operation parameters collected from the target controller during the memory occupation process of running at least one target preset task execution application are obtained.
[0121] During the execution of step S14, step S15 is also executed at the same time, that is, during the entire memory test process, if the target controller has abnormal conditions, such as system crashes, memory leaks, etc., the test application can capture these abnormalities and record relevant field data, such as error logs, system status snapshots, etc. In addition, all data will be collected during the test, including the load curve of the central processor, memory usage, the operating status of each target preset task execution application, and system stability indicators, which will be transmitted to the test management system for in-depth analysis of these data to evaluate the performance and reliability of the ECU under different memory conditions.
[0122] During the test process, the test application can provide feedback on the test progress according to the test duration (eg, 5 hours have passed and a total of 32 hours of testing are required) or the test stage (eg, 5% of the test tasks have been completed).
[0123] Although the target controller controls each target preset task to execute the application to perform memory occupation, the real-time memory changes are not exactly the same as the injected memory change characteristics because the response of the target controller may be affected by other system activities or resource limitations.
[0124] The test application can detect anomalies during the memory test and take appropriate measures, such as recording error logs, saving system status, restarting the test, etc. The test application can collect and save all relevant information during the test, including but not limited to CPU and memory usage, system logs, performance indicators, etc.
[0125] Regarding step S16, the memory performance of the target controller is determined according to the state operation parameter.
[0126] The operating status parameter includes at least one of the following status parameters:
[0127] The actual load of the target controller’s central processing unit, the variation characteristics of the actual load, the memory occupancy characteristics of the target controller, the response time of the target controller’s system, the target controller’s log, the crash status of the target controller’s system, the number of crashes of the target controller’s system, the memory leakage status of the target controller, the status snapshot of the target controller’s system, the target controller’s temperature, the running status of the target controller’s application, the trouble-free running time of the target controller, and the resource utilization of the target controller.
[0128] The actual load may be a load curve of a CPU of the target controller, where the load rate of the CPU during the simulation of memory usage is collected at a preset collection frequency, and then the load rates collected at different times are plotted into a load curve according to a time sequence. The actual load change feature may be a load change law obtained from the load curve.
[0129] The memory usage feature is the memory usage rate, which evaluates the target controller's system's memory management capabilities and determines whether there is a memory leak. The quality of memory management capabilities has a direct impact on the running status of the application. When the memory management capability is poor, the application and system response time is long, the system and application crashes more frequently, and the error rate is high. When the memory management capability is good, the application and system response time is short, the system and application crashes less frequently, and the error rate is low.
[0130] It should be noted that memory usage refers to the memory consumed by all processes. The CPU load usage refers to the computing resources occupied by running programs. However, programs that occupy a large amount of memory do not necessarily occupy a lot of computing resources, and programs that occupy a lot of computing resources do not necessarily consume too much memory. Generally, if the computing resource usage of a certain program is too high, it will affect the operation of other programs. If a certain program occupies too much memory, it will affect the overall performance of the machine. Therefore, in the memory usage simulation scenario, the load curve is used to characterize the degree of influence of different memory usage on the computing performance of the CPU.
[0131] Comprehensively conduct real-time or subsequent data analysis of operating status parameters to evaluate the reliability and performance of the system. For example, if the system can still maintain stable operation under high memory usage, without performance bottlenecks or crashes, or the probability of performance bottlenecks or crashes is low, then the reliability and performance of the system can be considered good. Conversely, if performance degradation or system instability is found, further optimization may be required, which means that the performance of the target controller and its system can be improved in all aspects, reducing the probability of reliability problems of the target controller during vehicle testing or user use after leaving the factory.
[0132] The operating status parameters and their analysis results can be generated into a test report, which will include all the data and analysis results collected during the test, as well as a comprehensive evaluation of the CPU performance. Based on the operating status parameters during the simulated memory usage operation, the CPU performance under various expected and extreme memory usage conditions can be comprehensively evaluated, potential problems can be discovered in a timely manner, and data support can be provided for system optimization and improvement.
[0133] In summary, the present embodiment installs a test application on the target controller to be tested; controls the test application to query multiple preset task execution applications installed on the target controller, and estimates the memory sub-occupancy rates required by each preset task execution application when running; controls the test application to select at least one target preset task execution application that meets the memory test requirements from each preset task execution application according to the memory sub-occupancy rates corresponding to each preset task execution application; receives a test start instruction and controls the test application to respond to the test start instruction, controls the target controller to run at least one target preset task execution application to simulate the memory occupation process; obtains the state operation parameters collected by the test application from the memory occupation process of the target controller; and determines the memory performance of the target controller according to the state operation parameters. It can be seen that the present embodiment can improve the efficiency and accuracy of the memory performance test by simulating the memory occupation scenario of the target controller during actual use, and can discover potential software and operating system problems of the target controller in the single board test stage by simulating the memory usage in the actual operation scenario, which greatly reduces the probability of discovering problems in the vehicle test stage or the market user usage scenario, thereby improving the test efficiency and accuracy. Discovering problems in advance during the single-board testing phase can reduce the cost of subsequent troubleshooting and resolution during the vehicle testing phase or the market phase.
[0134] This embodiment can test the stability and reliability of the system by simulating the sudden change of memory usage in extreme scenarios, which helps to ensure that the system can maintain stable operation in various actual operation scenarios and improve the overall reliability and stability of the system.
[0135] The present embodiment adopts JSON file as configuration file to support flexible test parameter configuration. At the same time, through modular design, it can be easily expanded to new test scenarios and different target controller types to meet different test requirements. Specifically, new test scenarios can be introduced by adding or modifying parameters in the configuration file to adapt to different test requirements. For the expansion of CPU types, the test system can be enabled to interact with different hardware and software environments by developing adapters or interfaces compatible with specific CPUs. The memory performance test method provided in this embodiment allows the adaptation to new test requirements or CPU types by adding new modules or functions without changing the core system architecture of the target controller, thereby improving the adaptability of the system and future development potential.
[0136] The test application provided in this embodiment can be pushed to the QNX operating system separately without modifying or upgrading the original system, making the installation and use of the memory performance testing method provided in this embodiment very simple and convenient.
[0137] To sum up, the memory performance testing method provided in this embodiment improves test efficiency and accuracy, reduces the cost of problem troubleshooting and solving, enhances system reliability and stability, and has flexibility and scalability, and is easy to install and use by simulating memory usage in actual operating scenarios.
[0138] Based on the same inventive concept, this embodiment provides Figure 2 A memory performance testing device is shown, the device comprising:
[0139] An installation module 21 is used to install a test application on a target controller to be tested, the test application matching the target controller;
[0140] A query estimation module 22, used to control the test application to query multiple preset task execution applications installed on the target controller, and estimate the memory sub-occupancy rate required by each preset task execution application when running;
[0141] A screening module 23, used to control the test application to select at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application;
[0142] A memory occupancy simulation module 24, configured to control the target controller to run at least one target preset task execution application program in response to a received test start instruction based on the test application program;
[0143] An operation parameter acquisition module 25 is used to acquire, based on the test application, state operation parameters collected from the target controller during the memory occupancy process of running at least one target preset task execution application;
[0144] The memory performance evaluation module 26 is used to determine the memory performance of the target controller according to the state operation parameters.
[0145] Furthermore, the screening module 23 is used to:
[0146] When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a linear growth manner, the preset task execution applications are sorted in ascending order according to their corresponding memory sub-occupancy rates to obtain a linear growth sequence;
[0147] The sum of the memory sub-occupancy rates of the first N preset task execution applications in the linear growth sequence is determined as the total memory occupancy rate, where N is a positive integer; the total memory occupancy rate is less than the memory limit occupancy rate and greater than the preset memory occupancy rate;
[0148] The first N preset task execution applications are used as N target preset task execution applications that meet memory test requirements.
[0149] Furthermore, the screening module 23 is used to:
[0150] When the memory test requirement includes controlling the memory occupancy rate to achieve memory changes in a step-by-step manner, the preset task execution applications are sorted in ascending order according to their corresponding memory sub-occupied rates to obtain a step-by-step growth sequence;
[0151] Filter out M preset task execution applications whose difference in memory sub-occupancy between every two preset task execution applications satisfies the step-by-step growth from the step-by-step growth sequence, and the sum of the memory sub-occupancy of the M preset task execution applications is less than the memory limit occupancy and greater than the memory preset occupancy, where M is a positive integer;
[0152] The M preset task execution applications are used as the M target preset task execution applications that meet the memory test requirements.
[0153] Furthermore, the screening module 23 is used to:
[0154] When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a sinusoidal growth manner, P preset task execution applications whose memory sub-occupancy rates satisfy the sinusoidal growth are selected from various preset task execution applications, and the sum of the memory sub-occupancy rates of the P preset task execution applications is less than the memory limit occupancy rate and greater than the memory preset occupancy rate, and P is a positive integer;
[0155] The P preset task execution applications are used as at least one target preset task execution application that meets the memory test requirement.
[0156] Furthermore, the memory usage simulation module 24 is used to:
[0157] When the target controller meets the test loop condition, the target controller is reset and returns to execute the step of controlling the target controller to run at least one target preset task to execute the application until the target controller meets the preset test termination condition; the loop condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is less than the preset number; the termination condition includes that the number of times the step of controlling the target controller to run at least one target preset task to execute the application is greater than or equal to the preset number.
[0158] Furthermore, the device also includes a memory release module, which is used to:
[0159] The target controller is controlled to run at least one target preset task execution application program, and the target controller is controlled to release the memory space occupied by the at least one target preset task execution application program.
[0160] Furthermore, the operating status parameter includes at least one of the following status parameters:
[0161] The actual load of the target controller’s central processing unit, the variation characteristics of the actual load, the memory occupancy characteristics of the target controller, the response time of the target controller’s system, the target controller’s log, the crash status of the target controller’s system, the number of crashes of the target controller’s system, the memory leakage status of the target controller, the status snapshot of the target controller’s system, the target controller’s temperature, the running status of the target controller’s application, the trouble-free running time of the target controller, and the resource utilization of the target controller.
[0162] Based on the same inventive concept, this embodiment provides Figure 3 An electronic device as shown includes:
[0163] Processor 31;
[0164] A memory 32 for storing instructions executable by the processor 31;
[0165] The processor 31 is configured to execute to implement a memory performance testing method as provided above.
[0166] Based on the same inventive concept, this embodiment provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor 31 of the electronic device, the electronic device can execute a memory performance testing method as provided above.
[0167] Since the electronic device introduced in this embodiment is an electronic device used to implement the information processing method in the embodiment of the present application, based on the information processing method introduced in the embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the electronic device used by the information processing method in the embodiment of the present application, it belongs to the scope of protection of this application.
[0168] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0169] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0170] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.
[0172] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0173] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A memory performance testing method, characterized in that: The method comprises: Installing a test application on a target controller to be tested, the test application matching the target controller; Controlling the test application to query multiple preset task execution applications installed on the target controller, and estimating the memory sub-occupancy rate required by each of the preset task execution applications when running; Controlling the test application to select at least one target preset task execution application meeting the memory test requirement from each of the preset task execution applications according to the memory sub-occupancy rates respectively corresponding to each of the preset task execution applications; Based on the test application, in response to the received test start instruction, control the target controller to run the at least one target preset task execution application; Acquiring, based on the test application, state operation parameters collected from the target controller during the memory occupation process of running the at least one target preset task execution application; The memory performance of the target controller is determined according to the state operation parameter.
2. The method according to claim 1, characterized in that The controlling the test application to select at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application, comprises: When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a linear growth manner, the preset task execution applications are sorted in ascending order according to the corresponding memory sub-occupancy rates to obtain a linear growth sequence; The sum of the memory sub-occupancy rates of the first N preset task execution applications in the linear growth sequence is determined as the total memory occupancy rate, where N is a positive integer; the total memory occupancy rate is less than the memory limit occupancy rate and greater than the preset memory occupancy rate; The first N preset task execution applications are used as N target preset task execution applications that meet the memory test requirement.
3. The method according to claim 1, characterized in that The controlling the test application to select at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application, comprises: When the memory test requirement includes controlling the memory occupancy rate to achieve memory changes in a step-by-step manner, the preset task execution applications are sorted in ascending order according to the corresponding memory sub-occupancy rates to obtain a step-by-step growth sequence; Filter out M preset task execution applications whose difference in the memory sub-occupancy rate between every two preset task execution applications satisfies the step-by-step growth from the step-by-step growth sequence, and the sum of the memory sub-occupancy rates of the M preset task execution applications is less than the memory limit occupancy rate and greater than the memory preset occupancy rate, where M is a positive integer; The M preset task execution applications are used as the M target preset task execution applications that meet the memory test requirement.
4. The method according to claim 1, characterized in that The controlling the test application to select at least one target preset task execution application that meets the memory test requirement from each preset task execution application according to the memory sub-occupancy rate corresponding to each preset task execution application, comprises: When the memory test requirement includes controlling the memory occupancy rate to realize memory changes in a sinusoidal growth manner, P preset task execution applications whose memory sub-occupancy rates satisfy the sinusoidal growth are selected from each of the preset task execution applications, and the sum of the memory sub-occupancy rates of the P preset task execution applications is less than the memory limit occupancy rate and greater than the memory preset occupancy rate, and P is a positive integer; The P preset task execution applications are used as the at least one target preset task execution application that meets the memory test requirement.
5. The method according to claim 1, characterized in that After controlling the target controller to run the at least one target preset task execution application, the method further includes: When the target controller meets the test loop condition, the target controller is reset and returns to executing the step of controlling the target controller to run the at least one target preset task to execute the application until the target controller meets the preset test termination condition; the loop condition includes that the number of times the step of controlling the target controller to run the at least one target preset task to execute the application is less than the preset number; the termination condition includes that the number of times the step of controlling the target controller to run the at least one target preset task to execute the application is greater than or equal to the preset number.
6. The method according to claim 1, characterized in that After controlling the target controller to run the at least one target preset task execution application, the method further includes: The target controller is controlled to release the memory space occupied by the at least one target preset task execution application.
7. The method according to claim 1, characterized in that The operating status parameter includes at least one of the following status parameters: The actual load of the central processing unit of the target controller, the variation characteristics of the actual load, the occupancy characteristics of the memory of the target controller, the response time of the system of the target controller, the log of the target controller, the crash status of the system of the target controller, the number of crashes of the system of the target controller, the leakage status of the memory of the target controller, the status snapshot of the system of the target controller, the temperature of the target controller, the running status of the application of the target controller, the trouble-free running time of the target controller and the resource utilization of the target controller.
8. A memory performance testing device, characterized in that: The device comprises: An installation module, used for installing a test application on a target controller to be tested, wherein the test application matches the target controller; A query estimation module, used to control the test application to query multiple preset task execution applications installed on the target controller, and estimate the memory sub-occupancy rate required by each of the preset task execution applications when running; A screening module, used for controlling the test application to select at least one target preset task execution application satisfying the memory test requirement from each of the preset task execution applications according to the memory sub-occupancy rates respectively corresponding to each of the preset task execution applications; a memory occupancy simulation module, configured to control the target controller to run the at least one target preset task execution application program in response to a received test start instruction based on the test application program; An operation parameter acquisition module, used for acquiring, based on the test application, state operation parameters collected from the target controller during the memory occupancy process of running the at least one target preset task execution application; A memory performance evaluation module is used to determine the memory performance of the target controller according to the state operation parameters.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute to implement a memory performance testing method as described in any one of claims 1 to 7.
10. A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to implement a memory performance testing method as described in any one of claims 1 to 7.
