Resource optimization method and device

By obtaining the application program information and scenario information, and using large language models and pointer networks to determine candidate applications, the problem of resource optimization in the existing technology does not meet user needs, and more efficient system resource management and user experience improvement is achieved .

CN119088563APending Publication Date: 2024-12-06LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411205012.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When optimizing system resources, it is difficult for the prior art to accurately predict the user's current usage needs, resulting in the hibernable or closed application that does not meet user expectations and affects the user experience.

Method used

By obtaining program information and scenario information of each application, using a large language model and pointer network to determine candidate applications, control them to enter a dormant or closed state, and ensure that decisions meet user needs.

Benefits of technology

Improve user experience, ensure that resource optimization decisions are more in line with user expectations, release system resources, and improve system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088563A_ABST
    Figure CN119088563A_ABST
Patent Text Reader

Abstract

The invention discloses a resource optimization method and device, and relates to the technical field of artificial intelligence. The method comprises the steps of obtaining program information corresponding to each application program in an open state, and determining scene information corresponding to each application program based on a large language model; the program information is at least used for representing the occupation condition of each application program on system resources, and the scene information is at least used for representing the current use tendency condition of a user on each application program; determining at least one candidate application program from the application programs based on the program information and the scene information respectively corresponding to the application programs; and controlling the at least one candidate application program to enter a dormant state or a closed state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a resource optimization method and device. Background Art

[0002] In people's daily use of computers, they often open multiple applications without closing them immediately due to actual needs. As the task progresses, more and more applications are started, which will occupy system resources, such as memory, central processing unit (CPU) resources and disk space, etc., eventually leading to slow system response or system freeze, increased system memory pressure, and application crashes, thereby affecting user work efficiency and usage experience.

[0003] In order to overcome the above defects, the related art predicts the sequence of dormant or closable applications from the perspective of resource balance, and controls the predicted dormant or closable applications to enter a dormant state or a closed state. However, the dormant or closable applications predicted by the related art may not meet the user's current expectations, resulting in a poor user experience. Summary of the invention

[0004] In order to solve the above technical problems, the embodiments of the present application provide a resource optimization method and device.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a resource optimization method, including:

[0007] Obtaining program information corresponding to each application in an open state, and determining scenario information corresponding to each application based on the large language model; the program information is at least used to characterize the occupation of system resources by each application, and the scenario information is at least used to characterize the user's current usage tendency of each application;

[0008] Determine at least one candidate application from each application based on the application information and scenario information respectively corresponding to each application;

[0009] Control at least one candidate application to enter a dormant state or a closed state.

[0010] In some embodiments, determining the scenario information corresponding to each application based on the large language model includes:

[0011] Determine, based on the system log, a user behavior sequence corresponding to each application program, where the user behavior sequence is used to characterize at least one operation of the user on each application program;

[0012] Based on the user behavior sequences corresponding to each application, a large language model is used to generate the scenario information corresponding to each application.

[0013] In some embodiments, based on the user behavior sequences corresponding to the respective applications, the scenario information corresponding to the respective applications is generated using a large language model, including:

[0014] The specific prompt information is input into the large language model so that the large language model can perform inference analysis on the user behavior sequences corresponding to each application based on the specific prompt information to obtain the scenario information corresponding to each application.

[0015] In some embodiments, after determining at least one candidate application from each application based on the application information and the scenario information respectively corresponding to each application, the method further includes:

[0016] determining a reason for generating at least one candidate application;

[0017] Based on the generation reason of at least one candidate application, the parameters of the large language model are updated to obtain the large language model with updated parameters; the large language model with updated parameters is used to redetermine the scene information corresponding to each application next time.

[0018] In some embodiments, the scene information includes at least one of the following:

[0019] System status information, used to reflect the application currently in the task execution state among various applications;

[0020] User status information, which is used to reflect the user's current interest in the functions of each application;

[0021] Operation context information is used to reflect the user's current functional usage requirements for each application.

[0022] In some embodiments, obtaining program information corresponding to each application program in an open state includes:

[0023] Obtaining system resource usage data corresponding to each application in an open state;

[0024] Based on the system resource usage data corresponding to each application, the risk value corresponding to each application is determined; the risk value is used to characterize the risk of system freeze caused by the resource usage of each application;

[0025] Based on the system resource usage data and risk values ​​respectively corresponding to the application programs, program information respectively corresponding to the application programs is determined.

[0026] In some embodiments, based on the system resource usage data corresponding to each application program, determining the risk value corresponding to each application program includes:

[0027] Determine system resource limit data, where the system resource limit data is used to represent the maximum limit value of system resources that each application can occupy;

[0028] Based on the system resource limitation data and the system resource occupation data corresponding to each application program, a risk value corresponding to each application program is determined.

[0029] In some embodiments, based on the system resource usage data and risk value respectively corresponding to each application program, determining the program information respectively corresponding to each application program includes:

[0030] Determine the application priority corresponding to each application, and the application priority is positively correlated with the risk value;

[0031] Based on the system resource usage data, risk value and application priority respectively corresponding to each application, program information respectively corresponding to each application is determined.

[0032] In some embodiments, based on the program information and the scenario information respectively corresponding to each application, determining at least one candidate application from each application includes:

[0033] Inputting program information and scene information corresponding to each application into the pointer network, and obtaining at least one candidate application determined by the pointer network from each application;

[0034] The pointer network training process includes:

[0035] determining a reward value of the pointer network for candidate application decisions under the overall system constraints and associated application constraints;

[0036] Based on the reward value, the strategy of the pointer network decision candidate application is optimized;

[0037] The total system constraint is used to constrain the policy based on the system resource usage of each application, and the associated application constraint is used to constrain the policy based on the application programs respectively associated with each application program.

[0038] In a second aspect, an embodiment of the present application provides a resource optimization device, including:

