System performance optimization method and device and electronic equipment
By monitoring and detecting the activity of the system process, and automatically judging and optimizing the system process, the problem of users in the existing technology that actively intervene in system performance optimization is solved, intelligent and automated system performance optimization is achieved, and system efficiency and user experience are improved.
Patent Information
- Application Number
- CN202311338283.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2043-10-16
AI Technical Summary
The existing system performance optimization methods rely on users' active intervention and settings. Users need to understand the system performance-related knowledge and configure and optimize operations, resulting in a large burden on users and a lot of time and energy consumption.
By monitoring the system process, obtaining the process and performing activity detection, it automatically determines whether the optimization process is needed. When the optimization process is determined, the process is suspended to reduce resource usage and restore the process to process the message when the system message is received.
It realizes system performance optimization without user perception, reduces user burden, saves time and energy, and improves system efficiency and user experience.
Smart Images

Figure CN119883719A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a system performance optimization method, device and electronic equipment. Background Art
[0002] Currently, many operating systems and applications provide user interfaces and setting options that allow users to configure performance optimization according to their needs and preferences. For example, users can choose to turn off visual effects, adjust power plans, adjust screen brightness, etc. to reduce system resource usage. Operating systems usually also provide task managers or system monitoring tools that allow users to view currently running processes, resource usage, and performance indicators. Users can use these tools to identify resource-intensive processes and decide whether to terminate or optimize them as needed.
[0003] These existing methods allow users to participate in system performance optimization, but they still rely on active intervention and settings by users. Users need to understand the knowledge related to system performance and configure and optimize operations according to their own needs and preferences. Users need to judge when to optimize and may need to spend time and effort to optimize system performance. Summary of the invention
[0004] The main technical problem solved by the implementation method of the present application is how to provide a more intelligent and automated system performance optimization technology, so that optimization operations can be performed without the user's perception, reducing the user's burden and saving time and energy.
[0005] To solve the above technical problems, a technical solution adopted in the implementation mode of the present application is: providing a system performance optimization method, including: monitoring the process of the current system; obtaining the process and performing activity detection on the process to determine whether to optimize the process; when it is determined to optimize the process, suspending the process so that the process does not respond to system messages; monitoring the system messages of the current system, and when the monitored system messages are sent to the process to be optimized, resuming the process and sending the monitored system messages to the process.
[0006] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: providing a system performance optimization device, including: a process monitoring module, used to monitor the process of the current system; an optimization decision module, used to obtain the process and perform activity detection on the process to determine whether to optimize the process; an optimization processing module, used to suspend the process when it is determined to optimize the process so that the process does not respond to system messages; a process recovery module, used to monitor the system messages of the current system, and when the monitored system message is sent to the process to be optimized, restore the process and send the monitored system message to the process.
[0007] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the system performance optimization method as described above.
[0008] In order to solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: providing a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the system performance optimization method as described above.
[0009] To solve the above technical problems, another technical solution adopted in the implementation mode of the present application is: to provide a computer program product, wherein the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by an electronic device, the electronic device executes the system performance optimization method as described above.
[0010] Different from the related art, the embodiment of the present application provides a system performance optimization method, device and electronic device, which monitors the process of the current system; obtains the process and performs activity detection on the process to determine whether to optimize the process; when it is determined to optimize the process, suspends the process so that the process does not respond to system messages; monitors the system messages of the current system, and when the monitored system message is sent to the process to be optimized, restores the process and sends the monitored system message to the process. Among them, by monitoring the process of the system, the activity and performance information of the process can be obtained in real time, which enables the system to fully control the process and provide basic data for subsequent optimization operations; it can automatically determine whether the process needs to be optimized according to the activity status and performance requirements of the process, which can reduce the user's intervention and decision-making process and realize automated optimization; when the process needs to be optimized, the process will be suspended so that it does not respond to system messages, thereby reducing the occupation of system resources by the process; when the system receives a message sent to the optimized process, it restores the process and passes the message to the process for processing, thereby realizing intelligent management of the process and reducing the burden on users. Therefore, the embodiments of the present application provide an intelligent and automated system performance optimization technology, which enables optimization operations to be performed without the user's awareness, thereby reducing the user's burden, saving time and energy, and improving the system's efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.
[0012] Figure 1 is a flow chart of a system performance optimization method provided by an embodiment of the present application;
[0013] Figure 2 is a flowchart of a method for detecting the activity of the process to determine whether to optimize the process, provided by an embodiment of the present application;
[0014] Figure 3 is a flowchart of a method for determining whether to optimize the process according to the process running status and the window running status provided by an embodiment of the present application;
[0015] Figure 4 is a flowchart of a decision-making process for optimizing the process provided by an embodiment of the present application;
[0016] Figure 5 It is a structural schematic diagram of a system performance optimization device provided in an embodiment of the present application;
[0017] Figure 6 It is a schematic diagram of the hardware structure of an electronic device for executing the system performance optimization method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0019] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.
[0020] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0021] When the operating system (such as Windows system, iOS system, etc.) freezes, you can usually use the performance optimization tools on the system to optimize the system. For example, use the disk cleanup tool (such as the disk cleanup tool that comes with Windows) to clean up unnecessary temporary files, caches, and files in the recycle bin to free up disk space. Use the task manager or system configuration tool (msconfig) to disable unnecessary programs that start at boot time to reduce the burden on the system startup. Use the task manager or system configuration tool (msconfig) to close unnecessary programs and services running in the background to free up system resources. Use reliable antivirus software to perform a full disk scan to ensure that the system is not infected by viruses, malware, or adware. If the system memory is insufficient, you can also consider adding additional memory bars to improve system performance. The above system performance optimization methods require manual operation by users. Users need to choose the appropriate optimization method according to their needs and circumstances, and make corresponding settings and adjustments.
[0022] However, performance optimization usually requires certain technical knowledge and experience, which may be confusing and uncertain for non-professionals. Users may need to spend time learning and understanding related concepts, tools, and operation steps. For non-professionals, it is difficult to accurately determine which optimization methods are most suitable for their systems and needs. Incorrect optimization operations may cause system instability, limited functions, or other problems. In addition, performance optimization is usually not a one-time operation, but a continuous process. Users may need to frequently monitor system performance and resource usage, and adjust optimization strategies according to changes. This may require more time and effort for non-professionals. Furthermore, some performance optimization operations may involve modifying system settings, changing configuration files, or running scripts. If these operations are not performed correctly, they may cause system crashes, data loss, or security vulnerabilities. Non-professionals need to be particularly cautious when performing these operations to avoid irreversible effects on the system. In summary, although manual performance optimization by users has certain flexibility and controllability, it may pose some challenges and risks for non-professionals.
[0023] Based on this, the inventors found that providing a more intelligent and automated system performance optimization technology, and being able to perform system optimization operations without user perception, reducing the burden on users, saving time and energy, is very meaningful for both users and system optimization. Therefore, the embodiment of the present application provides a system performance optimization method and device, which mainly adopts a user-unaware optimization solution to optimize the system's memory and CPU, which mainly explains when to optimize the system and what specific content to optimize.
[0024] The following embodiment provides a method for optimizing system performance. The execution subject of the method for optimizing system performance is generally an electronic device with certain computing capabilities, such as a computer device. In some possible implementations, the method for optimizing system performance can be implemented by a processor calling computer-readable instructions stored in a memory.
[0025] Specifically, Figure 1 : is a flow chart of a system performance optimization method provided by an embodiment of the present application. The method includes:
[0026] S11. Monitor the process of the current system.
[0027] The current system can be a Windows system, a Linux system, etc. You can choose an appropriate method to monitor the system process according to the version and configuration of the operating system. For example, in a Windows system, you can view the currently running processes, CPU and memory usage, etc. in the "Process" tab of the Task Manager. You can also use the sorting and filtering functions to find processes that occupy more resources. You can also use PowerShell commands to obtain system process information. For example, the "Get-Process" command can list all running processes and provide detailed information about the processes. You can also use third-party tools to monitor system processes, such as Process Explorer, Process Monitor, etc. These tools provide more detailed and advanced process monitoring functions, such as real-time graphical display, process performance indicators, etc.
[0028] For example, in Linux system, you can enter the "top" command in the terminal corresponding to the current system to display the system's process list and resource usage in real time. The top command can sort processes by CPU usage and provide real-time updated information. You can also use third-party tools to monitor system processes, such as htop, Glances, etc. These tools provide more functions and options, which can more conveniently monitor and manage processes.
[0029] S12: Acquire the process, and perform activity detection on the process to determine whether to optimize the process.
[0030] A timer may be used to trigger when to optimize system performance. When preparing to optimize system performance, the process is obtained, specifically, all processes currently running in the system may be periodically obtained. For example, all processes of the current system may be obtained every 5 minutes.
[0031] Among them, the activity detection of the process refers to monitoring and evaluating the activity status of the process to determine whether the process needs to be optimized. Specifically, the CPU utilization of the process can be detected. If the process occupies too high CPU resources for a long time, it may cause the system response to slow down, and you need to consider optimizing it. You can also detect the memory usage of the process. If the process occupies too much memory, it may cause insufficient memory in the system and affect the normal operation of other processes. You can also detect the disk read and write activities of the process. If the process frequently performs a large number of disk read and write operations, it may cause the disk load to be too high, affecting the response speed of the system. You can also detect the network communication activities of the process. If the process continuously performs a large amount of network communication, it may affect the network bandwidth and latency, and you can consider optimizing it.
[0032] In one embodiment of the present application, Figure 2As shown, the obtaining of the process and performing activity detection on the process to determine whether to optimize the process includes:
[0033] S121, obtaining the process: All processes currently running in the system may be periodically obtained.
[0034] S122. Obtain, according to the process, a process running status and a window running status corresponding to the process.
[0035] The process operation status may be the evaluation and monitoring of the process's operation status, resource usage, and interaction with other processes. The window operation status may refer to the operation status and behavior of the window associated with the process. In an operating system, each process usually corresponds to one or more windows for displaying a user interface or interaction.
[0036] Some tools and APIs (Application Programming Interface) provided by the operating system can be used to obtain the running status of the process and the running status of the window.
[0037] S123: Determine whether to optimize the process according to the process running status and the window running status.
[0038] Specifically, Figure 3 As shown, judging whether to optimize the process according to the process running status and the window running status includes:
[0039] S1231. Obtain, according to the running status of the process, the long connection information between the process and the external service, the communication information between the process and the internal service, and the information of the process occupying the multimedia device.
[0040] Among them, the long connection information between the process and the external service refers to the relevant information of the persistent network connection established between the process and other computers or servers. This connection is usually based on the TCP (Transmission Control Protocol) or UDP (User Datagram Protocol) protocol. In network communication, the process can communicate with the external service by establishing a TCP connection or using a UDP socket. A long connection refers to a continuous connection state for a period of time, rather than a short one-time connection. This long connection is usually used in application scenarios that require frequent data exchange or real-time communication, such as instant messaging, video streaming, remote monitoring, etc. The long connection information between the process and the external service may include the following: IP address: indicates the network address of the external service, which can be an IPv4 or IPv6 address. Port number: indicates the port of the external service, which is used to identify the specific application or service of the service. Protocol type: indicates the protocol used, such as TCP or UDP. Connection status: indicates the current state of the connection, such as established, closed, etc. Data transfer volume: indicates the amount of data transferred between the process and the external service during the connection.
[0041] To obtain the long connection information between the process and the external service, you can use network monitoring tools such as Wireshark, tcpdump, etc. to monitor network traffic on the operating system, including UDP and TCP connections. These tools can capture network communication packets between the process and the external service and provide detailed information about the connection, such as the source IP address, destination IP address, port number, etc. You can also use system commands or APIs to obtain network connection information between the process and the external service. For example, the netstat command in the Linux system can list the current network connection status, including process ID, local address, remote address, port, and other information.
[0042] Among them, the communication information between the process and the internal service refers to the relevant information about the interaction and communication between the process and other services or components on the same computer. This communication is usually achieved through the IPC (inter-process communication) mechanism provided by the operating system. In an operating system, multiple processes can communicate through the IPC mechanism to achieve the purpose of data transmission, shared resources, synchronous operation, etc. The communication information between the process and the internal service includes the following: Communication mode: indicates the IPC mechanism used, such as pipes, message queues, shared memory, semaphores, etc. Process identifier (PID): indicates the unique identifier of the process, which is used to identify the communication relationship between processes. Message or data: indicates the specific message or data content transmitted between processes. Communication status: indicates the current state of communication, such as established, transmitting, closed, etc. Synchronization mechanism: indicates the mechanism used for synchronization operations between processes, such as mutexes, semaphores, etc. By obtaining the communication information between the process and the internal service, you can understand the data exchange, communication mode, synchronization operations, etc. between the process and other services, so as to analyze, troubleshoot or optimize the collaboration between processes.
[0043] You can use the IPC (inter-process communication) mechanism and related tools provided by the operating system to obtain communication information between the process and internal services. The specific implementation method may vary depending on the operating system and programming language. For example, in a Linux system, you can use commands such as ipcs, ipcrm, and ipcmk to view and manage IPC resources such as message queues and shared memory. These commands can be used to obtain relevant information about IPC resources and understand the communication status between processes and internal services.
[0044] Among them, the information about the process occupying multimedia devices refers to whether the process is using or occupying multimedia devices on the computer, such as cameras, microphones or speakers, etc. These devices are often used for the input and output of audio, video or images.
[0045] The following methods can be used to obtain information about the multimedia devices occupied by the process:
[0046] Using system tools and APIs: The operating system usually provides tools and APIs for managing and controlling multimedia devices. By calling the corresponding system functions or using specific commands, you can obtain the status and occupancy of the device. For example, in Windows systems, you can use Windows API functions such as EnumDevices to obtain the status and occupancy of multimedia devices.
[0047] Use specific libraries or frameworks: Some programming languages and frameworks provide libraries or modules specifically for operating multimedia devices. By using these tools, you can easily get information about whether a process occupies a multimedia device. For example, the OpenCV library in Python can be used to access and control the camera, while the PyAudio library can be used to access and control the microphone.
[0048] Monitor system resources: By monitoring the usage of system resources, you can understand which processes are occupying multimedia devices. The operating system provides some tools and APIs to obtain the usage of system resources, including multimedia devices. By analyzing this information, you can determine whether a process is using a multimedia device.
[0049] In this embodiment, by judging whether the current process is monitoring UDP, TCP, IPC, microphone, speaker, camera, etc., it is possible to understand whether the process is using related resources and the occupation of system resources. This judgment is very important for a variety of application scenarios and needs. For example, knowing whether the process is monitoring network connections such as UDP, TCP, IPC, etc. can help understand the occupation of network resources by the process, which can avoid waste or conflict of resources for system performance optimization. Judging whether the process is monitoring network connections or using devices such as cameras and microphones can help understand user needs. When optimizing the process, it is necessary to ensure that the functions and experience expected by the user will not be disrupted. For example, if a process is an application for real-time communication and occupies a microphone, the process may not be optimized at this time considering user needs.
[0050] S1232: Obtain the inactive time of the process according to the window operation status.
[0051] Among them, inactive time refers to the period of time when the process is inactive in the system. Inactive time means that the process has not interacted with the user or performed any tasks for a period of time.
[0052] Wherein, obtaining the inactive time of the process according to the window operation status includes:
[0053] (1) Monitoring the activity status of windows of the system; the activity status of windows of the operating system, such as changes in window focus, window visibility, etc., can be monitored through interfaces or tools provided by the system.
[0054] (2) When it is monitored that the window is set as an active window, the time when the window becomes the active window is recorded, and the corresponding relationship between the window and its active time is saved; a data structure (such as a dictionary or a mapping table) can be used to store the corresponding relationship between the window and the active time.
[0055] (3) Acquire the process corresponding to the window according to the window, and establish a mapping relationship between the process and the window; the mapping relationship between the process and the window can be established through the process identifier, window title or other identifier of the window.
[0056] (4) Obtaining the active time of the window according to the corresponding relationship between the window and its active time, comparing the active time with the current time, and calculating the difference between the active time and the current time.
[0057] (5) performing a judgment based on the difference value, and if the difference value is greater than a preset threshold value, obtaining the process corresponding to the window according to the mapping relationship between the process and the window, and determining that the process is in an inactive state;
[0058] (6) Obtain the time that the process is in the inactive state, which is the inactive time of the process. The inactive time can be obtained by accumulating the inactive time of the window. Specifically, a variable can be maintained for each window to record the total inactive time of the window, and the initial value can be set to 0. When the window is judged to be in an inactive state, the inactive time difference is added to the total inactive time of the window. When the window is set to an active window again, the total inactive time of the window is cleared and the inactive time is calculated again. For each process, by traversing its associated windows, the total inactive time of each window is added to obtain the overall inactive time of the process.
[0059] S1233. When the long connection information between the process and the external service, the communication information between the process and the internal service, the information of the process occupying the multimedia device, and the inactive time of the process all meet the preset conditions, it is determined to optimize the process; otherwise, the process is not optimized.
[0060] Specifically, Figure 4 As shown, when the long connection information between the process and the external service, the communication information between the process and the internal service, the information of the process occupying the multimedia device, and the inactive time of the process all meet the preset conditions, it is determined to optimize the process, otherwise, the process is not optimized, including:
[0061] A: judging whether the process has a long connection with the external service according to the long connection information between the process and the external service;
[0062] B: If the process is not permanently connected to the external service, determine whether the process communicates with the internal service based on the communication information between the process and the internal service;
[0063] C: if the process does not communicate with the internal service, determining whether the process is currently using the multimedia device according to the information of the multimedia device occupied by the process;
[0064] D: If the process is not currently using the multimedia device, determining whether the inactive time of the process is greater than a preset time threshold;
[0065] E: If it is greater than the preset time threshold, determine to optimize the process, otherwise the process is not optimized.
[0066] It should be noted that the order of the above steps ABC is not limited to the above method. It is also possible to first determine whether the process is communicating with an internal service, then determine whether the process is permanently connected to an external service, and then determine whether the process is currently using a multimedia device. It is also possible to first determine whether the process is currently using a multimedia device, then determine whether the process is communicating with an internal service, then determine whether the process is permanently connected to an external service, and so on. The order of the above steps ABC can be arbitrarily combined.
[0067] S13. When it is determined to optimize the process, suspend the process so that the process does not respond to system messages.
[0068] The suspend operation puts the process into a dormant state, pausing its execution on the system. Optionally, the optimized process can also be terminated, and the terminate operation completely terminates the process.
[0069] S14, monitoring system messages of the current system, and when the monitored system messages are sent to the optimized process, restoring the process and sending the monitored system messages to the process.
[0070] In this embodiment, system messages can continue to be monitored, including messages sent to the optimized process. When a system message is sent to the optimized process: upon receiving the system message, the execution of the optimized process is resumed, and the received system message is sent to the process. The resumed process continues to execute and processes the received system message.
[0071] Specifically, it can be monitoring the minimization message and window activation message of the current system; when the minimization message or the window activation message is monitored, detecting whether the monitored minimization message or the window activation message is sent to the optimized process; if the monitored minimization message or the window activation message is sent to the optimized process, restoring the optimized process; sending the monitored minimization message or the window activation message to the restored process.
[0072] The minimize message is a message sent to the process corresponding to the application when the user minimizes the window (minimizes it to the taskbar or system tray). When the user clicks the minimize button of the window or executes the corresponding keyboard shortcut, the operating system sends a minimize message to the process corresponding to the application so that the process can respond to it, such as hiding the window or iconizing it to reduce the space occupied on the screen. A process is an instance of an application created at runtime, and each running application has a corresponding process.
[0073] A window activation message is a message sent to the process corresponding to an application when the user switches the focus from one window to another. When the user clicks on a window or uses the keyboard to switch the focus, the operating system sends a window activation message to the process corresponding to the application so that the process can perform necessary operations, such as updating the interface, responding to user input, or performing other tasks related to window interaction based on the window activation message.
[0074] The above-mentioned "window" refers to the window of the application. An application can contain one or more windows, each of which is used to display different parts of the application or implement different user interactions. A process is an instance of a running program in the operating system. When an application is started, the operating system will create a corresponding process for the application in order to run the application in the system. Therefore, a window is a visible element of an application on the user interface, an application is a collection of software programs written by developers, and a process is an instance of an application running in the operating system. It should be noted that an application can have multiple windows, each of which belongs to the same process of the application. These windows share the resources and context of the application and interact with the same process.
[0075] In this embodiment, when it is detected that a minimize message or a window activation message is sent to the optimized process, the optimized process can be restored in time, which will ensure that the process can run normally after the user switches windows or minimizes the window, avoiding the situation where the process cannot respond or is suspended. Optionally, after the optimized process is restored, the previous state of the process can be maintained, including opened files, edited content, browsing traces, the location of historical operations, etc. In this way, the user can seamlessly continue working from the place where the last operation was performed, without having to restart or retrieve the previous state. Therefore, by monitoring and restoring minimize messages and window activation messages, a better user experience can be provided, work efficiency can be improved, and it can be ensured that the optimized process can remain active when the window is switched or minimized.
[0076] The embodiment of the present application provides a method for optimizing system performance, which monitors the process of the current system; obtains the process, and performs activity detection on the process to determine whether to optimize the process; when it is determined to optimize the process, suspends the process so that the process does not respond to system messages; when the monitored system message is sent to the process to be optimized, restores the process, and sends the monitored system message to the process. Among them, by monitoring the process of the system, the activity and performance information of the process can be obtained in real time, which enables the system to fully control the process and provide basic data for subsequent optimization operations; it can automatically determine whether the process needs to be optimized according to the activity status and performance requirements of the process, which can reduce the user's intervention and decision-making process and realize automated optimization; when the process needs to be optimized, the process will be suspended so that it does not respond to system messages, thereby reducing the occupation of system resources by the process, and when the system receives a message sent to the optimized process, the process will be restored and the message will be passed to the process for processing, so that the intelligent management of the process can be realized and the burden on the user can be reduced. The embodiment of the present application provides an intelligent and automated system performance optimization technology, which enables the optimization operation to be performed without the user's perception, reduces the burden on the user, saves time and energy, and improves the efficiency of the system and the user experience.
[0077] See also Figure 5 , Figure 5 1 is a schematic diagram of the structure of a system performance optimization device provided in an embodiment of the present application. The system performance optimization device 20 includes a process monitoring module 21, an optimization decision module 22, an optimization processing module 23, and a process recovery module 24.
[0078] The process monitoring module 21 is used to monitor the processes of the current system; the optimization decision module 22 is used to obtain the process and perform activity detection on the process to determine whether to optimize the process; the optimization processing module 23 is used to suspend the process when it is determined to optimize the process so that the process does not respond to system messages; the process recovery module 24 is used to monitor the system messages of the current system, and when the monitored system message is sent to the process to be optimized, the process is restored and the monitored system message is sent to the process.
[0079] Among them, the optimization decision module 22 is specifically used to obtain the process; obtain the process running status and window running status corresponding to the process according to the process; and determine whether to optimize the process according to the process running status and the window running status. Among them, the determination of whether to optimize the process according to the process running status and the window running status includes: obtaining the long connection information between the process and the external service, the communication information between the process and the internal service, and the information of the process occupying the multimedia device according to the process running status; obtaining the inactive time of the process according to the window running status; when the long connection information between the process and the external service, the communication information between the process and the internal service, the information of the process occupying the multimedia device, and the inactive time of the process all meet the preset conditions, it is determined to optimize the process, otherwise, the process is not optimized.
[0080] Among them, when the long connection information between the process and the external service, the communication information between the process and the internal service, the information of the process occupying the multimedia device, and the inactive time of the process all meet the preset conditions, it is determined to optimize the process, otherwise, the process is not optimized, including: judging whether the process is long connected with the external service according to the long connection information between the process and the external service; if the process is not long connected with the external service, judging whether the process communicates with the internal service according to the communication information between the process and the internal service; if the process does not communicate with the internal service, judging whether the process is currently using the multimedia device according to the information of the process occupying the multimedia device; if the process is not currently using the multimedia device, judging whether the most recent active time of the process is less than the preset time threshold according to the inactive time of the process; if it is less than the preset time threshold, determining to optimize the process, otherwise the process is not optimized.
[0081] Among them, the method of obtaining the inactive time of the process according to the operation status of the window includes: monitoring the activity status of the window of the system; when monitoring that the window is set as an active window, recording the time when the window becomes the active window, and saving the correspondence between the window and its activity time; obtaining the process corresponding to the window according to the window, and establishing a mapping relationship between the process and the window; obtaining the activity time of the window according to the correspondence between the window and its activity time, and comparing the activity time with the current time, and calculating the difference between the activity time and the current time; judging according to the difference, if the difference is greater than a preset threshold, obtaining the process corresponding to the window according to the mapping relationship between the process and the window, and determining that the process is in an inactive state; obtaining the time when the process is in the inactive state, which is the inactive time of the process.
[0082] The acquiring of the process includes: periodically acquiring all processes currently running in the system.
[0083] Among them, the process recovery module 24 is specifically used to: monitor the minimization message and window activation message of the current system; when the minimization message or the window activation message is monitored, detect whether the monitored minimization message or the window activation message is sent to the optimized process; if so, restore the optimized process; send the monitored minimization message or the window activation message to the restored process.
[0084] It should be noted that the above-mentioned system performance optimization device can execute the system performance optimization method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the system performance optimization device, please refer to the system performance optimization method provided in the embodiment of the present application.
[0085] See also Figure 6 , Figure 6 is a schematic diagram of the hardware structure of an electronic device 30 for executing a system performance optimization method provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device 30 includes:
[0086] One or more processors 31 and memory 32, Figure 6 A processor 31 is taken as an example.
[0087] The processor 31 and the memory 32 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0088] The memory 32 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the system performance optimization method in the embodiment of the present application (for example, the attached Figure 5 The processor 31 executes various functional applications and data processing of the electronic device by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, implements the system performance optimization method of the above method embodiment.
[0089] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the system performance optimization device, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include a memory remotely arranged relative to the processor 31, and these remote memories may be connected to the system performance optimization device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0090] The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, perform the system performance optimization method in any of the above method embodiments, for example, perform the above described Figure 1 , Figure 2 , Figure 3 and Figure 4 Method steps and implementation Figure 5 The functions of the modules in .
[0091] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0092] The electronic devices of the embodiments of the present application exist in various forms, including personal computers, laptop computers, smart phones, servers and other intelligent terminal devices.
[0093] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 6 A processor 31 in the embodiment may enable the one or more processors to execute the system performance optimization method in any of the above method embodiments, for example, to execute the above described Figure 1 , Figure 2 , Figure 3 and Figure 4 Method steps and implementation Figure 5 The functions of the modules in .
[0094] The present application provides a computer program product, wherein the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by the electronic device, the electronic device is enabled to perform the system performance optimization method in any of the above method embodiments, for example, to perform the above described Figure 1 , Figure 2 , Figure 3 and Figure 4 Method steps and implementation Figure 5 The functions of the modules in .
[0095] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0096] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A system performance optimization method, characterized in that: include: Monitor the current system process; Acquire the process, and perform activity detection on the process to determine whether to optimize the process; When it is determined to optimize the process, suspend the process so that the process does not respond to system messages; The system message of the current system is monitored, and when the monitored system message is sent to the optimized process, the process is restored and the monitored system message is sent to the process.
2. The method according to claim 1, characterized in that The obtaining of the process and performing activity detection on the process to determine whether to optimize the process includes: obtaining the process; Acquire the process running status and window running status corresponding to the process according to the process; Determine whether to optimize the process according to the process running status and the window running status.
3. The method according to claim 2, characterized in that The determining whether to optimize the process according to the process running status and the window running status includes: Acquire, according to the running status of the process, the long connection information between the process and the external service, the communication information between the process and the internal service, and the information of the multimedia device occupied by the process; Acquire the inactive time of the process according to the window operation status; When the long connection information between the process and the external service, the communication information between the process and the internal service, the information of the process occupying the multimedia device, and the inactive time of the process all meet the preset conditions, it is determined to optimize the process, otherwise, the process is not optimized.
4. The method according to claim 3, characterized in that When the long connection information between the process and the external service, the communication information between the process and the internal service, the information of the process occupying the multimedia device, and the inactive time of the process all meet the preset conditions, it is determined to optimize the process, otherwise, the process is not optimized, including: Determining whether the process has a long connection with the external service according to the long connection information between the process and the external service; If the process is not permanently connected to the external service, determining whether the process communicates with the internal service based on the communication information between the process and the internal service; If the process does not communicate with the internal service, determining whether the process is currently using the multimedia device according to the information of the multimedia device occupied by the process; If the process is not currently using the multimedia device, determining whether the inactivity time of the process is greater than a preset time threshold; If it is greater than the preset time threshold, it is determined to optimize the process, otherwise the process is not optimized.
5. The method according to claim 3, characterized in that: The acquiring the inactive time of the process according to the window operation status includes: Monitoring the activity status of windows of the system; When it is monitored that the window is set as an active window, the time when the window becomes the active window is recorded, and the corresponding relationship between the window and its active time is saved; Acquire the process corresponding to the window according to the window, and establish a mapping relationship between the process and the window; Acquire the active time of the window according to the correspondence between the window and its active time, compare the active time with the current time, and calculate the difference between the active time and the current time; Performing a judgment based on the difference, if the difference is greater than a preset threshold, obtaining the process corresponding to the window based on the mapping relationship between the process and the window, and determining that the process is in an inactive state; The time during which the process is in the inactive state is obtained, where the time is the inactive time of the process.
6. The method according to any one of claims 1 to 5, characterized in that: The monitoring of the system message of the current system, and when the monitored system message is sent to the optimized process, restoring the process and sending the monitored system message to the process, comprises: Monitoring the minimization message and window activation message of the current system; When the minimization message or the window activation message is monitored, detecting whether the minimization message or the window activation message is sent to the optimized process; If yes, resuming the optimized process; The monitored minimization message or the window activation message is sent to the restored process.
7. A system performance optimization device, characterized in that: include: Process monitoring module, used to monitor the process of the current system; An optimization decision module, used for acquiring the process and performing activity detection on the process to determine whether to optimize the process; An optimization processing module, used for suspending the process when it is determined to optimize the process, so that the process does not respond to system messages; The process recovery module is used to monitor the system message of the current system, and when the monitored system message is sent to the optimized process, recover the process and send the monitored system message to the process.
8. An electronic device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1-6.
9. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises a computer program stored on a non-volatile computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by an electronic device, the electronic device executes the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Application program background process management method and device
CN102981906A
Process management method and management unit of Android system
CN103092691A
Power management method and device, computing equipment and storage medium
CN116520968A
Systems and methods for preventing injections of malicious processes in software
US20220207139A1