System resource dynamic allocation method and device, electronic equipment and storage medium
By monitoring user behavior and application priorities and dynamically adjusting resource allocation strategies, the problems of low resource utilization and insufficient performance of critical tasks in the existing technology are solved, and efficient management of system resources and user experience improvement are achieved.
Patent Information
- Application Number
- CN202510204182.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art lacks comprehensive considerations for user behavior and application priorities, resulting in low resource utilization or insufficient task-critical performance.
By monitoring user behavior, calculating user activity and application priority scores, predicting resource requirements, and setting upper and lower limit thresholds to dynamically adjust resource allocation strategies to monitor allocation effects in real time.
It achieves an accurate grasp of user behavior and application needs, improves resource utilization and system performance, and ensures the stable operation of critical tasks.
Smart Images

Figure CN120335980A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer system resource management, and particularly to a method, apparatus, electronic device, and storage medium for dynamically allocating system resources. Background Art
[0002] With the rapid development of information technology, computer systems have become increasingly complex, and user requirements have also become increasingly diverse. The traditional static resource allocation method can no longer meet the needs of modern computer systems, and the efficiency and flexibility of the resource management mechanism of the operating system (such as CPU scheduling, memory allocation, disk I / O management, etc.) have become the key to system performance.
[0003] In the traditional resource allocation method, system resources are often allocated based on fixed rules or preset thresholds, lacking real-time consideration of user behavior and application requirements. This method may perform well when the system load is relatively stable, but it is inadequate when faced with complex and variable user behavior and application requirements. On the one hand, it will lead to low resource utilization and resource waste; on the other hand, it cannot meet the resource requirements of critical tasks, thus affecting system performance and user experience.
[0004] Although existing resource allocation methods consider system load to a certain extent, they usually rely only on simple statistical information and lack in-depth analysis. For example, they only adjust resource allocation based on CPU usage or memory occupancy, ignoring specific requirements. This crude resource allocation method not only fails to meet the performance requirements of modern systems but may also cause resource competition and conflicts, further reducing system efficiency.
[0005] Therefore, there is a need for a system resource dynamic allocation method that can comprehensively consider multiple factors such as user behavior, application priority, and system load, and intelligently and flexibly achieve dynamic allocation and optimization of system resources. Summary of the Invention
[0006] Embodiments of the present invention provide a method for dynamically allocating system resources to solve the problem in the prior art that the lack of comprehensive consideration of user behavior and application priority leads to low resource utilization or insufficient performance of critical tasks. The technical solution is as follows:
[0007] According to one aspect of the present invention, a method for dynamically allocating system resources, the method comprising: monitoring and recording user behaviors in the system; the user behaviors including the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of application programs; calculating a user activity score and an application program priority score according to the user behaviors, predicting the resource requirements of each application program in the system to obtain a prediction result, and comprehensively calculating the predicted resource requirements; setting upper and lower threshold values for the use of system resources according to the predicted resource requirements, and dynamically adjusting the resource allocation strategy according to the upper and lower threshold values; dynamically allocating resources to the system according to the resource allocation strategy, and real-time monitoring the resource allocation effect of the system.
[0008] In one embodiment, the calculation formula for calculating the user activity score according to the user behaviors includes:
[0009] Au(t) = (M(t) + K(t)) / T;
[0010] Wherein, the Au(t) represents the user activity score within the time period t, the M(t) represents the number of mouse clicks within the time period t, the K(t) represents the number of keyboard inputs within the time period t, and the T represents the total duration of the time period t.
[0011] In one embodiment, the calculation formula for calculating the application program priority score according to the user behaviors includes:
[0012] Pa = α × Pu + β × Ps;
[0013] Wherein, the Pa represents the application program priority score, α and β respectively represent the weight coefficients of the user priority and the system default priority, and Pu and Ps respectively represent the user priority and the system default priority.
[0014] In one embodiment, the calculation formula for predicting the resource requirements of each application program in the system to obtain a prediction result includes:
[0015] Ra(t) = Au(t) × Pa × benchmark resource requirement;
[0016] Wherein, the Ra(t) represents the predicted result of the resource requirement of application program a within the time period t, and the benchmark resource requirement is determined according to the historical average resource usage of the application program.
[0017] In one embodiment, the calculation formula for comprehensively calculating the predicted resource requirements includes:
[0018]
[0019] Wherein, the R 总Represents the predicted resource demand within the time period t.
[0020] In one embodiment, upper and lower limit thresholds for the system resource usage are set according to the predicted resource demand, and the resource allocation strategy is dynamically adjusted according to the upper and lower limit thresholds through the following steps: When the predicted resource demand exceeds 80% of the total system resources, prioritize ensuring the resource allocation for high-priority applications; when the predicted resource demand is lower than 50% of the total system resources, release some resources for other tasks to use.
[0021] In one embodiment, the resource allocation effect of the system is monitored in real time through the following steps: Monitor the resource allocation effect in real time to obtain operation data, and perform data analysis and prediction on the operation data to optimize the resource prediction and allocation strategy of the system.
[0022] According to one aspect of the present invention, a system resource dynamic allocation device, the device includes: a data collection module, configured to monitor and record user behaviors in the system; the user behaviors include the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of application programs; a data analysis and prediction module, configured to calculate a user activity score and an application program priority score according to the user behaviors, predict the resource demands of each application program in the system to obtain a prediction result, and comprehensively calculate the predicted resource demand; a resource allocation decision module, configured to set upper and lower limit thresholds for the system resource usage according to the predicted resource demand, and dynamically adjust the resource allocation strategy according to the upper and lower limit thresholds; a resource management execution module, configured to perform dynamic resource allocation on the system according to the resource allocation strategy, and monitor the resource allocation effect of the system in real time.
[0023] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein, computer-readable instructions are stored on the memory; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements a system resource dynamic allocation method as described above.
[0024] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement a system resource dynamic allocation method as described above.
[0025] The beneficial effects brought by the technical solution provided by the present invention are:
[0026] In the above technical solution, the present invention first comprehensively collects user behavior data, including information such as usage habits, preferences, and application activity, providing a solid foundation for subsequent analysis. Then, by applying advanced data analysis and prediction techniques, it deeply mines user behavior patterns, predicts future resource demand trends and changes in application priorities, taking into account not only the user's historical behavior but also incorporating real-time data to ensure the accuracy and timeliness of the prediction results. Based on the prediction results, it intelligently formulates resource allocation strategies to ensure the reasonable configuration and efficient utilization of resources. During this process, the system dynamically adjusts resource allocation according to the application priority, resource demand, and current system status to meet the needs of different applications. Finally, by continuously monitoring the resource usage effect, collecting and processing feedback information, it provides strong support for the continuous optimization and upgrade of the system, ensuring that the system can continuously adapt to the changing environment and requirements and maintain an efficient and stable operating state. Through intelligent prediction and management methods, it realizes the accurate grasp and efficient utilization of user behavior, application requirements, and system resources, providing a strong guarantee for improving the overall system performance and user experience, and achieving the accurate prediction and efficient management of user behavior, application requirements, and system resources, thus effectively solving the problems of low resource utilization or insufficient performance of key tasks caused by the lack of comprehensive consideration of user behavior and application program priorities in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0028] Figure 1 is a flowchart of a method for dynamically allocating system resources shown according to an exemplary embodiment;
[0029] Figure 2 is a schematic flow diagram of a method for dynamically allocating system resources shown according to an exemplary embodiment;
[0030] Figure 3 is Figure 2 a schematic diagram for calculating predicted resource requirements in the corresponding embodiment;
[0031] Figure 4 is a schematic structural diagram of a method for dynamically allocating system resources shown according to an exemplary embodiment;
[0032] Figure 5 is a block diagram of a device for dynamically allocating system resources shown according to an exemplary embodiment;
[0033] Figure 6 is a hardware structure diagram of an electronic device shown according to an exemplary embodiment;
[0034] Figure 7 is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners
[0035] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention.
[0036] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "including" used in the specification of the present disclosure means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more related listed items.
[0037] The present invention provides a method for dynamically allocating system resources. Through an intelligent prediction and management method, it realizes accurate grasp and efficient utilization of user behavior, application requirements and system resources, and can effectively solve the problem that the existing technology lacks comprehensive consideration of user behavior and application program priorities, resulting in low resource utilization or insufficient performance of critical tasks. The method for dynamically allocating system resources is applicable to a system resource dynamic allocation device, and the system resource dynamic allocation device can be an electronic device. The method for dynamically allocating system resources in the embodiments of the present invention can be applied to various scenarios, such as system resource dynamic allocation, etc.
[0038] Please refer to Figure 1 , the embodiments of the present invention provide a method for dynamically allocating system resources, and this method is applicable to an electronic device.
[0039] In the following method embodiments, for the sake of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation thereto.
[0040] As Figure 1 shown, this method may include the following steps:
[0041] Step 110, monitor and record user behavior in the system.
[0042] Among them, user behavior includes the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of applications.
[0043] Step 130, calculate the user activity score and the application priority score according to the user behavior, predict the resource requirements of each application in the system to obtain a prediction result, and comprehensively calculate the predicted resource requirements.
[0044] In a possible implementation, the calculation formula for calculating the user activity score according to the user behavior is:
[0045] Au(t) = (M(t) + K(t)) / T;
[0046] Among them, Au(t) represents the user activity score within the time period t, M(t) represents the number of mouse clicks within the time period t, K(t) represents the number of keyboard inputs within the time period t, and T represents the total duration of the time period t.
[0047] In a possible implementation, the calculation formula for calculating the application priority score according to the user behavior is:
[0048] Pa = α × Pu + β × Ps;
[0049] Among them, Pa represents the application priority score, α and β respectively represent the weight coefficients of the user priority and the system default priority, and Pu and Ps respectively represent the user priority and the system default priority.
[0050] In a possible implementation, the calculation formula for predicting the resource requirements of each application in the system to obtain a prediction result is:
[0051] Ra(t) = Au(t) × Pa × baseline resource requirement;
[0052] Among them, Ra(t) represents the predicted result of the resource requirement of application a within the time period t, and the baseline resource requirement is determined according to the historical average resource usage of the application.
[0053] In a possible implementation, the calculation formula for comprehensively calculating the predicted resource requirements includes:
[0054]
[0055] Among them, the R 总 represents the predicted resource requirement within the time period t.
[0056] Step 150: Set the upper and lower threshold values for system resource usage according to the predicted resource requirements, and dynamically adjust the resource allocation strategy according to the upper and lower threshold values.
[0057] In a possible implementation, when the predicted resource requirements exceed 80% of the total system resources, prioritize ensuring the resource allocation for high-priority applications. When the predicted resource requirements are lower than 50% of the total system resources, release some resources for other tasks to use.
[0058] Step 170: Dynamically allocate resources to the system according to the resource allocation strategy, and monitor the resource allocation effect of the system in real time.
[0059] In a possible implementation, monitor the resource allocation effect in real time to obtain operation data, and perform data analysis on the operation data and predict to optimize the resource prediction and allocation strategy of the system.
[0060] Through the above process, in the embodiments of the present invention, by first comprehensively collecting user behavior data, including information such as usage habits, preferences, and application activity levels, a solid foundation is provided for subsequent analysis. Then, by applying advanced data analysis and prediction technologies, deeply mining the user behavior patterns, predicting the future resource demand trends and changes in application priorities, not only considering the user's historical behavior but also integrating real-time data to ensure the accuracy and timeliness of the prediction results. Based on the prediction results, intelligently formulate a resource allocation strategy to ensure the reasonable configuration and efficient utilization of resources. In this process, the system dynamically adjusts the resource allocation according to the priority of the application, resource requirements, and the current system state to meet the needs of different applications. Finally, by continuously monitoring the resource usage effect, collecting and processing feedback information, it provides strong support for the continuous optimization and upgrade of the system, ensuring that the system can continuously adapt to the changing environment and requirements, maintain a high-efficiency and stable operating state. Through intelligent prediction and management methods, it realizes the accurate grasp and efficient utilization of user behavior, application requirements, and system resources, provides strong guarantee for improving the overall performance of the system and user experience, realizes the accurate prediction and efficient management of user behavior, application requirements, and system resources, and thus can effectively solve the problems in the prior art that lack comprehensive consideration of user behavior and application program priorities, resulting in low resource utilization rate or insufficient performance of key tasks.
[0061] In an exemplary embodiment, the present invention provides a method for dynamically allocating system resources to perform dynamic allocation of system resources.
[0062] As Figure 2 shown, it may specifically include the following steps:
[0063] Step S01: Start.
[0064] Specifically, when the system starts, the data collection module starts to run.
[0065] Step S02, data collection phase.
[0066] Specifically, the system, through the data collection module, monitors and records the user's operation data in real time, including but not limited to user activity (such as the number of mouse clicks, keyboard input frequency, etc.) and the usage of application programs (such as startup frequency, usage duration, etc.). The user can adjust the priority of each application program through the system settings interface. The default priority is preset by the administrator. The collected user behavior data provides a basis for subsequent analysis.
[0067] Step S03, data analysis and prediction phase.
[0068] Specifically, after sufficient data is collected, the system enters the data analysis and prediction phase. Using advanced algorithms and models, it deeply mines and analyzes the user behavior data, calculates the user activity score and the application program priority score, and predicts the future resource requirements based on these scores, and outputs the user activity score, the application program priority score, and the resource requirement prediction result.
[0069] Specifically, within each time period t, based on the user activity score formula "Au(t) = (mouse clicks(t) + keyboard input(t)) / t duration", calculate the user's activity score within the time period t, and calculate the application program priority score Pa of each application program by weighted summation of the user priority and the system default priority.
[0070] As Figure 3 shown, the leftmost side includes the user activity score Au(t), the application program priority score Pa, and the baseline resource requirements. Among them, the user activity score Au(t) is calculated based on the number of mouse clicks and the number of keyboard inputs; the application program priority score Pa is calculated by combining the priority set by the user and the system default priority.
[0071] Furthermore, combining the user activity score Au(t), the application program priority score Pa, and the baseline resource requirements, calculate the resource requirement prediction Ra(t) for each application program within a future time period through the calculation formula "Ra(t) = Au(t) × Pa × baseline resource requirements".
[0072] Furthermore, accumulate the resource requirements of all application programs to calculate the comprehensive resource requirements, and obtain the resource requirement prediction for the overall system.
[0073] Step S04, resource allocation decision-making phase.
[0074] Specifically, according to the results of the data analysis and prediction phase, the system enters the resource allocation decision-making phase. In this phase, a specific resource allocation plan is formulated mainly based on the current system load status, the results of resource demand prediction, and the preset resource allocation strategy, and key decisions are obtained: whether resource adjustment is needed, how to adjust (such as increasing CPU allocation, memory allocation, etc.), the adjustment range, etc., and the resource allocation decision result, that is, the specific resource allocation plan, is output.
[0075] Specifically, the threshold judgment sub-module compares the ratio of the resource demand prediction result to the total system resources to determine the current load status (peak period or off-peak period). According to the judgment result, the resource allocation strategy adjustment sub-module formulates the corresponding resource allocation strategy.
[0076] Step S05, the resource management execution phase.
[0077] Specifically, after the resource allocation plan is formulated in the resource allocation decision-making phase, the system enters the resource management execution phase. This phase is mainly responsible for dynamically adjusting the allocation of system resources according to the decision result to ensure that each application can obtain the required resources, and adjusting system resources such as CPU allocation and memory allocation.
[0078] Specifically,
[0079] The dynamic resource allocation sub-module adjusts the allocation of system resources according to the formulated strategy, such as adjusting the CPU core number allocation, memory allocation, disk I / O priority, etc.
[0080] Step S06, the continuous monitoring and optimization phase.
[0081] Specifically, during the process of executing resource allocation, the system will monitor the resource allocation effect in real time and make necessary adjustments and optimizations according to the actual situation. At the same time, user feedback and system performance data are collected to provide reference for subsequent resource allocation decisions.
[0082] Through the above process, the embodiment of the present invention starts from system startup and data collection, monitors and records user activity and application usage in real time. Subsequently, advanced algorithms are used to deeply analyze the data, predict future resource requirements, and formulate a resource allocation plan accordingly. After the plan is determined, the system dynamically adjusts the allocation of resources such as CPU and memory to ensure the needs of applications. During the execution process, the system continuously monitors the resource allocation effect, collects feedback and performance data, and continuously optimizes the allocation strategy. Through real-time monitoring and prediction, accurate allocation of resources is achieved, improving the utilization rate of system resources; the dynamic adjustment mechanism ensures the stability of application performance and enhances the user experience; the continuous monitoring and optimization strategy enables the system to flexibly respond to changes and maintain long-term efficient and stable operation. The whole process realizes the intelligence and automation of resource allocation, providing strong support for the efficient management of computer systems.
[0083] In an exemplary embodiment, the present invention provides a system architecture for a system resource dynamic allocation method to perform system resource dynamic allocation.
[0084] As Figure 4 shown, it mainly includes the following key modules: Data collection module: responsible for real-time monitoring and recording of user operation data, such as the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of application programs, etc.; Data analysis and prediction module: using the collected data, calculate the user activity score, application program priority score, and predict future resource requirements; Resource allocation decision module: based on the prediction results, judge the current system load status and formulate corresponding resource allocation strategies; Resource management execution module: dynamically adjust the allocation of system resources according to the strategies of the decision module.
[0085] Further, the data collection module includes a user behavior monitoring sub-module and an application priority management sub-module, which are respectively responsible for real-time monitoring of user operations (such as mouse clicks, keyboard inputs) and managing application program priority settings.
[0086] Further, the data analysis and prediction module includes four sub-modules: Activity score calculation sub-module: calculate the user activity based on the number of mouse clicks and keyboard inputs; Priority score calculation sub-module: calculate the application priority score by weighted summation of user priority and system default priority; Resource demand prediction sub-module: combine the user activity score Au(t), application program priority score Pa and baseline resource requirements to generate the predicted resource demand Ra(t) for each application; Comprehensive resource demand calculation sub-module: accumulate all Ra(t) to obtain the total system resource demand R total(t).
[0087] Further, the resource allocation decision module includes a threshold judgment sub-module and a resource allocation strategy adjustment sub-module, and formulates dynamic strategies according to the ratio of R total(t) to the total system resources (such as peak period threshold 80%, off-peak period threshold 50%). Peak period strategy: when R total(t)>0.8×total system resources, give priority to ensuring resource allocation for high-priority applications and restrict resource usage of low-priority applications; Off-peak period strategy: when R total(t)<0.5×total system resources, release some resources for other tasks to use and improve resource utilization rate.
[0088] Further, the resource management execution module dynamically allocates system resources such as CPU, memory, disk I / O, etc. according to the strategy adjustment of the resource allocation decision module, and the feedback monitoring sub-module monitors the resource allocation effect in real time and uses the feedback information to adjust the prediction model and resource allocation strategy.
[0089] Through the above process, the embodiments of the present invention achieve dynamic allocation of system resources through data collection, analysis and prediction, decision-making and execution. The data collection module monitors user behavior and application usage in real time. The analysis and prediction module calculates user activity and application priorities to predict resource requirements. The decision-making module formulates strategies based on the prediction results and the system load status, and the execution module dynamically adjusts resource allocation accordingly. The feedback monitoring sub-module evaluates the effect in real time and optimizes the strategy. This process improves resource utilization, ensures that high-priority applications receive sufficient resources, releases resources during off-peak periods for other tasks to use, and enhances the system response speed and user experience.
[0090] In one embodiment, a large enterprise has multiple Linux servers to support internal applications and external customer services. As the number of users and application complexity increase, the traditional static resource allocation method causes the performance of some key applications to decline under high load, affecting the user experience.
[0091] Specifically, first deploy the data collection module to monitor the usage of each application by employees in real time, including the mail system, database, development tools, etc. Employees can adjust the priorities of each application through the system settings interface, such as setting the database management tool to a high priority.
[0092] Furthermore, the system calculates the user activity score Au(t) for each time period based on the collected data, calculates Pa according to user settings and system default priorities, predicts the resource requirements Ra(t) of each application, accumulates all Ra(t) to obtain R total(t), and compares it with the total server resources.
[0093] Furthermore, during the peak working period (such as from 9 am to 11 am), R total(t) often exceeds 80% of the total system resources. The system gives priority to ensuring resource allocation for high-priority applications (such as databases) and restricts the resource usage of low-priority applications (such as development tools). During off-peak periods, R total(t) is lower than 50% of the total system resources, and the system releases some resources for other tasks to use, such as backup and maintenance tasks.
[0094] Furthermore, dynamically allocate CPU and memory resources, adjust the priorities and resource limits of application programs, and monitor the resource allocation effect in real time to ensure the stable performance of key applications.
[0095] In the above process, by applying the dynamic resource allocation method provided by the present invention, enterprise servers can give priority to ensuring the performance of key applications under high load, improving the overall system stability and response speed, and significantly improving the user experience.
[0096] In one embodiment, a cloud computing service provider operates multiple virtual machine instances to support a multi-tenant environment. With the fluctuations in the number of tenants and resource requirements, traditional resource allocation methods are difficult to effectively cope with dynamic changes, resulting in resource waste or insufficient performance for some tenants.
[0097] Specifically, first, a data collection module is deployed to monitor the resource usage of each virtual machine, including CPU, memory, disk I / O, etc., and collect the usage behavior data of tenants, such as the virtual machine startup frequency, running duration, and the priorities set by tenants.
[0098] Furthermore, calculate the activity score Au(t) of each tenant in different time periods, calculate Pa according to the priorities set by tenants and the system default priorities, and predict the resource requirements Ra(t) of each virtual machine.
[0099] Furthermore, accumulate all Ra(t) to obtain R total(t), compare it with the total physical server resources, judge the load status, during the peak period of resource requirements, give priority to ensuring the resource allocation for high-priority tenants, dynamically adjust the resource usage of low-priority tenants, and during the off-peak period of resource requirements, release some resources for other tenants or maintenance tasks to improve resource utilization.
[0100] Furthermore, dynamically adjust the resource allocation of virtual machines, such as increasing the number of CPU cores of high-priority virtual machines and reducing the memory allocation of low-priority virtual machines, monitor the resource allocation effect in real time, and optimize the resource allocation strategy according to the feedback information.
[0101] In the above process, by applying the dynamic resource allocation method provided by the present invention, the cloud computing platform can manage resources more flexibly and efficiently, improve resource utilization, ensure the service quality of high-priority tenants, reduce resource waste, and improve operation efficiency.
[0102] The following is an embodiment of the device of the present invention, which can be used to execute a method for dynamically allocating system resources involved in the present invention. For the details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the method for dynamically allocating system resources involved in the present invention.
[0103] Please refer to Figure 5 In the embodiment of the present invention, a system resource dynamic allocation device 800 is provided.
[0104] The device 800 includes but is not limited to: a data collection module 810, a data analysis and prediction module 830, a resource allocation decision module 850, and a resource management execution module 870.
[0105] Among them, the data collection module 810 is used to monitor and record the user behavior in the system; the user behavior includes the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of application programs.
[0106] The data analysis and prediction module 830 is used to calculate the user activity score and the application priority score according to the user behavior, predict the resource requirements of each application in the system to obtain a prediction result, and comprehensively calculate the predicted resource requirements.
[0107] The resource allocation decision module 850 is used to set the upper and lower threshold values of the system resource usage according to the predicted resource requirements, and dynamically adjust the resource allocation strategy according to the upper and lower threshold values.
[0108] The resource management execution module 870 is used to dynamically allocate resources to the system according to the resource allocation strategy, and monitor the resource allocation effect of the system in real time.
[0109] It should be noted that when the above-mentioned embodiment provides the dynamic allocation of system resources, only the above-mentioned division of each functional module is used for illustration. In actual applications, the above-mentioned functions can be allocated by different functional modules according to needs, that is, the internal structure of the dynamic system resource allocation device will be divided into different functional modules to complete all or part of the functions described above.
[0110] In addition, the dynamic system resource allocation device provided by the above-mentioned embodiment and the embodiment of a dynamic system resource allocation method belong to the same concept. The specific ways in which each module performs operations have been described in detail in the method embodiment, and will not be repeated here.
[0111] Figure 6 The structural schematic diagram of an electronic device shown according to an exemplary embodiment.
[0112] It should be noted that this electronic device is only an example adapted to the present invention, and cannot be considered as providing any limitation to the scope of use of the present invention. This electronic device cannot also be interpreted as requiring dependence on or necessarily having Figure 6 one or more components shown in the exemplary electronic device 2000.
[0113] The hardware structure of the electronic device 2000 may vary greatly due to different configurations or performances. For example, Figure 6 as shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.
[0114] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000.
[0115] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted to the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, at least one USB interface 237, etc., as Figure 6 shown, and specific limitations are not constituted herein.
[0116] The memory 250, as a carrier for resource storage, may be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc. The resources stored thereon include an operating system 251, application programs 253, data 255, etc., and the storage method may be transient storage or permanent storage.
[0117] Among them, the operating system 251 is used to manage and control each hardware device and application program 253 on the electronic device 2000 to enable the central processing unit 270 to perform operations and processing on the massive data 255 in the memory 250. It may be Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSD TM, etc.
[0118] The application program 253 is a computer-readable instruction that completes at least one specific task based on the operating system 251. It may include at least one module ( Figure 6 not shown), and each module may separately contain computer-readable instructions for the electronic device 2000. For example, the system resource dynamic allocation device can be regarded as an application program 253 deployed on the electronic device 2000.
[0119] The data 255 may be signal information, etc., and is stored in the memory 250.
[0120] The central processing unit 270 may include one or more than one processors and is configured to communicate with the memory 250 through at least one communication bus to read the computer-readable instructions stored in the memory 250, and then perform operations and processing on the massive data 255 in the memory 250. For example, a system resource dynamic allocation method is completed in the form of reading a series of computer-readable instructions stored in the memory 250 by the central processing unit 270.
[0121] In addition, the present invention can also be implemented by hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of the present invention is not limited to any specific hardware circuit, software, and the combination of both.
[0122] Please refer to Figure 7 , in the embodiments of the present invention, an electronic device 4000 is provided. The electronic device 400 may include: a desktop computer, a notebook computer, a server, etc. with sensor recognition capabilities.
[0123] In Figure 7 this, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.
[0124] Among them, the data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 7 it is only represented by a thick line in the figure, but it does not mean that there is only one bus or one type of bus.
[0125] Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 can be used for data interaction between the electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiments of the present invention.
[0126] The processor 4001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of the present invention. The processor 4001 can also be a combination for implementing computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0127] The memory 4003 can be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and instructions. It can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store desired program instructions or code in the form of instructions or data structures and can be accessed by the electronic device 400, but is not limited thereto.
[0128] Computer-readable instructions are stored on the memory 4003, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002.
[0129] The computer-readable instructions are executed by one or more processors 4001 to implement a system resource dynamic allocation method in each of the above embodiments.
[0130] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored, and the computer-readable instructions are executed by one or more processors to implement a system resource dynamic allocation method as described above.
[0131] An embodiment of the present invention provides a computer program product. The computer program product includes computer-readable instructions. The computer-readable instructions are stored in a storage medium, and one or more processors of the electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements a system resource dynamic allocation method as described above.
[0132] Compared with the related art, the beneficial effects of the present invention are:
[0133] 1. The present invention first comprehensively collects user behavior data, including information such as usage habits, preferences, and application activity, providing a solid foundation for subsequent analysis. Then, by applying advanced data analysis and prediction techniques, it deeply mines user behavior patterns, predicts future resource demand trends and changes in application priorities, taking into account not only the user's historical behavior but also incorporating real-time data to ensure the accuracy and timeliness of the prediction results. Based on the prediction results, it intelligently formulates resource allocation strategies to ensure the rational configuration and efficient utilization of resources. During this process, the system dynamically adjusts resource allocation according to the application priority, resource demand, and current system status to meet the needs of different applications. Finally, by continuously monitoring the resource usage effect, collecting and processing feedback information, it provides strong support for the continuous optimization and upgrade of the system, ensuring that the system can continuously adapt to the changing environment and requirements and maintain an efficient and stable operating state. Through intelligent prediction and management methods, it realizes the accurate grasp and efficient utilization of user behavior, application requirements, and system resources, providing a strong guarantee for improving the overall system performance and user experience, and achieving the accurate prediction and efficient management of user behavior, application requirements, and system resources, thus effectively solving the problem in the prior art that the lack of comprehensive consideration of user behavior and application program priorities leads to low resource utilization or insufficient performance of critical tasks.
[0134] 2. The present invention can conduct multi-factor comprehensive prediction: The present invention not only considers user behavior (such as activity) and application program priority but also combines system resource utilization rate, achieving a more accurate and multi-dimensional prediction of resource demand and enhancing the intelligent level of resource allocation.
[0135] 3. The present invention has a dynamic adjustment mechanism: By setting resource usage thresholds for peak and off-peak periods, the system can flexibly adjust resource allocation strategies under different load conditions, ensuring the performance of critical tasks while improving the overall resource utilization rate.
[0136] 4. The present invention has wide applicability: The present invention is applicable to various Linux system environments, including multiple scenarios such as server management, cloud computing platforms, and data centers, and has a broader application prospect.
[0137] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this document, there is no strict order restriction for the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same moment, but can be executed at different moments, and their execution order is not necessarily sequential, but can be executed alternately or in turns with at least a part of other steps or sub-steps or stages of other steps.
[0138] The above are only some embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for dynamically allocating system resources, characterized in that, The method includes: Monitoring and recording user behaviors in the system; the user behaviors include the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of application programs; Calculating a user activity score and an application program priority score according to the user behaviors, predicting the resource requirements of each application program in the system to obtain a prediction result, and comprehensively calculating the predicted resource requirements; Setting upper and lower threshold values for the system resource usage according to the predicted resource requirements, and dynamically adjusting the resource allocation strategy according to the upper and lower threshold values; Dynamically allocating resources to the system according to the resource allocation strategy, and real-time monitoring the resource allocation effect of the system.
2. The system resource dynamic allocation method according to claim 1, characterized in that, The calculation formula for calculating the user activity score according to the user behaviors includes: Au(t) = (M(t) + K(t)) / T; Wherein, the Au(t) represents the user activity score within the time period t, the M(t) represents the number of mouse clicks within the time period t, the K(t) represents the number of keyboard inputs within the time period t, and the T represents the total duration of the time period t.
3. A method for dynamically allocating system resources according to claim 1, characterized in that, The calculation formula for calculating the application program priority score according to the user behaviors includes: Pa = α × Pu + β × Ps; Wherein, the Pa represents the application program priority score, α and β respectively represent the weight coefficients of the user priority and the system default priority, and Pu and Ps respectively represent the user priority and the system default priority.
4. A method for dynamically allocating system resources according to claim 1, characterized in that, The calculation formula for predicting the resource requirements of each application program in the system to obtain a prediction result includes: Ra(t) = Au(t) × Pa × baseline resource requirement; Wherein, the Ra(t) represents the predicted result of the resource requirement of the application program a within the time period t, and the baseline resource requirement is determined according to the historical average resource usage of the application program.
5. A method for dynamically allocating system resources according to claim 1, characterized in that The calculation formula for comprehensively calculating the predicted resource requirements includes: Among them, the R 总 represents the predicted resource demand within the time period t.
6. A method for dynamically allocating system resources according to claim 1, characterized in that, Setting the upper and lower threshold values for the system resource usage according to the predicted resource requirements, and dynamically adjusting the resource allocation strategy according to the upper and lower threshold values, including: When the predicted resource requirements exceed 80% of the total system resources, giving priority to ensuring the resource allocation of high-priority applications; When the predicted resource requirements are lower than 50% of the total system resources, releasing some resources for other tasks to use.
7. A method for dynamically allocating system resources according to claim 1, characterized in that, The real-time monitoring of the resource allocation effect of the system includes: Real-time monitoring the resource allocation effect to obtain operation data, and performing data analysis and prediction on the operation data to optimize the resource prediction and allocation strategy of the system.
8. A system resource dynamic allocation device, characterized in that, The device includes: A data collection module for monitoring and recording user behaviors in the system; the user behaviors include the number of mouse clicks, the number of keyboard inputs, the startup frequency and usage duration of application programs; A data analysis and prediction module for calculating a user activity score and an application program priority score according to the user behaviors, predicting the resource requirements of each application program in the system to obtain a prediction result, and comprehensively calculating the predicted resource requirements; A resource allocation decision module for setting upper and lower threshold values for the system resource usage according to the predicted resource requirements, and dynamically adjusting the resource allocation strategy according to the upper and lower threshold values; A resource management execution module, which is used to dynamically allocate resources to the system according to the resource allocation policy and monitor the resource allocation effect of the system in real time.
9. An electronic device, characterized in that, It includes: At least one processor and at least one memory, wherein, Computer-readable instructions are stored on the memory; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements a system resource dynamic allocation method as described in any one of claims 1 to 7.
10. A storage medium having computer-readable instructions stored thereon, characterized in that, The computer-readable instructions are executed by one or more processors to implement a system resource dynamic allocation method as described in any one of claims 1 to 7.