[0039] An acquisition module, used to obtain program information corresponding to each application in an open state, and determine the scenario information corresponding to each application based on the large language model; the program information is at least used to characterize the occupation of system resources by each application, and the scenario information is at least used to characterize the user's current usage tendency of each application;

[0040] A determination module, configured to determine at least one candidate application from each application based on the application information and scenario information respectively corresponding to each application;

[0041] The control module is used to control at least one candidate application to enter a dormant state or a closed state.

[0042] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store executable data instructions; when the processor is used to execute the executable data instructions stored in the memory, the resource optimization method of the first aspect is implemented.

[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the resource optimization method of the first aspect is implemented.

[0044] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the resource optimization method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 One of the flow charts of a resource optimization method provided in an embodiment of the present application;

[0047] Figure 2 A second flow chart of a resource optimization method provided in an embodiment of the present application;

[0048] Figure 3 A third flow chart of a resource optimization method provided in an embodiment of the present application;

[0049] Figure 4 A fourth flow chart of a resource optimization method provided in an embodiment of the present application;

[0050] Figure 5One of the flowcharts of determining program information corresponding to each application program provided in an embodiment of the present application;

[0051] Figure 6 A second flow chart of determining program information corresponding to each application program provided in an embodiment of the present application;

[0052] Figure 7 A fifth flow chart of a resource optimization method provided in an embodiment of the present application;

[0053] Figure 8 A schematic diagram of the principle of generating candidate applications using a pointer network provided in an embodiment of the present application;

[0054] Fig. 9 A schematic diagram of a system framework for resource optimization provided in an embodiment of the present application;

[0055] Fig.10 A schematic diagram of the structure of a resource optimization device provided in an embodiment of the present application;

[0056] Fig.11 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.

[0058] It should be noted that in the description of the embodiments of the present application, the terms "first", "second", etc. are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.

[0059] In order to facilitate a clearer understanding of the embodiments of the present application, some related technologies are first introduced as follows.

[0060] In order to overcome the defects of slow system response or system freeze caused by launching too many applications during computer use, increased system memory pressure, application crashes, and thus affecting user work efficiency and usage experience, one related solution is to heuristically predict the sequence of closable applications based on factors such as process activity and resource usage. However, this method relies on experience and domain knowledge, and it is difficult to capture complex process behavior patterns and has poor generalization. Another related solution is to apply traditional operations research methods such as combinatorial optimization and linear programming methods to optimize resources, but this method has the problems of large solution space and complex and changeable scene logic.

[0061] With the continuous development and application of reinforcement learning technology, in recent years, reinforcement learning technology has been used to predict the sequence of applications that can be dormant or closed, and control the predicted dormant or closed applications to enter the dormant state or closed state, releasing some system resources for other applications to use. However, the technology based on reinforcement learning to predict the sequence of dormant or closed applications only makes decisions from the perspective of resource balance, ignoring the specific needs and scenarios of users' current use of each application, resulting in the predicted dormant or closed applications likely not meeting the user's current expectations, resulting in a poor user experience.

[0062] In order to overcome at least some of the above-mentioned defects existing in the related art, an embodiment of the present application provides a resource optimization method and device, by determining at least one candidate application that can enter a sleep state or a closed state from each application based on the program information and scenario information respectively corresponding to each application in an open state, and then controlling the at least one candidate application to enter a sleep state or a closed state; because the scenario information respectively corresponding to each application can at least characterize the user's current usage tendency for each application, therefore, combining the program information and scenario information respectively corresponding to each application can accurately predict the sleepable or closed applications, so that the candidate applications entering the sleep state or the closed state are more in line with the user's current expectations, thereby improving the user experience.

[0063] In the following, in conjunction with the drawings in the embodiments of the present application, a resource optimization method and device provided in the embodiments of the present application are exemplarily introduced.

[0064] Figure 1 One of the flow charts of a resource optimization method provided in an embodiment of the present application is as follows: Figure 1 As shown, the method includes:

[0065] S101. Obtain program information corresponding to each application in an open state, and determine scenario information corresponding to each application based on a large language model; the program information is at least used to characterize the occupation of system resources by each application, and the scenario information is at least used to characterize the user's current usage tendency for each application.

[0066] It should be noted that the application in the embodiments of the present application is an abbreviation for software application, which refers to a software program designed specifically for quickly running business and completing tasks. It may include but is not limited to the following applications: Desktop application: software installed on a personal computer or workstation, such as Word and Excel in the Microsoft Office suite; Web application: an application accessed through a web browser, such as online banking and social media platforms; Mobile application: software designed for smartphones and / or tablets; Server-side application: software running on a server that processes requests from clients, such as database servers and web servers; Utility application: an application that provides specific functions or tools, such as a calculator, text editor, and image viewer.

[0067] In some embodiments, each application in an open state may be determined based on processes currently running on the system.

[0068] In some embodiments, each open application can be determined through system monitoring tools (such as Process Explorer and ProcessMonitor).

[0069] In some embodiments, program information corresponding to each open application can be obtained based on the system log. The program information is at least used to characterize the occupation of system resources by each application. For example, it can characterize the occupation of system memory, central processing unit (CPU) and network bandwidth by each application.

[0070] In some embodiments, based on system logs and using a large language model, scenario information corresponding to each application can be determined. The scenario information is at least used to characterize the user's current usage tendency for each application. For example, it can characterize the user's current usage scenario or context for each application, as well as the user's current interest in using each application.

[0071] It should be noted that Large Language Models (LLM) are a type of deep learning model with a large number of parameters. In the field of natural language processing, it can learn language patterns, grammar and semantics by processing a large amount of text data, thereby generating natural language text or understanding the meaning of language text. With the emergence of artificial intelligence personal computers (AIPC), large language models can also run on personal computers with low resource consumption.

[0072] It should be noted that the system log is a log that records information about hardware, software, and system problems in the system, as well as events that occur in the monitoring system. System logs usually include system logs, application logs, and security logs. Among them, the system log is used to record the operating status and error information of system components (such as drivers, system services, operating systems, etc.); the application log is used to record the operating status and error information of applications; the security log is used to record security-related events, such as login attempts, permission changes, and security policy changes.

[0073] In an embodiment of the present application, the system log can be input into a large language model so that the large language model can perform reasoning analysis on the system log to obtain the scenario information corresponding to each application.

[0074] S102: Determine at least one candidate application from the applications based on the program information and the scenario information respectively corresponding to the applications.

[0075] In the embodiment of the present application, the program information and scenario information corresponding to each application can be combined to determine at least one candidate application that needs to enter a sleep state or a closed state from among the applications.

[0076] It should be noted that, since program information can at least be used to characterize the occupation of system resources by each application, scenario information can at least be used to characterize the user's current usage tendency of each application. Therefore, the embodiment of the present application combines program information and scenario information to more accurately determine at least one candidate application that needs to enter a dormant state or a closed state.

[0077] S103: Control the at least one candidate application to enter a dormant state or a closed state.

[0078] In the embodiment of the present application, after determining that at least one candidate application needs to enter a sleep state or a shutdown state, the at least one candidate application can be controlled to enter a sleep state or a shutdown state.

[0079] In some embodiments, a control instruction may be sent to a controller of each candidate application, where the control instruction is used to instruct the controller of each candidate application to control each candidate application to enter a dormant state or a closed state.

[0080] In some embodiments, each candidate application may be controlled to enter a dormant state or a closed state by electrical control.

[0081] It is understandable that after at least one candidate application determined by the control decision enters the dormant state or the closed state, a portion of system resources may be released for use by other applications.

[0082] It can be understood that the resource optimization method provided in the embodiment of the present application determines at least one candidate application that can enter a sleep state or a closed state from each application based on the program information and scenario information corresponding to each application in an open state, and then controls the at least one candidate application to enter a sleep state or a closed state; because the scenario information corresponding to each application can at least characterize the user's current usage tendency for each application, therefore, combining the program information and scenario information corresponding to each application can accurately predict the sleep-capable or close-able applications, so that the candidate applications that enter the sleep state or the closed state are more in line with the user's current expectations, thereby improving the user experience.

[0083] In some embodiments, the determining, based on the large language model, the scenario information corresponding to each application program includes:

[0084] Determine, based on the system log, a user behavior sequence corresponding to each of the application programs, wherein the user behavior sequence is used to characterize at least one operation performed by the user on each of the application programs;

[0085] Based on the user behavior sequences corresponding to the respective applications, the scenario information corresponding to the respective applications is generated using the large language model.

[0086] In an embodiment of the present application, a system log can be obtained first, and then a user behavior sequence corresponding to each application can be determined based on the system log, and the user behavior sequence can characterize at least one operation of the user for each application. Then, based on the user behavior sequence corresponding to each application, a large language model can be used to generate scene information corresponding to each application.

[0087] It should be noted that the at least one operation performed by the user on each application includes but is not limited to mouse operation, keyboard operation, touch operation, handwriting input, voice input, gesture recognition, and system call.

[0088] For example, Figure 2 A second flow chart of a resource optimization method provided in an embodiment of the present application is as follows: Figure 2 As shown, the method includes:

[0089] S201. Obtain program information corresponding to each application in an open state, and determine a user behavior sequence corresponding to each application based on a system log, wherein the user behavior sequence is used to characterize at least one operation performed by the user on each application.

[0090] S202: Based on the user behavior sequences corresponding to the applications, use the large language model to generate scenario information corresponding to the applications.

[0091] S203: Determine at least one candidate application from the applications based on the program information and the scenario information respectively corresponding to the applications.

[0092] S204: Control the at least one candidate application to enter a dormant state or a closed state.

[0093] It can be understood that the embodiments of the present application can effectively obtain the scenario information corresponding to each application by using a large language model to perform reasoning analysis on the user behavior sequences corresponding to each application.

[0094] In some embodiments, the generating the scenario information corresponding to each application program respectively based on the user behavior sequence corresponding to each application program respectively using the large language model includes:

[0095] The specific prompt information is input into the large language model so that the large language model can perform inference analysis on the user behavior sequences corresponding to each application based on the specific prompt information to obtain the scenario information corresponding to each application.

[0096] In the embodiment of the present application, a specific prompt information (prompt) may be set first, and the specific prompt information includes instruction information for indicating the task to be performed by the large language model, such as the instruction information for indicating the task to be performed by the large language model is: by reasoning and analyzing the user behavior sequence corresponding to each application, the scene information corresponding to each application is obtained. Therefore, after the specific prompt information is input into the large language model, the large language model will perform reasoning and analysis on the user behavior sequence corresponding to each application based on the specific prompt information to obtain the scene information corresponding to each application.

[0097] For example, Figure 3 A third flow chart of a resource optimization method provided in an embodiment of the present application is as follows: Figure 3As shown, the method includes:

[0098] S301. Obtain program information corresponding to each application in an open state, and determine a user behavior sequence corresponding to each application based on a system log, wherein the user behavior sequence is used to characterize at least one operation performed by the user on each application.

[0099] S302: Input the specific prompt information into the large language model, so that the large language model can perform inference analysis on the user behavior sequences corresponding to the respective applications based on the specific prompt information, and obtain the scenario information corresponding to the respective applications.

[0100] It should be noted that the user behavior sequences corresponding to the respective applications are also input into the large language model, and can be combined with specific prompt information into one piece of information for input.

[0101] S303: Determine at least one candidate application from the applications based on the program information and the scenario information respectively corresponding to the applications.

[0102] S304: Control the at least one candidate application to enter a dormant state or a closed state.

[0103] It can be understood that the embodiment of the present application inputs specific prompt information into the large language model, so that the large language model can perform inference analysis on the user behavior sequences corresponding to each application based on the specific prompt information, and effectively obtain the scenario information corresponding to each application.

[0104] In some embodiments, the scene information includes at least one of the following:

[0105] System status information, used to reflect the application program currently in the task execution state among the application programs;

[0106] User status information, used to reflect the user's current interest in the functions of each application;

[0107] The operation context information is used to reflect the user's current demand for the functions of the application programs.

[0108] In the embodiment of the present application, the scene information corresponding to each application includes at least one of system state information, user state information and operation context information. The system state information is used to reflect the application currently in the task execution state among the applications, for example, the current system is in a multi-tasking state, including a web browser that is downloading files, a file editor that is editing files, and a music player that is playing music; the operation context information is used to reflect the user's current functional use requirements for each application, for example, the user recently opened the three applications of web browser, file editor and music player, indicating that the user is in a multifunctional work and entertainment environment at this time, showing interests in web browsing, file editing and music appreciation; the operation context information is used to reflect the user's current functional use requirements for each application, for example, the user involved in file downloading, file editing and file browsing in the recent file activities, showing the user's needs for multiple operations, the web browser is in the downloading state, and the user may be acquiring some online resources, the file editor is in the file editing state, indicating that the user is doing document or office tasks, and the music player is playing music, indicating that the user may enjoy music while doing document or office tasks.

[0109] In some embodiments, specific prompt information can be input into the large language model to instruct the large language model to perform inference analysis on the user behavior sequences corresponding to each application to obtain system status information corresponding to each application that reflects the application currently in the task execution state, user status information that reflects the user's current interest in the functional use of each application, and operational context information that reflects the user's current demand for the functional use of each application.

[0110] For example, the specific prompt information is: given the user behavior sequences corresponding to each open application, please combine the functions of each application to generate scenario information corresponding to each application. The scenario information includes at least system status information that can reflect the application currently in the task execution state among the applications, user status information that can reflect the user's current interest in the functional use of each application, and operational context information that can reflect the user's current demand for the functional use of each application.

[0111] It can be understood that the embodiments of the present application determine system status information that can reflect the application currently in the task execution state among the applications, user status information that can reflect the user's current interest in the functional use of each application, and operational context information that can reflect the user's current functional use needs of each application, and then combine this information to help more accurately decide on at least one candidate application that needs to enter a sleep state or a closed state.

[0112] In some embodiments, after determining at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications, the method further includes:

[0113] determining a reason for generating the at least one candidate application;

[0114] Based on the generation reason of the at least one candidate application, the parameters of the large language model are updated to obtain a large language model with updated parameters; the large language model with updated parameters is used to redetermine the scenario information corresponding to each of the applications next time.

[0115] In an embodiment of the present application, after deciding on at least one candidate application, the large language model can be used to determine the reason for the generation of the at least one candidate application, and then based on the reason for the generation of the at least one candidate application, the parameters of the large language model are iteratively updated to obtain the large language model with updated parameters. The large language model with updated parameters can be used to redetermine the scenario information corresponding to each application next time.

[0116] In some embodiments, a decision on a candidate application may be made once at a specific time interval, and after each decision on a candidate application, the reason for the generation of the candidate application decided this time is determined (for example, the resource consumption of the candidate application decided this time is greater than a specific threshold), and the parameters of the large language model are updated based on the reason for the generation of the candidate application decided this time, so that the scenario information corresponding to each application can be re-determined the next time using the large language model with updated parameters.

[0117] It can be understood that the embodiment of the present application updates the parameters of the large language model based on the generation reason of at least one candidate application to obtain the large language model with updated parameters, so as to use the large language model with updated parameters to re-determine the scene information corresponding to each application next time, that is, to use the generation reason of at least one candidate application as the context of the large language model feedback, so as to further improve the understanding ability of the large language model when generating scene information. While generating the candidate application, the large language model is called to generate the generation reason of the candidate application, and the candidate application and the generation reason are input as feedback context into the next scene information generation, so as to further optimize the scene information generated by the large language model.

[0118] In some embodiments, obtaining program information corresponding to each application program in an open state includes:

[0119] Obtaining system resource usage data corresponding to each application in an open state;

[0120] Based on the system resource occupancy data corresponding to each application program, determining a risk value corresponding to each application program; the risk value is used to characterize the risk of system freeze caused by the resource occupancy of each application program;

[0121] Based on the system resource occupancy data respectively corresponding to the application programs and the risk value, program information respectively corresponding to the application programs is determined.

[0122] It should be noted that the system resource usage data corresponding to each application includes but is not limited to CPU usage, memory usage and network bandwidth.

[0123] In an embodiment of the present application, the system resource usage data corresponding to each open application can be first obtained based on a system command or a resource monitor, and then, based on the system resource usage data corresponding to each application, a risk value corresponding to each application can be determined. The risk value can characterize the risk of system freezes caused by the resource usage of each application, and then, based on the system resource usage data and risk value corresponding to each application, the program information corresponding to each application can be determined.

[0124] For example, Figure 4 A fourth flow chart of a resource optimization method provided in an embodiment of the present application is as follows: Figure 4 As shown, the method includes:

[0125] S401: Obtain system resource usage data corresponding to each application program in an open state.

[0126] S402. Determine risk values ​​corresponding to each application based on system resource usage data corresponding to each application; the risk values ​​are used to characterize the risk of system freezes caused by resource usage of each application.

[0127] S403: Determine program information corresponding to each application based on the system resource usage data corresponding to each application and the risk value.

[0128] S404: Determine, based on the system log, a user behavior sequence corresponding to each of the application programs, wherein the user behavior sequence is used to characterize at least one operation performed by the user on each of the application programs.

[0129] S405: Input the specific prompt information into the large language model, so that the large language model can perform inference analysis on the user behavior sequences corresponding to the respective applications based on the specific prompt information, and obtain the scenario information corresponding to the respective applications.

[0130] S406: Determine at least one candidate application from the applications based on the program information and the scenario information respectively corresponding to the applications.

[0131] S407: Control the at least one candidate application to enter a dormant state or a closed state.

[0132] It should be noted that S401 to S403 and S404 to S405 have no sequential relationship and can be executed simultaneously or in sequence according to the above steps.

[0133] It can be understood that the embodiment of the present application determines the risk value corresponding to each application based on the system resource usage data corresponding to each application, and then combines the system resource usage data and risk value corresponding to each application to determine the program information corresponding to each application, so that the program information can more comprehensively and accurately represent the occupation of system resources by each application.

[0134] In some embodiments, determining the risk value corresponding to each application program based on the system resource usage data corresponding to each application program includes:

[0135] Determine system resource limit data, where the system resource limit data is used to represent a maximum limit value of system resources that each application can occupy;

[0136] Based on the system resource limitation data and the system resource occupation data corresponding to each of the application programs, the risk value corresponding to each of the application programs is determined.

[0137] It should be noted that the system resource limit data may be pre-configured data in the system, which is used to set a maximum limit on the system resources occupied by the application program, wherein the system resource limit data may include but is not limited to the system CPU occupancy limit value and the system memory occupancy limit value.

[0138] In the embodiment of the present application, system resource limitation data may be first obtained, and then based on the system resource limitation data and the system resource occupancy data corresponding to each application, the risk value corresponding to each application may be determined.

[0139] For example, Figure 5 One of the flowcharts of determining program information corresponding to each application program provided in an embodiment of the present application, the method includes:

[0140] S501. Obtain system resource occupancy data corresponding to each application program in an open state, and determine system resource limit data, wherein the system resource limit data is used to represent a maximum limit value of system resources that each application program can occupy.

[0141] In some embodiments, the system resource limitation data may be obtained by way of system commands or by querying a system configuration file.

[0142] S502: Determine the risk value corresponding to each application program based on the system resource limitation data and the system resource occupation data corresponding to each application program.

[0143] In some embodiments, the risk value corresponding to each application program may be determined based on the following formula (1):

[0144]

[0145] Among them, α, β, γ, δ, e are weights, Respectively represent the CPU usage, memory usage and network bandwidth of the i-th application, Resource_limit_factor cpu Indicates the system CPU usage limit value, Resource_limit_factor memory Indicates the system memory usage limit value.

[0146] S503: Determine program information corresponding to each application based on the system resource usage data corresponding to each application and the risk value.

[0147] It can be understood that the embodiments of the present application can more accurately determine the risk value corresponding to each application based on the system resource limitation data and the system resource usage data corresponding to each application, and further help to combine the risk value and system resource usage data corresponding to each application to accurately determine the program information corresponding to each application.

[0148] In some embodiments, determining the program information corresponding to each application based on the system resource usage data corresponding to each application and the risk value includes:

[0149] Determine an application priority corresponding to each of the applications, wherein the application priority is positively correlated with the risk value;

[0150] Based on the system resource occupancy data, the risk value and the application priority corresponding to each of the application programs, program information corresponding to each of the application programs is determined.

[0151] In some embodiments, the application priority corresponding to each application can be determined based on a specific priority setting rule, and the application priority is positively correlated with the risk value. For example, if the risk value of an application is above 80%, the priority of the application is the first priority; for another example, if the risk value of an application is between 50% and 80%, the priority of the application is the second priority; for another example, if the risk value of an application is between 20% and 50%, the priority of the application is the third priority; for another example, if the risk value of an application is below 20%, the priority of the application is the fourth priority.

[0152] It should be noted that the higher the risk value and the less frequently used the application is, the higher the priority is.

[0153] In an embodiment of the present application, the program information corresponding to each application can be determined based on the system resource occupancy data, risk value and application priority corresponding to each application, so that the program information can more comprehensively and accurately represent the occupancy of system resources by each application.

[0154] For example, Figure 6 A second flow chart of determining program information corresponding to each application program provided in an embodiment of the present application is as follows: Figure 6 As shown, the method includes:

[0155] S601. Obtain system resource occupancy data corresponding to each application program in an open state, and determine system resource limit data, wherein the system resource limit data is used to represent a maximum limit value of system resources that each application program can occupy.

[0156] S602: Determine the risk value corresponding to each application based on the system resource limitation data and the system resource occupation data corresponding to each application.

[0157] S603: Determine application priorities corresponding to each of the applications, wherein the application priorities are positively correlated with the risk value.

[0158] S604: Determine program information corresponding to each application based on the system resource usage data, the risk value, and the application priority corresponding to each application.

[0159] It can be understood that the embodiment of the present application determines the program information corresponding to each application by combining the system resource occupancy data, risk value and application priority corresponding to each application, so that the program information can more comprehensively and accurately represent the occupancy of system resources by each application.

[0160] In some embodiments, the determining at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications includes:

[0161] Inputting the program information and the scene information respectively corresponding to the respective applications into a pointer network, and obtaining at least one candidate application determined by the pointer network from the respective applications;

[0162] The pointer network training process includes:

[0163] Determining a reward value of the pointer network for candidate application decisions under overall system constraints and associated application constraints;

[0164] Based on the reward value, optimizing the strategy of the pointer network to decide the candidate application;

[0165] The overall system constraint is used to constrain the policy based on the system resource usage of each application, and the associated application constraint is used to constrain the policy based on the application programs respectively associated with each application program.

[0166] It should be noted that the traditional sequence-to-sequence model (Seq2Seq) faces a problem when generating discrete sequences: each element of the output is selected from a predefined vocabulary. This method may encounter difficulties when dealing with generative tasks, such as when the output is a subset of the input set, that is, the vocabulary of the output sequence changes as the length of the input sequence changes. The pointer network can overcome this defect by introducing a "pointer" mechanism, which allows the network to directly select a specific position in the input sequence as the output instead of selecting from a fixed vocabulary. Therefore, the output of the pointer network can be any position in the input sequence, allowing the pointer network to more flexibly handle sequences of different lengths and contents.

[0167] It should be noted that the structure of the pointer network includes an encoder and a decoder. The encoder is used to convert the input sequence into a fixed-dimensional context vector, and the decoder is used to generate the pointer position of the output sequence based on the context vector.

[0168] In an embodiment of the present application, when determining at least one candidate application from each open application, the program information and scene information corresponding to each application are input into the pointer network as a sequence to obtain at least one candidate application determined by the pointer network from each application.

[0169] For example, Figure 7A fifth flow chart of a resource optimization method provided in an embodiment of the present application is as follows: Figure 7 As shown, the method includes:

[0170] S701. Obtain program information corresponding to each application in an open state, and determine scene information corresponding to each application based on a large language model.

[0171] S702: Input the program information and the scene information respectively corresponding to the various applications into a pointer network, and obtain at least one candidate application determined by the pointer network from the various applications.

[0172] S703: Control the at least one candidate application to enter a dormant state or a closed state.

[0173] In some embodiments, the pointer network may be pre-trained so that the pointer network learns how to select appropriate applications from an input sequence (i.e., program information and scene information corresponding to each application) as an output sequence, i.e., candidate applications to be closed or dormant.

[0174] In some embodiments, the pointer network can be trained offline through deep reinforcement learning, and during the training process, the reward value of the pointer network for the candidate application decision is determined under the overall system constraint and the associated application constraint, and then based on the reward value, the strategy of the pointer network for the candidate application decision is optimized. Among them, the overall system constraint is to constrain the strategy of its decision based on the system resource occupancy of each application, and the associated application constraint is to constrain the strategy of its decision based on the application associated with each application.

[0175] It should be noted that for the total system constraint, assuming that the system resource occupancy rate of each application in the open state is less than a specific value, that is, the system resource occupancy rate is low, then the constraint pointer network does not need to make a decision on the candidate applications that can be closed or dormant, or the candidate applications that can be closed or dormant decided by the constraint pointer network are empty. In other words, when the system is in a more appropriate resource occupancy state, the pointer network can stop predicting candidate applications that can be closed or dormant.

[0176] It should be noted that for the associated application constraint, it is assumed that one of the two associated applications is decided by the pointer network as an application that should be closed, and the other application is decided as an application that should not be closed, but since the two applications are associated, that is, the two applications are running in the same process, if one of them is closed, the other will also be closed, so the associated application constraint is used to constrain the pointer network not to determine the application that should be closed as a candidate application.

[0177] For example, Figure 8 A schematic diagram of the principle of generating candidate applications using a pointer network provided in an embodiment of the present application, such as Figure 8 As shown, there are N applications, and the program information and scene information corresponding to each application are represented by vector VI 1 , Vector VI 2 , Vector VI 3 , ..., Vector VI N Represents. The vector VI 1 To VI N Input the embedding layer of the encoder of the pointer network to obtain the embedding representation corresponding to each vector Then the embedding representation The input recursive neural network reads each node one by one, and the output of the i-th time step is the hidden state e i =e 1 ,e 2 ,e 3 ,...,e N , the decoder also uses a recurrent neural network and outputs a hidden state d at each time step i =d 1 ,d 2 ,d 3 , d 4 ,...,d N , the final decoder outputs the location of the candidate application based on the hidden state. Figure 8 C represents the input of the encoder, G represents the input of the decoder, and E represents the final output.

[0178] In some embodiments, assume that there are three applications A, B, and C, and the program information corresponding to each application includes CPU usage, memory occupancy, network bandwidth, risk value, and application priority P, and each application has corresponding scenario information. The program information and scenario information corresponding to each application can be expressed as a vector, as shown in the following formulas (2), (3), and (4):

[0179] VI1 =[0.8,0.2,0.1,0.5,…,Context Embedding A ,P A ](2)

[0180] VI 2 =[0.5,0.4,0.3,0.3,…,Context Embedding B ,P B ](3)

[0181] VI 3 =[0.7,0.3,0.2,0.6,…,Context Embedding C ,P C ](4)

[0182] Among them, Context Embedding A Context Embedding B and Context Embedding C Indicates the scene information corresponding to applications A, B, and C respectively, P A , P B and P C Represent the application priorities of applications A, B, and C respectively.

[0183] Since each vector contains different data types: numerical part, context embedding part and priority, they are mapped and merged through their respective Embedding mappings. The numerical part is mapped to Num_Embedding, the context embedding part can directly use Context Embedding, and the priority is mapped to Priority_Embedding. Finally, they are merged into a vector VI = [Num_Embedding, Context_Embedding, Priority_Embedding].

[0184] In some embodiments, the decoder of the pointer network introduces a constraint penalty term when decoding, so that the pointer network training process can better meet the constraint conditions. For example, the total system constraint C is penalized by the following formula (5):

[0185]

[0186] Among them, λ is the weight, penalty is the penalty function, r iIndicates the system resource usage value after closing the current i-th application. If the system resource usage value is less than the value of the overall constraint, it means that there is no need to close the application optimization under the current system resources. By adding a penalty term, the pointer network is prompted to stop generating in advance.

[0187] In some embodiments, the penalty S for the associated application constraint may be calculated as follows:

[0188]

[0189] in, represents the weight, penalty is the penalty function, S i Indicates the number of applications associated with the current i-th application.

[0190] In some embodiments, the pointer network can be trained by offline training, that is, input data is obtained from the system offline log, and the sequence is segmented by time window, and the input sequence is selected by sliding. Since it is difficult to obtain data labels of a large number of applications that are actually closed or dormant by users, the embodiment of the present application adopts deep reinforcement learning to train the pointer network offline.

[0191] In some embodiments, the pointer network can be trained using a Monte Carlo policy gradient method.

[0192] It should be noted that the Monte Carlo policy gradient method is a method for directly optimizing strategies in reinforcement learning. The core idea of ​​this method is to estimate the gradient of the strategy by sampling a complete trajectory (i.e., a complete episode or round), and update the policy parameters accordingly to maximize the expected return. For example, the reward function shown in the following equation (7) can be defined:

[0193]

[0194] Where π represents the policy, S represents the associated application constraints, C represents the total system constraints, n represents the number of sampled trajectories, and R π (i) represents the return of the i-th trajectory, γ i represents the weight of the reward of the ith trajectory.

[0195] It can be understood that, given the total system constraint C and the associated application constraint S, formula (7) can maximize the cumulative reward value L of a certain application sequence, that is, the greater the cumulative risk of the generated application sequence, the higher the reward value.

[0196] It should be noted that the pointer network trained offline can be directly applied to the generation of online application sequence decisions, and sequence decision data can be continuously collected online.

[0197] It is understandable that, on the one hand, the embodiment of the present application utilizes a large language model to convert the relationship between the user behavior sequence and the current application into a text vector representation, provides contextual text features (i.e., scene information) when predicting candidate applications, strengthens the understanding of the context when predicting the pointer network, and more accurately expresses the user's current use of each application scenario and needs. On the other hand, the embodiment of the present application inputs program information and scene information into the pointer network to perform a combinatorial optimization solution for a sequence of dormant or closable applications. At the same time, since the combinatorial optimization solution is a non-deterministic problem and it is difficult to obtain the optimal label, deep reinforcement learning is used to train the pointer network offline, and the feasible solution is verified by the reward function to solve the problem of difficulty in obtaining training corpus.

[0198] For example, Fig. 9 A schematic diagram of a resource optimization system framework provided in an embodiment of the present application, such as Fig. 9 As shown, the program information extraction model determines the resource occupancy value, application risk value and application priority of each application. The scenario information generation module uses the large language model to generate the scenario information of the current user using the application based on the user behavior sequence and specific prompt information, and converts the scenario information into text embedding features. The constraint module sets two constraints: the total system constraint C and the associated application constraint S. Moreover, the program information extraction model, the scenario information generation module and the constraint module input the input matrix M composed of their respective information to the pointer network for the pointer network to make decisions on the candidate closed application sequence (i.e., the candidate application sequence that can be closed or dormant). Then, the large language model LLM generates the reasons for the generation of the candidate closed application sequence, which is used as feedback to update the parameters of the large language model. In addition, the pointer network is trained offline through deep reinforcement learning to optimize the strategy of the pointer network in deciding the candidate closed application sequence.

[0199] It can be understood that when system resources are limited, the embodiments of the present application can combine the large language model and the pointer network to accurately predict the sequence of candidate applications that can be closed or dormant, so that the candidate applications that enter the dormant state or the closed state are more in line with the user's current expectations, thereby improving the user experience.

[0200] The resource optimization device provided in the embodiment of the present application is described below. The resource optimization device described below and the resource optimization method described above can be referenced to each other.

[0201] Fig.10 A schematic diagram of a resource optimization device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the device includes: an acquisition module 1010, a determination module 1020 and a control module 1030; wherein:

[0202] The acquisition module 1010 is used to obtain program information corresponding to each application in an open state, and determine the scenario information corresponding to each application based on the large language model; the program information is at least used to characterize the occupation of system resources by each application, and the scenario information is at least used to characterize the user's current usage tendency of each application;

[0203] A determination module 1020, configured to determine at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications;

[0204] The control module 1030 is used to control the at least one candidate application to enter a dormant state or a closed state.

[0205] In some embodiments, the obtaining module 1010 includes:

[0206] A first determining unit, configured to determine, based on a system log, user behavior sequences corresponding to the respective applications, wherein the user behavior sequences are used to characterize at least one operation performed by the user on the respective applications;

[0207] A generating unit is used to generate the scenario information corresponding to each application respectively by using the large language model based on the user behavior sequence corresponding to each application respectively.

[0208] In some embodiments, the generating unit is specifically used for:

[0209] The specific prompt information is input into the large language model so that the large language model can perform inference analysis on the user behavior sequences corresponding to each application based on the specific prompt information to obtain the scenario information corresponding to each application.

[0210] In some embodiments, the determining module 1020 includes:

[0211] A second determining unit, configured to determine a generation reason of at least one candidate application after determining at least one candidate application from the applications based on the program information and the scenario information respectively corresponding to the applications;

[0212] An updating unit is used to update the parameters of the large language model based on the generation reason of the at least one candidate application to obtain a large language model with updated parameters; the large language model with updated parameters is used to redetermine the scene information corresponding to each of the applications next time.

[0213] In some embodiments, the scene information includes at least one of the following:

[0214] System status information, used to reflect the application program currently in the task execution state among the application programs;

[0215] User status information, used to reflect the user's current interest in the functions of each application;

[0216] The operation context information is used to reflect the user's current demand for the functions of the application programs.

[0217] In some embodiments, the obtaining module 1010 includes:

[0218] An obtaining unit, used to obtain system resource occupancy data corresponding to each application program in an open state;

[0219] A third determining unit is used to determine the risk value corresponding to each application based on the system resource occupation data corresponding to each application; the risk value is used to characterize the risk of system freeze caused by the resource occupation of each application;

[0220] The fourth determining unit is used to determine the program information corresponding to each of the application programs based on the system resource occupation data corresponding to each of the application programs and the risk value.

[0221] In some embodiments, the third determining unit is further configured to:

[0222] Determine system resource limit data, where the system resource limit data is used to represent a maximum limit value of system resources that each application can occupy;

[0223] Based on the system resource limitation data and the system resource occupation data corresponding to each of the application programs, the risk value corresponding to each of the application programs is determined.

[0224] In some embodiments, the third determining unit is further configured to:

[0225] Determine an application priority corresponding to each of the applications, wherein the application priority is positively correlated with the risk value;

[0226] Based on the system resource occupancy data, the risk value and the application priority corresponding to each of the application programs, program information corresponding to each of the application programs is determined.

[0227] In some embodiments, the determining module 1020 is further configured to:

[0228] Inputting the program information and the scene information respectively corresponding to the respective applications into a pointer network, and obtaining at least one candidate application determined by the pointer network from the respective applications;

[0229] The pointer network training process includes:

[0230] Determining a reward value of the pointer network for candidate application decisions under overall system constraints and associated application constraints;

[0231] Based on the reward value, optimizing the strategy of the pointer network to decide the candidate application;

[0232] The overall system constraint is used to constrain the policy based on the system resource occupancy of each application program, and the associated application constraint is used to constrain the policy based on the application programs respectively associated with each application program.

[0233] It should be noted here that the above-mentioned resource optimization device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned resource optimization method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0234] Fig.11 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application, such as Fig.11 As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120 and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 may call the executable data instructions stored in the memory 1130 to execute part or all of the steps in the resource optimization method provided in the above embodiments.

