CPU load abnormity repairing method and device, electronic equipment and storage medium
By cached operation tracking information and saving it when the CPU load abnormality, the problem of not being able to obtain operation tracking information in the existing technology is solved, and automated monitoring and repair of CPU load abnormalities is realized, and system fluency is improved.
Patent Information
- Application Number
- CN202411757062.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art cannot obtain operation tracking information when the CPU load is monitored at a high level, resulting in the inability to automatically monitor and repair CPU load abnormalities.
By obtaining system monitoring information, including CPU idle rate and application CPU usage, and cache the run tracking information to the ring buffer. When the CPU load is abnormal, a message saving notification is generated and the information in the ring buffer is saved as exception tracking information.
It realizes the ability to obtain operation tracking information when CPU load abnormalities, improves the efficiency and accuracy of CPU load abnormalities repair, and ensures system fluency.
Smart Images

Figure CN119621430A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of CPU load monitoring, and in particular to a method, device, electronic device and storage medium for repairing abnormal CPU load. Background Art
[0002] The central processing unit (CPU) resource of the Android operating system in the vehicle system is an important hardware resource. The CPU load often determines the smoothness of the vehicle system. The Android operating system has a variety of vehicle applications, such as vehicle settings, Bluetooth phones, multimedia applications, driving recorders, 360-degree surround views, air conditioning settings, voice, virtual images, etc. Each vehicle application will occupy CPU resources when running, and each vehicle application will compete for CPU resources. When the CPU load of the vehicle system is high, it will cause very low performance and low fluency, resulting in stuck vehicle system operations and frozen screens.
[0003] However, there are currently the following difficulties in solving the performance problem of high system CPU load: high CPU load is sporadic and difficult to reproduce in manual testing or daily development; there is no target value for the CPU usage of in-vehicle applications, and there is no mechanism to monitor the excessive CPU usage of in-vehicle applications; when the CPU load of the in-vehicle system is high or the CPU usage of the in-vehicle application is greater than the preset target value, it is necessary to obtain system operation information to determine the cause of the high CPU load. Currently, there is no mechanism that can monitor the high CPU load and obtain system operation information at the same time; it is impossible to automatically monitor the high CPU load, automatically create a bug in ZenTao, and upload the system operation information, and automatically assign the bug to the corresponding developer. Summary of the invention
[0004] The present application provides a CPU load anomaly repair method, device, electronic device and storage medium to solve the above-mentioned technical problem of being unable to obtain operation tracking information when a high CPU load is detected to repair the CPU load anomaly.
[0005] In one embodiment of the present application, the present application provides a method for repairing a CPU load anomaly, including: obtaining system monitoring information of a system to be tested, the system monitoring information including a system CPU idle rate, operation tracking information, and CPU usage rates of multiple applications to be tested; caching the operation tracking information in a ring buffer; if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than a corresponding preset target value, generating an information save notification; if an information save notification exists, saving the operation tracking information in the ring buffer in response to the information save notification to obtain abnormal tracking information for repairing the CPU load anomaly.
[0006] In one embodiment of the present application, after obtaining the system monitoring information of the system to be tested, the method also includes: if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than the corresponding preset target value, then the corresponding CPU abnormality statistical information in the system monitoring information is used as display information; the display information is encapsulated as a string, and the encapsulated display information is converted to obtain a QR code; the QR code and the display information are displayed; and in response to a system screenshot instruction, a screenshot of the displayed QR code and the display information is taken to obtain an abnormal screenshot image to repair the CPU load abnormality.
[0007] In one embodiment of the present application, system monitoring information of the system under test is obtained, including: the system under test responds to a control instruction corresponding to a random event input; a CPU usage monitoring function and an operation tracking monitoring function are turned on; the system CPU idle rate of the system under test and the CPU usage rate of each of the applications under test are obtained at a preset first time interval; and the operation tracking information of the system under test is continuously obtained.
[0008] In one embodiment of the present application, in response to the information save notification, the system operation tracking information in the ring buffer is saved to obtain exception tracking information, including: if the information save notification is a system save notification, the system tracking information in the ring buffer is saved as exception tracking information; if the information save notification is an application save notification, the application tracking information in the ring buffer is saved as exception tracking information; if the information save notification is a full save notification, all the operation tracking information in the ring buffer is saved as exception tracking information.
[0009] In one embodiment of the present application, the present application provides a method for repairing a CPU load anomaly, comprising: obtaining the latest batch of anomaly tracking information and anomaly screenshot images in the system to be tested, wherein the anomaly tracking information is used to characterize the corresponding operation tracking information when the CPU load is abnormal; identifying the QR code in the anomaly screenshot image, and decapsulating the identified information to obtain CPU anomaly statistical information; uploading the CPU anomaly statistical information, the anomaly screenshot image and the anomaly tracking information to a vulnerability management system to repair the CPU load anomaly.
[0010] In one embodiment of the present application, the latest batch of exception tracking information and exception screenshot images in the system to be tested are obtained, including: detecting the update status of the storage sequence identifier at every preset second time interval; if the storage sequence identifier is detected to be updated, obtaining the exception tracking information and exception screenshot image corresponding to the latest storage sequence identifier; wherein the storage sequence identifier corresponding to the exception tracking information and the storage sequence identifier corresponding to the exception screenshot image are the same.
[0011] In one embodiment of the present application, after uploading the CPU exception statistical information, the exception screenshot image and the exception tracking information to the vulnerability management system, the method also includes: creating a vulnerability to be repaired; adding the CPU exception statistical information, the exception screenshot image and the exception tracking information to the vulnerability to be repaired to obtain a target vulnerability, the CPU exception statistical information including an application package name; generating exception notification information of the target vulnerability according to the application package name, and sending it to a preset terminal for vulnerability repair reminder.
[0012] In one embodiment of the present application, the present application provides a CPU load anomaly repair device, including: an information acquisition module, used to obtain system monitoring information of the system to be tested, the system monitoring information including the system CPU idle rate, operation tracking information and CPU usage of multiple applications to be tested; an information caching module, used to cache the operation tracking information to a ring buffer; a notification generation module, used to generate an information save notification if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage is greater than the corresponding preset target value; an information saving module, used to save the operation tracking information in the ring buffer in response to the information save notification if there is an information save notification, to obtain abnormal tracking information, so as to repair the CPU load anomaly.
[0013] In one embodiment of the present application, the present application provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the CPU load anomaly repair method as described in any of the above embodiments.
[0014] In one embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the CPU load anomaly repair method described in any one of the above embodiments.
[0015] Beneficial effects of the embodiments of the present application: The present application provides a CPU load anomaly repair method, device, electronic device and storage medium. The embodiments of the present application temporarily store operation tracking information in a ring buffer, and generate an information save notification when a high CPU load is detected to save the operation tracking information of the ring buffer, thereby repairing the CPU load anomaly, improving the efficiency and accuracy of CPU load anomaly repair, thereby improving system fluency.
[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0018] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0019] Figure 2 A schematic diagram of a process for repairing abnormal CPU load according to an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of an implementation flow of a method for repairing abnormal CPU load according to an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram showing a configuration of a preset target value according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of a process for repairing abnormal CPU load according to another embodiment of the present application is shown;
[0023] Figure 6 A block diagram of a device for repairing abnormal CPU load according to an embodiment of the present application is shown;
[0024] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0027] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0028] See also Figure 1 , Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture may include a system to be tested 101, a host computer 102, and a vulnerability management system 103. The system to be tested 101 may be a vehicle-mounted system, and the host computer 102 may be a general-purpose computer.
[0029] Exemplarily, system monitoring information of the system under test is obtained, the system monitoring information including the system CPU idle rate, operation tracking information and CPU usage of multiple applications under test; the operation tracking information is cached in a ring buffer; if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage is greater than the corresponding preset target value, an information save notification is generated; if an information save notification exists, the operation tracking information in the ring buffer is saved in response to the information save notification to obtain abnormal tracking information for repairing CPU load abnormalities.
[0030] In the related art, it is impossible to obtain operation tracking information when a high CPU load is detected to repair the CPU load anomaly.
[0031] In order to solve the above technical problems, the present application provides a CPU load abnormality repair method, device, electronic device and storage medium. The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below.
[0032] See also Figure 2 , Figure 2 FIG. 1 is a flow chart showing a method for repairing abnormal CPU load according to an embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the CPU load abnormality repair method includes at least steps S210 to S240, which are applied to the system to be tested and are described in detail as follows:
[0033] Step S210: obtaining system monitoring information of the system to be tested.
[0034] The system monitoring information includes the system CPU idle rate, operation tracking information and the CPU usage rate of multiple applications under test.
[0035] In one embodiment of the present application, see Figure 3 , Figure 3 FIG. 1 shows the overall architecture of a vehicle-mounted system according to an embodiment of the present application. Figure 3 As shown, the QNX operating system is mainly responsible for instrument applications, the Android operating system includes cockpit applications, and cockpit applications include central control entertainment information applications; the lower layer of the two operating systems is the virtualization architecture (Hypervisor), which includes multiple architecture modules such as memory virtualization, CPU virtualization, and virtual machine communication; the lower layer of the virtualization architecture is the system chip; among them, the Android operating system uses 6 of the 8 cores of the system chip by providing a virtual CPU through CPU virtualization, accounting for a total of 600%.
[0036] In one embodiment of the present application, system monitoring information of the system under test is obtained, including: the system under test responds to control instructions corresponding to random event inputs; turns on a CPU usage monitoring function and an operation tracking monitoring function; obtains the system CPU idle rate of the system under test and the CPU usage rate of each application under test at a preset first time interval; and continuously obtains the operation tracking information of the system under test.
[0037] In one embodiment of the present application, the operation tracing information is the key information for locating and analyzing the CPU performance. The operation tracing (Trace) information records the detailed scheduling of each CPU core, the kernel, the operation of key system services on the CPU, the operation, scheduling, wake-up and other information of each application process and thread, and the communication between processes through the Binder kernel.
[0038] In one embodiment of the present application, the present application performs a CPU usage performance test of an in-vehicle system and in-vehicle applications through a Monkey test.
[0039] In one embodiment of the present application, the vehicle-mounted system includes a vehicle computer system. Each application to be tested is hosted on an Android operating system.
[0040] In one embodiment of the present application, the Monkey script starts all vehicle-mounted applications and inputs random events every 500ms, fully covering all vehicle-mounted applications and services. The long-term stress Monkey test is performed for 48 hours to fully expose the CPU performance issues of the vehicle-mounted system and vehicle-mounted applications.
[0041] In one embodiment of the present application, after the vehicle system is started, the activity management service initializes the CPU target monitoring module (CPUTargetMonitor). CPUTargetMonitor registers a system property change listener to monitor whether the CPU usage monitoring function is turned on. When a tester or developer turns on or off the CPU usage monitoring switch in the engineering mode application, the engineering mode application will set the CPU monitoring (CPU_MONITOR) system property to true or false. When CpuTargetMonitor detects that the CPU_MONITOR system property is false, CpuTargetMonitor will turn off the CPU usage function, otherwise turn on the CPU usage monitoring function.
[0042] In one embodiment of the present application, see Figure 4 , Figure 4 FIG. 1 shows a schematic diagram of a configuration of a preset target value according to an embodiment of the present application. Figure 4 As shown, by using a preset compilation tool, such as Jenkins, to compile and package the files in the source code directory, a system flashing package is obtained, thereby burning the target value configuration file corresponding to the preset target value into the target directory of the target disk of the vehicle system, such as burning CPUTargetConfig.xml into the vendor / etc / data / directory of the vehicle disk; after the vehicle system is running, the target value configuration file is read and parsed into a corresponding data structure for determining whether the CPU usage is greater than the corresponding preset target value, such as a hash map (HashMAP) data structure, in which the key-value pairs represent the application package name and the preset target value of the application to be tested respectively; the source code directory also includes a product build configuration file (product.mk), etc.
[0043] In one embodiment of the present application, the preset target values of different applications to be tested are equal or different.
[0044] In one embodiment of the present application, the optimization of CPU usage is the most important aspect of optimizing the performance of vehicle-mounted applications. Each vehicle-mounted application should complete its business logic within the preset target value according to its own business logic. The preset target value of the present application refers to the average CPU usage when the application process is in the foreground. The preset target value of the CPU usage of each vehicle-mounted application needs to be determined based on factors such as competing products, its own business logic, and the CPU computing power of the entire machine. Like performance optimization, there is no absolute optimization result, and there is no absolutely accurate value for the preset target value of CPU usage, but each vehicle-mounted application can set a relatively accurate value within a certain range. For example, the preset target value corresponding to the CPU usage of the vehicle setting is set to 70%, while the preset target value corresponding to the CPU usage of the Bluetooth phone is set to 20%, and the preset target value corresponding to the CPU usage of the driving recorder is 100%, which is a value derived from the business of the application itself and the experience of the vehicle system architect.
[0045] In one embodiment of the present application, the preset first time interval may be set to 5 seconds. The CPUTargetMonitor in the present application obtains the system CPU idle rate and the CPU usage rate of each application to be tested through the top command in the process monitor every 5 seconds.
[0046] In one embodiment of the present application, after obtaining the system monitoring information of the system to be tested, the method also includes: if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than the corresponding preset target value, then the corresponding CPU abnormality statistical information in the system monitoring information is used as display information; the display information is encapsulated as a string, and the encapsulated display information is converted to obtain a QR code; the QR code and the display information are displayed; and in response to a system screenshot instruction, a screenshot of the displayed QR code and the display information is taken to obtain an abnormal screenshot image to repair the CPU load abnormality.
[0047] In one embodiment of the present application, the preset idle threshold may be set to 100%.
[0048] In one embodiment of the present application, the present application allocates 6 CPU cores to the Android operating system, and the CPU percentage is 600%. When the system CPU idle rate of the Android operating system is less than 100%, the entire system under test is in a CPU busy state; the preset target value corresponding to the application under test is searched in the HashMap data structure, and the actual value of the CPU usage rate is compared with the preset target value. If the value of the CPU usage rate is greater than the preset target value, the CPU usage rate of the application under test exceeds the standard.
[0049] In one embodiment of the present application, when the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than the corresponding preset target value CPU abnormality, the CPU load abnormality is characterized. The CPU abnormality statistical information includes the system CPU high load information when the CPU load is abnormal or the CPU usage rate of the application to be tested exceeds the standard information.
[0050] In one embodiment of the present application, the system CPU high load information includes the CPU usage of each core and the CPU usage of each process.
[0051] In one embodiment of the present application, the CPU usage exceeding standard information includes the current time corresponding to when the CPU usage exceeds standard, the application package name, the preset target value, the actual value of the CPU usage, etc.
[0052] In one embodiment of the present application, the display information includes high load information of the system CPU of the system under test or excessive CPU usage information of the application under test.
[0053] In one embodiment of the present application, the display information and the QR code are displayed on the vehicle screen through a semi-transparent blue screen with red characters, which disappear automatically after being displayed for 3 seconds.
[0054] In one embodiment of the present application, the display information is encapsulated into a JSON string, and then a QR code is generated through zxing, and the QR code includes the encapsulated JSON string.
[0055] In one embodiment of the present application, CpuTargetMonitor calls the system screenshot command to save the blue screen QR code interface. When the blue screen interface appears, it indicates that the system CPU is under high load or the CPU usage of the application under test exceeds the standard. At this time, CpuTargetMonitor will call the screencap command to take a screenshot of the blue screen interface, obtain an abnormal screenshot image, and save it in the vehicle computer directory etc / data / cpu_monitor. The abnormal screenshot image is stored with the current vehicle computer system time and serial number command, such as the image with serial number 1: etc / data / cpu_monitor / 2024-07-28-19-45-34_1.png.
[0056] Step S220: Cache the running tracking information into the ring buffer.
[0057] In one embodiment of the present application, the operation trace information is difficult to obtain from the Android log, and no relevant information about CPU scheduling is recorded. Being able to obtain the operation trace information during the period of high system CPU load or application CPU exceeding the standard is the most important step in solving CPU performance problems, because there is no existing mechanism that keeps recording the operation trace information of the system under test and automatically saves the operation trace information when the CPU is highly loaded or stuck, resulting in the tester not submitting the operation trace file to the performance fixer when creating a CPU performance or stuck bug.
[0058] In one embodiment of the present application, the present application adds a key class PerfettoHelper for obtaining the running Trace information of the system under test. PerfettoHelper registers a system property change listener to monitor whether the running tracking monitoring function is turned on.
[0059] In one embodiment of the present application, the engineering mode application sets the value of Perfetto_Trace. When the user turns on this switch, the value of Perfetto_Trace is True. After PerfettoHelper detects that this value is True, it starts a loop to capture the running Trace information of the system under test. If the value of Perfetto_Trace is False, the function of capturing the running Trace information of the system under test is closed.
[0060] In one embodiment of the present application, PerfettoHelper records the running Trace information by creating a ring buffer. The size of the ring buffer can record 60 seconds of running Trace information of the system and each application process. After more than one minute, the front information will be overwritten to form a ring, which can record the running Trace information at the current time point and within 1 minute before.
[0061] Step S230: If the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than a corresponding preset target value, an information saving notification is generated.
[0062] In one embodiment of the present application, when CpuTargetMonitor detects that the system CPU load is high or the vehicle application CPU usage exceeds the standard, a notification to save the Trace is sent.
[0063] Step S240 , if there is an information saving notification, then in response to the information saving notification, the operation tracking information in the ring buffer is saved to obtain abnormal tracking information to repair the CPU load abnormality.
[0064] In one embodiment of the present application, PerfettoHelper registers an information saving notification for saving running Trace information. When PerfettoHelper receives the information saving notification sent by CpuTargetMonitor, it saves the data in the ring buffer to the vehicle computer disk.
[0065] In one embodiment of the present application, the contents of the ring buffer are written to the data / perfetto directory of the vehicle computer disk, and the file name consists of Perfetto+subscript, corresponding to cpu_monitor, such as perfetto_1.perfetto-trace.
[0066] In one embodiment of the present application, after saving the file, the next cycle is restarted to capture the running Trace file of the system under test, and wait for the next information saving notification to be received.
[0067] In one embodiment of the present application, in response to an information save notification, the system operation tracking information in the ring buffer is saved to obtain exception tracking information, including: if the information save notification is a system save notification, the system tracking information in the ring buffer is saved as exception tracking information; if the information save notification is an application save notification, the application tracking information in the ring buffer is saved as exception tracking information; if the information save notification is a full save notification, all the operation tracking information in the ring buffer is saved as exception tracking information.
[0068] In one embodiment of the present application, the system tracking information includes the detailed scheduling of each CPU core, the kernel, and the operation of key system services on the CPU. The application tracking information includes the operation, scheduling, wake-up and other information of each application process and thread, and the communication between processes through the Binder kernel.
[0069] See also Figure 5 , Figure 5 FIG. 2 is a flow chart showing a method for repairing abnormal CPU load according to another embodiment of the present application. Figure 5 As shown, in an exemplary embodiment, the CPU load abnormality repair method includes at least steps S510 to S530, which are applied to the host computer and are described in detail as follows:
[0070] Step S510, obtaining the latest batch of abnormal tracking information and abnormal screenshot images in the system to be tested.
[0071] Among them, the abnormal tracking information is used to characterize the operation tracking information when the CPU load is abnormal
[0072] The operation tracking information in the ring buffer is saved based on the abnormal CPU load, and the ring buffer is used to temporarily store the operation tracking information of the system under test.
[0073] In one embodiment of the present application, the latest batch of exception tracking information and exception screenshot images in the system to be tested are obtained, including: detecting the update status of the storage sequence identifier at every preset second time interval; if the storage sequence identifier is detected to be updated, obtaining the exception tracking information and exception screenshot image corresponding to the latest storage sequence identifier; wherein the storage sequence identifier corresponding to the exception tracking information and the storage sequence identifier corresponding to the exception screenshot image are the same.
[0074] In one embodiment of the present application, the preset second time interval may be set to 3 seconds. Every 3 seconds, it is detected whether there are new files generated in the data / perfetto directory and the etc / data / cpu_monitor directory.
[0075] Step S520, identifying the QR code in the abnormal screenshot image, and decapsulating the identified information to obtain CPU abnormality statistics information.
[0076] In one embodiment of the present application, the automated script parses the QR code in etc / data / cpu_monitor / xxx.png through Zing: the QR code in the newly generated blue screen is parsed through Zing to decode the system CPU high load information or the application package name of the CPU usage exceeding the standard, the preset target value, the CPU usage and the time when it exceeds the standard.
[0077] Step S530, uploading CPU abnormality statistics, abnormal screenshot images and abnormality tracking information to the vulnerability management system to repair the CPU load abnormality.
[0078] In one embodiment of the present application, the automation script has been connected to the ZenTao Bug system, and the above-analyzed CPU performance information and the corresponding abnormal Trace information are uploaded to the ZenTao Bug system.
[0079] In one embodiment of the present application, after uploading the CPU exception statistical information, exception screenshot images and exception tracking information to the vulnerability management system, the method also includes: creating a vulnerability to be repaired; adding the CPU exception statistical information, exception screenshot images and exception tracking information to the vulnerability to be repaired to obtain a target vulnerability, and the CPU exception statistical information includes an application package name; generating exception notification information of the target vulnerability according to the application package name, and sending it to a preset terminal for vulnerability repair reminder.
[0080] In one embodiment of the present application, the vulnerability management system may be a ZenTao Bug system, and the application developer is mapped to the application package name. After the target bug is automatically created in the ZenTao Bug system, an abnormal notification message is sent to the application developer through a preset notification method corresponding to the application package name to fix the CPU load abnormality. The preset notification method includes an email method.
[0081] In one embodiment of the present application, the present application can test the behavior of the CPU load exceeding the standard of the vehicle-mounted system and the vehicle-mounted application. When the CPU performance problem is monitored, a CPU performance bug to be fixed is automatically created, and the corresponding operation trace information, abnormal screenshot image, and CPU abnormality statistical information are attached to the bug to be fixed, and assigned to the corresponding developer to allow the corresponding developer to optimize it.
[0082] See also Figure 6 , Figure 6 A block diagram of a CPU load abnormality repair device according to an embodiment of the present application is shown. The device can be applied to Figure 1 The implementation environment shown is specifically configured in the system to be tested 101. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0083] like Figure 6 As shown, according to an embodiment of the present application, a CPU load anomaly repairing device 600 includes: an information acquisition module 601, an information cache module 602, a notification generation module 603 and an information storage module 604.
[0084] The information acquisition module 601 is used to acquire system monitoring information of the system under test, the system monitoring information including the system CPU idle rate, operation tracking information and CPU usage rate of multiple applications under test;
[0085] The information cache module 602 is used to cache the operation tracking information into a ring buffer;
[0086] Notification generation module 603, used to generate an information saving notification if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than a corresponding preset target value;
[0087] The information saving module 604 is used to save the operation tracking information in the ring buffer in response to the information saving notification if there is an information saving notification, and obtain the abnormal tracking information to repair the CPU load abnormality.
[0088] It should be noted that the CPU load anomaly repair device provided in the above embodiment and the CPU load anomaly repair method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In practical applications, the CPU load anomaly repair device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0089] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by one or more processors, the electronic device implements the CPU load anomaly repair method provided in the above-mentioned embodiments.
[0090] See also Figure 7 , Figure 7 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 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.
[0091] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method in the above embodiment. In the random access memory 703, various programs and data required for system operation are also stored. The central processing unit 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0092] The following components are connected to the input / output interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0093] 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 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0094] 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 signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a 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.
[0095] 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 from 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.
[0096] The units involved in the embodiments described in the present application can be implemented by software or by hardware, and the units described can also be set in a processor. Among them, the names of these units do not constitute a limitation on the units themselves under certain circumstances. Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.
[0097] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to execute the CPU load anomaly repair method provided in the above-mentioned embodiments. The computer-readable storage medium may be included in the electronic device described in the above-mentioned embodiments, or may exist independently without being assembled into the electronic device.
[0098] In the above embodiments, unless otherwise specified, by using serial numbers such as "first" and "second" to describe common objects, it only means that they refer to different instances of the same object, rather than indicating that the objects being described must adopt a given order, whether in time, space, sorting or any other way.
[0099] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for repairing abnormal CPU load, characterized in that: The method comprises: Acquire system monitoring information of the system under test, wherein the system monitoring information includes system CPU idle rate, operation tracking information, and CPU usage rate of multiple applications under test; Cache the operation tracking information into a ring buffer; If the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than a corresponding preset target value, then generating an information saving notification; If there is an information saving notification, the operation tracking information in the ring buffer is saved in response to the information saving notification to obtain the abnormal tracking information so as to repair the CPU load abnormality.
2. The CPU load abnormality repair method according to claim 1, characterized in that: After obtaining the system monitoring information of the system to be tested, the method further includes: If the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than a corresponding preset target value, the corresponding CPU abnormality statistics in the system monitoring information are used as display information; Encapsulating the display information into a character string, and converting the encapsulated display information to obtain a QR code; Display the QR code and the display information; In response to the system screenshot instruction, a screenshot is taken of the displayed QR code and display information to obtain an abnormal screenshot image to repair the abnormal CPU load.
3. The CPU load abnormality repair method according to claim 1, characterized in that: Obtain system monitoring information of the system under test, including: The system under test inputs a control instruction corresponding to a random event in response to the random event; Enable CPU usage monitoring and operation tracking monitoring functions; Obtaining a system CPU idle rate of the system to be tested and a CPU usage rate of each of the applications to be tested at every preset first time interval; Continuously obtain the operation tracking information of the system under test.
4. The CPU load abnormality repair method according to any one of claims 1 to 3, characterized in that: In response to the information saving notification, the system operation tracking information in the ring buffer is saved to obtain abnormal tracking information, including: If the information saving notification is a system saving notification, the system tracking information in the ring buffer is saved as abnormal tracking information; If the information saving notification is an application saving notification, saving the application tracking information in the ring buffer as abnormal tracking information; If the information saving notification is a full saving notification, all the operation tracking information in the ring buffer is saved as abnormal tracking information.
5. A method for repairing abnormal CPU load, characterized in that: The method comprises: Obtain the latest batch of abnormal tracking information and abnormal screenshot images in the system to be tested, wherein the abnormal tracking information is used to characterize the corresponding operation tracking information when the CPU load is abnormal; Identify the QR code in the abnormal screenshot image, and decapsulate the identified information to obtain CPU abnormality statistics; The CPU abnormality statistics, the abnormality screenshot image and the abnormality tracking information are uploaded to the vulnerability management system to repair the CPU load abnormality.
6. The CPU load abnormality repair method according to claim 5, characterized in that: Obtain the latest batch of exception tracking information and exception screenshots in the system under test, including: Detecting the update status of the storage sequence identifier at every preset second time interval; If the storage sequence identifier is detected to be updated, the abnormal tracking information and abnormal screenshot image corresponding to the latest storage sequence identifier are obtained; The storage sequence identifier corresponding to the abnormal tracking information is the same as the storage sequence identifier corresponding to the abnormal screenshot image.
7. The CPU load abnormality repair method according to claim 5, characterized in that: After uploading the CPU abnormality statistics, the abnormality screenshot image and the abnormality tracking information to the vulnerability management system, the method further includes: Create vulnerabilities to be fixed; Adding the CPU exception statistics information, the exception screenshot image and the exception tracking information to the vulnerability to be repaired to obtain a target vulnerability, wherein the CPU exception statistics information includes an application package name; Generate abnormal notification information of the target vulnerability according to the application package name, and send it to a preset terminal for vulnerability repair reminder.
8. A CPU load abnormality repair device, characterized in that: The device comprises: An information acquisition module is used to acquire system monitoring information of the system under test, wherein the system monitoring information includes a system CPU idle rate, operation tracking information, and CPU usage rates of multiple applications under test; An information caching module, used for caching the operation tracking information into a ring buffer; A notification generation module, configured to generate an information saving notification if the system CPU idle rate is less than a preset idle threshold, or at least one CPU usage rate is greater than a corresponding preset target value; The information saving module is used to save the operation tracking information in the ring buffer in response to the information saving notification if there is an information saving notification, so as to obtain the abnormal tracking information so as to repair the CPU load abnormality.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the CPU load abnormality repair method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the CPU load abnormality repair method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Equipment abnormal information display method and computer equipment
CN108920337A
Data processing method and system, server and device
CN110334076A
Tracking information acquisition method and device and electronic equipment
CN118642916A