[0235] In addition, the executable data instructions stored in the above-mentioned memory 1130 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0236] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, some or all of the steps in the resource optimization method provided in the above embodiments are implemented.

[0237] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute some or all of the steps in the resource optimization method provided in the above embodiments.

[0238] 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 displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0239] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0240] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0241] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0242] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0243] The above description is merely an optional embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A resource optimization method, comprising: Obtaining program information corresponding to each application in an open state, and determining scene information corresponding to each application based on a large language model; The program information is at least used to characterize the occupation of system resources by each of the applications, and the scenario information is at least used to characterize the user's current usage tendency of each of the applications; Determine at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications; The at least one candidate application is controlled to enter a dormant state or a closed state.

2. According to the resource optimization method of claim 1, the determining the scenario information corresponding to each application based on the large language model comprises: Determine, based on the system log, a user behavior sequence corresponding to each of the application programs, wherein the user behavior sequence is used to characterize at least one operation performed by the user on each of the application programs; Based on the user behavior sequences corresponding to the respective applications, the scenario information corresponding to the respective applications is generated using the large language model.

3. The resource optimization method according to claim 2, wherein the generating the scenario information corresponding to each application program using the large language model based on the user behavior sequence corresponding to each application program comprises: The specific prompt information is input into the large language model so that the large language model can perform inference analysis on the user behavior sequences corresponding to each application based on the specific prompt information to obtain the scenario information corresponding to each application.

4. The resource optimization method according to claim 1, after determining at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications, the method further comprises: determining a reason for generating the at least one candidate application; Based on the generation reason of the at least one candidate application, the parameters of the large language model are updated to obtain a large language model with updated parameters; the large language model with updated parameters is used to redetermine the scenario information corresponding to each of the applications next time.

5. The resource optimization method according to any one of claims 1 to 4, wherein the scene information includes at least one of the following: System status information, used to reflect the application program currently in the task execution state among the application programs; User status information, used to reflect the user's current interest in the functions of each application; The operation context information is used to reflect the user's current demand for the functions of the application programs.

6. The resource optimization method according to any one of claims 1 to 4, wherein the step of obtaining program information corresponding to each application program in an open state comprises: Obtaining system resource usage data corresponding to each application in an open state; Determining the risk value corresponding to each application program based on the system resource occupation data corresponding to each application program; The risk value is used to characterize the risk of the system freezing caused by the resource occupation of each application program; Based on the system resource occupancy data respectively corresponding to the application programs and the risk value, program information respectively corresponding to the application programs is determined.

7. The resource optimization method according to claim 6, wherein determining the risk value corresponding to each application based on the system resource occupancy data corresponding to each application comprises: Determine system resource limit data, where the system resource limit data is used to represent a maximum limit value of system resources that each application can occupy; Based on the system resource limitation data and the system resource occupation data corresponding to each of the application programs, the risk value corresponding to each of the application programs is determined.

8. The resource optimization method according to claim 6, wherein determining the program information corresponding to each application based on the system resource occupancy data corresponding to each application and the risk value comprises: Determine an application priority corresponding to each of the applications, wherein the application priority is positively correlated with the risk value; Based on the system resource occupancy data, the risk value and the application priority respectively corresponding to the respective application programs, program information respectively corresponding to the respective application programs is determined.

9. The resource optimization method according to any one of claims 1 to 4, wherein the determining at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications comprises: Inputting the program information and the scene information respectively corresponding to the respective applications into a pointer network, and obtaining at least one candidate application determined by the pointer network from the respective applications; The pointer network training process includes: Determining a reward value of the pointer network for candidate application decisions under overall system constraints and associated application constraints; Based on the reward value, optimizing the strategy of the pointer network to decide the candidate application; The overall system constraint is used to constrain the policy based on the system resource usage of each application, and the associated application constraint is used to constrain the policy based on the application programs respectively associated with each application program.

10. A resource optimization device, comprising: An acquisition module, used to obtain program information corresponding to each application in an open state, and determine scenario information corresponding to each application based on a large language model; the program information is at least used to characterize the occupation of system resources by each application, and the scenario information is at least used to characterize the user's current usage tendency of each application; A determination module, configured to determine at least one candidate application from the applications based on the application information and the scenario information respectively corresponding to the applications; The control module is used to control the at least one candidate application to enter a dormant state or a closed state.