A method and apparatus for dynamically allocating server computing resources

By dynamically allocating server computing resources, adjusting according to the number and weight of the client's historical task requests, the resource mismatch problem caused by static allocation is solved, and efficient utilization and reasonable allocation of resources are achieved.

CN117311986BActive Publication Date: 2025-08-01SHENZHEN BEILIANDE IND CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311501864.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-11
Publication Date
2025-08-01
Estimated Expiration
2043-11-11

AI Technical Summary

Technical Problem

In the prior art, when the server connects multiple clients, the computing resource allocation adopts a static method, resulting in mismatch of computing resources, idle or excessive occupation, and low resource utilization efficiency.

Method used

By obtaining the number of historical task requests of the client for each preset time period, dynamically allocating computing resources, combining weight adjustment and reserve resource management, flexible allocation of resources is achieved.

Benefits of technology

Improve the efficiency of computing resources utilization, avoid idle or excessive use of resources, and ensure that each client obtains reasonable computing resource support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117311986B_ABST
    Figure CN117311986B_ABST
Patent Text Reader

Abstract

A method and device for dynamically allocating server computing resources, which relate to the field of data processing. In this method, every preset time period, the first historical task request quantity of the first client is obtained, and the first historical task request quantity is the number of task requests sent by the first client to the server within the preset time period; according to the first historical task request quantity, the first computing resources corresponding to the first historical task request quantity are allocated to the first client. Implementing the technical solution provided by this application solves the problem that the computing resources required for client task processing do not match the computing resources pre-allocated to the client.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and particularly to a method and device for dynamically allocating computing resources of a server. Background Art

[0002] A server is a special computer device. Compared with an ordinary personal computer, a server has a higher running speed and stronger load capacity. The server is mainly used to provide computing and application services for other devices (such as personal computers, smart phones, ATMs, etc.) in a network. The role of the server is similar to a central node, capable of processing a large number of requests and providing corresponding services.

[0003] Currently, when a server needs to connect to multiple clients for resource allocation, the traditional method adopts a static allocation method, that is, computing resources are pre-allocated to the clients without considering the actual computing resource requirements. For example: for the task processing request sent by client A to the server, the required computing resource a exceeds the pre-allocated computing resource; for the task processing request sent by client B to the server, the required computing resource b is much less than the pre-allocated computing resource. At this time, the server cannot process the task of client A in time, and the computing resources allocated to client B are still idle.

[0004] As can be seen from the above, during the process of server task processing, there will be a problem that the computing resources required for client task processing do not match the computing resources pre-allocated to the client.

[0005] Therefore, there is an urgent need for a method and device for dynamically allocating server computing resources that can solve the above technical problems. Summary of the Invention

[0006] This application provides a method and device for dynamically allocating server computing resources, which solves the problem that the computing resources required for client task processing do not match the computing resources pre-allocated to the client, avoids the situation of idle or over-occupied computing resources, and improves the resource utilization efficiency.

[0007] In the first aspect of this application, a method for dynamically allocating server computing resources is provided. The method includes: obtaining the first historical task request quantity of the first client at every preset time interval, where the first historical task request quantity is the number of task requests sent by the first client to the server within the preset time interval; and allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the first historical task request quantity.

[0008] By adopting the above technical solution, by dynamically allocating computing resources according to the historical task request quantity of the first client at each preset time interval, the computing resources of the server can be better utilized, avoiding the situation of idle or over-occupied computing resources, and improving the resource utilization efficiency.

[0009] Optionally, after obtaining the first historical task request quantity of the first client, the method further includes: obtaining the second historical task request quantity of the second client, where the second historical task request quantity is the number of task requests sent by the second client to the server within the preset time interval; after allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the first historical task request quantity, the method further includes: allocating the second computing resource corresponding to the second historical task request quantity to the second client according to the second historical task request quantity.

[0010] By adopting the above technical solution, in addition to allocating computing resources according to the historical task request quantity of the first client, computing resources are also allocated according to the historical task request quantity of the second client, which can better balance multiple clients, ensure that each client can obtain corresponding computing resources, and comprehensively consider the historical task request quantities of multiple clients.

[0011] Optionally, allocating the first computing resource corresponding to the first historical task request quantity to the first client; specifically including: determining the computing resource allocation weight of the first client according to the first historical task request quantity and the preset weight allocation method; allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client.

[0012] By adopting the above technical solution, determining the computing resource allocation weight of the client according to the historical task request quantity and the preset weight allocation method can better manage the computing resource allocation ratio of different clients and avoid the situation of over-concentration or dispersion of resources.

[0013] Optionally, the computing resources of the server include computing resources to be allocated; allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client specifically includes: allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client and the computing resources to be allocated.

[0014] By adopting the above technical solution, the computing resources to be allocated are allocated according to the computing resource allocation weight of the first client.

[0015] Optionally, the computing resources of the server include reserved computing resources; after allocating the first computing resources corresponding to the number of first historical task requests to the first client according to the weight of the computing resources of the first client, the method further includes: monitoring the resource utilization rate of the first computing resources; when the resource utilization rate is greater than the preset resource utilization rate, allocating reserved computing resources to the first client.

[0016] By adopting the above technical solution, when it is monitored that the resource utilization rate of the first computing resources is greater than the preset resource utilization rate, reserved computing resources are timely allocated to the first client, ensuring that the first client always has sufficient computing resources for support.

[0017] Optionally, the reserved computing resources include multiple reserved computing resource sub-units; when the resource utilization rate is greater than the preset resource utilization rate, one or more reserved computing resource sub-units are allocated to the first client; wherein, the computing resource rate after the first client is allocated one or more reserved computing resource sub-units is less than or equal to the preset resource utilization rate.

[0018] By adopting the above technical solution, the introduction of reserved computing resource sub-units enables more precise allocation of computing resources. When the resource utilization rate is greater than the preset resource utilization rate, the resource allocation strategy can be adjusted more flexibly.

[0019] Optionally, the formula for the preset weight allocation method is A = α * e^(-γ * a), where A is the weight value, a is the number of first historical task requests of the first client, e is the base of the natural logarithm, γ is the attenuation coefficient, and α is the preset base weight.

[0020] By adopting the above technical solution, the weight value is adjusted according to the number of historical task requests of the first client. When the number of task requests of the first client is small, the weight value will decay according to the exponential function, thereby reducing its weight and making its proportion in resource allocation relatively low. When the number of task requests of the first client is large, the weight value will be high, making its proportion in resource allocation relatively high. According to the number of historical task requests of the first client, the weight value can be dynamically adjusted to adapt to the changing needs of different clients. This can achieve reasonable allocation of resources and avoid over-concentration of resources on certain clients. By introducing the attenuation coefficient, the weight value can be adjusted smoothly, avoiding system oscillations and instabilities caused by sudden changes in the number of task requests.

[0021] The second aspect of the present application provides a dynamic allocation device for server computing resources. The device is a server, and the server includes: an acquisition module and an allocation module. The acquisition module is configured to acquire the first historical task request quantity of the first client every preset time period. The first historical task request quantity is the number of task requests sent by the first client to the server within the preset time period. The allocation module is configured to allocate the first computing resources corresponding to the first historical task request quantity to the first client according to the first historical task request quantity.

[0022] Optionally, after the acquisition module acquires the first historical task request quantity of the first client, the method further includes: the acquisition module acquires the second historical task request quantity of the second client. The second historical task request quantity is the number of task requests sent by the second client to the server within the preset time period. After the allocation module allocates the first computing resources corresponding to the first historical task request quantity to the first client according to the first historical task request quantity, the method further includes: the allocation module allocates the second computing resources corresponding to the second historical task request quantity to the second client according to the second historical task request quantity.

[0023] Optionally, according to the first historical task request quantity, the allocation module allocates the first computing resources corresponding to the first historical task request quantity to the first client; specifically including: determining the computing resource allocation weight of the first client according to the first historical task request quantity, the second historical task request quantity, and the first preset weight allocation method; and allocating the first computing resources corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client.

[0024] Optionally, the computing resources of the server include computing resources to be allocated; according to the computing resource allocation weight of the first client, the allocation module allocates the first computing resources corresponding to the first historical task request quantity to the first client, specifically including: the allocation module allocates the first computing resources corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client and the computing resources to be allocated.

[0025] Optionally, the computing resources of the server include reserved computing resources; after the allocation module allocates the first computing resources corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client, the method further includes: monitoring the resource utilization rate of the first computing resources; when the resource utilization rate is greater than the preset resource utilization rate, the allocation module allocates reserved computing resources to the first client.

[0026] Optionally, the reserved computing resources include multiple reserved computing resource sub-units; when the resource utilization rate is greater than the preset resource utilization rate, the allocation module allocates one or more reserved computing resource sub-units to the first client; wherein, the computing resource rate after the first client is allocated one or more reserved computing resource sub-units is less than or equal to the preset resource utilization rate.

[0027] Optionally, the formula for the preset weight allocation method is A = α * e^(-γ * a), where A is the weight value, a is the number of first historical task requests of the first client, e is the base of the natural logarithm, γ is the decay coefficient, and α is the preset base weight.

[0028] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method of any one of the above.

[0029] In the fourth aspect of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions. When the instructions are executed, the method steps shown above are executed.

[0030] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0031] 1. Dynamically allocate computing resources according to the number of historical task requests of the client, which can better utilize the computing resources of the server, avoid the situation of idle or over-occupied computing resources, and improve the resource utilization efficiency.

[0032] 2. When it is monitored that the resource utilization rate of the first computing resource is greater than the preset resource utilization rate, reserve computing resources are timely allocated to the first client to ensure that the first client always has sufficient computing resources to support.

[0033] 3. According to the number of historical task requests of the first client, the weight value can be dynamically adjusted to adapt to the changing needs of different clients. This can achieve reasonable allocation of resources and avoid over-concentration of resources on certain clients. Description of the Drawings

[0034] Figure 1 It is a flowchart of a method for dynamically allocating server computing resources provided by an embodiment of the present application.

[0035] Figure 2 It is a module diagram of a device for dynamically allocating server computing resources provided by an embodiment of the present application.

[0036] Figure 3 This is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

[0037] Explanation of reference numerals in the drawings: 201, acquisition module; 202, allocation module; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. Detailed implementation manners

[0038] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.

[0039] In the description of the embodiments of the present application, words such as "for example" or "for instance" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "for example" or "for instance" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "for example" or "for instance" aims to present relevant concepts in a specific manner.

[0040] In the description of the embodiments of the present application, the meaning of the term "a plurality of" refers to two or more. For example, a plurality of systems refers to two or more systems, and a plurality of screen terminals refers to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0041] A server is a special computer device dedicated to providing computing and application services. Compared with ordinary personal computers, servers have higher operating speeds and stronger load capabilities. It plays a central node role in the network, capable of processing a large number of requests and providing corresponding services. Traditional server resource allocation methods use static allocation, that is, computing resources are pre-allocated to clients without considering the actual computing resource requirements. For example, the task processing request sent by client A to the server requires more computing resources than the pre-allocated computing resources, while the computing resource requirements of client B are much less than the pre-allocated computing resources. This will result in the server being unable to process the tasks of client A in a timely manner, and at the same time, the computing resources of client B are idle. Therefore, during the server task processing, the mismatch between the computing resources required by the client and the pre-allocated computing resources is a problem. This problem needs to be solved by adopting a more flexible resource allocation method to dynamically allocate computing resources according to actual needs. This application provides a dynamic allocation method and device for server computing resources, which can be referred to Figure 1 , Figure 1 is a schematic flowchart of a dynamic allocation method for server computing resources disclosed in an embodiment of this application. This method is applied to a server and includes steps S101 to S102. The above steps are as follows:

[0042] Step S101: Every preset time period, obtain the first historical task request quantity of the first client. The first historical task request quantity is the number of task requests sent by the first client to the server within the preset time period.

[0043] In the above step, first define the length of the preset time period, which can be set to 5 minutes, 10 minutes or other time intervals, and the length of the time period can be set according to specific scenario requirements. At the end of the preset time period, obtain the historical task request quantity of the client within the preset time period by checking the log. The historical task request quantity is the total number of task requests sent by the client to the server within the preset time period. At the same time, the method of setting a timed task can be used to write a script for collecting the task request quantity of the client within the preset time period. In the timed task, set the execution time and the command to execute the script, and at the same time set the path of the output log file to facilitate recording the collected task request data.

[0044] Step S102: According to the first historical task request quantity, allocate the first computing resources corresponding to the first historical task request quantity to the first client.

[0045] In the above steps, according to the number of first historical task requests, the resource manager allocates computing resources corresponding to the number of first historical task requests to the first client. First, the server needs to define the computing resources available for allocation, calculate the weight of the first client corresponding to the number of first historical task requests through the number of first historical task requests. The weight can be calculated based on the exponential decay function. The specific weight calculation formula will be described in the subsequent embodiments. According to this weight, the corresponding computing resources are allocated to the first client. The resource manager can be used to allocate computing resources to the first client. After successfully allocating computing resources to the first client, the server needs to update the status of the computing resources and mark it as the updated status for subsequent resource management and scheduling. The method for allocating to other clients is the same.

[0046] In a possible implementation manner, after obtaining the number of first historical task requests of the first client, the method further includes: obtaining the number of second historical task requests of the second client, where the number of second historical task requests is the number of task requests sent by the second client to the server within a preset time period; after allocating the first computing resources corresponding to the number of first historical task requests to the first client according to the number of first historical task requests, the method further includes: allocating the second computing resources corresponding to the number of second historical task requests to the second client according to the number of second historical task requests.

[0047] Specifically, the server will connect to multiple clients and needs to respond to the allocation of computing resources for the requests of multiple clients. The method for allocating computing resources to the second client is the same as that for the first client.

[0048] In a possible implementation manner, according to the number of first historical task requests, allocate the first computing resources corresponding to the number of first historical task requests to the first client; specifically including: determining the computing resource allocation weight of the first client according to the number of first historical task requests and the preset weight allocation method; allocating the first computing resources corresponding to the number of first historical task requests to the first client according to the computing resource allocation weight of the first client.

[0049] Specifically, according to the number of first historical task requests and the preset weight allocation method, the exponential decay formula can be used to calculate the computing resource allocation weight of the first client. Then, the weighted round-robin algorithm is adopted to allocate computing resources to the clients one by one according to the weight. The principle of the weighted round-robin algorithm is to sort the computing resources according to the weight and then allocate them to the clients in turn. When allocating, according to the computing resource allocation weight of the client, when the last computing resource is allocated, start cycling from the first one again.

[0050] In a possible implementation, the computing resources of the server include computing resources to be allocated; according to the computing resource allocation weight of the first client, allocate the first computing resources corresponding to the number of first historical task requests to the first client, specifically including: allocate the first computing resources corresponding to the number of first historical task requests to the first client according to the computing resource allocation weight of the first client and the computing resources to be allocated.

[0051] Specifically, the computing resources of the server will be divided into computing resources to be allocated and reserved computing resources. Before allocating computing resources, reserve a part of the computing resources as reserve resources according to the reservation rules, and set the identifier of whether it can be allocated to no. In this way, the reserve resources will not be allocated to any requests, but are reserved in the system as backup resources.

[0052] In a possible implementation, the computing resources of the server include reserved computing resources; after allocating the first computing resources corresponding to the number of first historical task requests to the first client according to the computing resource allocation weight of the first client, the method further includes: monitoring the resource utilization rate of the first computing resources; when the resource utilization rate is greater than the preset resource utilization rate, allocate reserved computing resources to the first client.

[0053] Specifically, in order to monitor the resource utilization rate of computing resources in real time, a monitoring program can be run on the server to regularly collect the usage of computing resources. The collected data includes CPU utilization rate, memory utilization rate, etc. According to the preset resource utilization rate threshold, the collected resource utilization rate data can be judged. If the resource utilization rate is greater than the preset resource utilization rate, it means that the computing resources are close to the load limit. At this time, reserved computing resources need to be allocated to the first client. At this time, the identifier of whether the reserve resources can be allocated needs to be set to yes, indicating that part of the reserve resources can be allocated to the first client. The same applies to other clients.

[0054] In a possible implementation, the reserved computing resources include multiple reserved computing resource sub-units; when the resource utilization rate is greater than the preset resource utilization rate, allocate one or more reserved computing resource sub-units to the first client; wherein, the computing resource rate after the first client is allocated one or more reserved computing resource sub-units is less than or equal to the preset resource utilization rate.

[0055] Specifically, the reserved computing resources of the server are divided into multiple sub-units, and each sub-unit has the same amount of computing resources. When it is detected that the computing resource utilization rate of the first client is greater than the preset computing resource utilization rate, one or more reserved computing resource sub-units can be allocated to the first client according to actual needs. First, a reserved computing resource sub-unit is allocated to the first client. At this time, if it is detected that the computing resource utilization rate of the first client is still greater than the preset computing resource utilization rate, a reserved computing resource sub-unit can be continuously allocated to the first client, and so on until the computing resource rate after the first client is allocated one or more reserved computing sub-units is less than or equal to the preset resource utilization rate. The preset computing resource utilization rate can be set to 90%, and this application does not limit it, and it can be set according to specific requirements.

[0056] In a possible implementation manner, the formula for the preset weight allocation method is A = α * e^(-γ * a), where A is the weight value, a is the number of first historical task requests of the first client, e is the base of the natural logarithm, γ is the attenuation coefficient, and α is the preset base weight.

[0057] Specifically, first, a basic preset weight is formulated according to the number of clients. Suppose there are a total of 10 clients that need to allocate computing resources. At this time, the basic weight corresponding to each client is 10%. The value range of the λ attenuation coefficient is (-1, 0). The larger the value of γ, the more obvious the fluctuation of the weight value with the change of the number of historical task requests. When the number of task requests of the first client is small, the weight value will decay according to the exponential function, thereby reducing its weight and making its proportion in resource allocation relatively low. When the number of task requests of the first client is large, the weight value will be higher, making its proportion in resource allocation relatively high. According to the number of historical task requests of the first client, the weight value can be dynamically adjusted. By adjusting the weight according to the number of historical task requests, it is possible to limit the clients with a large number of task requests, thereby increasing the processing capacity of other clients and improving the processing efficiency of tasks. At the same time, by introducing the attenuation coefficient λ, the weight value can be adjusted smoothly, avoiding system oscillations and instabilities caused by sudden changes in the number of task requests.

[0058] Refer to Figure 2 This application also provides a dynamic allocation device for server computing resources. The device includes: an acquisition module 201 and an allocation module 202;

[0059] The acquisition module 201 is used to obtain the number of first historical task requests of the first client at every preset time interval. The number of first historical task requests is the number of task requests sent by the first client to the server within the preset time interval;

[0060] An allocation module 202 is configured to allocate first computing resources corresponding to the first historical task request quantity to a first client according to the first historical task request quantity.

[0061] In a possible implementation manner, after the obtaining module 201 obtains the first historical task request quantity of the first client, the method further includes: the obtaining module 201 obtains a second historical task request quantity of a second client, where the second historical task request quantity is the quantity of task requests sent by the second client to the server within a preset time period; after the allocation module 202 allocates first computing resources corresponding to the first historical task request quantity to the first client according to the first historical task request quantity, the method further includes: allocating second computing resources corresponding to the second historical task request quantity to the second client according to the second historical task request quantity.

[0062] In a possible implementation manner, according to the first historical task request quantity, the allocation module 202 allocates first computing resources corresponding to the first historical task request quantity to the first client; specifically including: determining a computing resource allocation weight of the first client according to the first historical task request quantity, the second historical task request quantity, and a first preset weight allocation method; and allocating first computing resources corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client.

[0063] In a possible implementation manner, the computing resources of the server include computing resources to be allocated; according to the computing resource allocation weight of the first client, the allocation module 202 allocates first computing resources corresponding to the first historical task request quantity to the first client, specifically including: the allocation module 202 allocates first computing resources corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client and the computing resources to be allocated.

[0064] In a possible implementation manner, the computing resources of the server include reserved computing resources; after the allocation module 202 allocates first computing resources corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client, the method further includes: monitoring the resource utilization rate of the first computing resources; when the resource utilization rate is greater than a preset resource utilization rate, the allocation module 202 allocates reserved computing resources to the first client.

[0065] In a possible implementation manner, the reserved computing resources include multiple reserved computing resource sub-units; when the resource utilization rate is greater than a preset resource utilization rate, the allocation module 202 allocates one or more reserved computing resource sub-units to the first client; wherein, the computing resource rate of the first client after allocating one or more reserved computing resource sub-units is less than or equal to the preset resource utilization rate.

[0066] In a possible implementation, the formula for the preset weight allocation method is A = α * e^(-γ * a), where A is the weight value, a is the number of first historical task requests of the first client, e is the base of the natural logarithm, γ is the decay coefficient, and α is the preset base weight.

[0067] It should be noted that when the device provided in the above embodiment realizes its functions, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process can be seen in the method embodiment, which will not be repeated here.

[0068] This application also discloses an electronic device. Refer to Figure 3 , Figure 3 which is a schematic structural diagram of an electronic device disclosed in an embodiment of this application. The electronic device 300 may include: at least one processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.

[0069] Among them, the communication bus 302 is used to realize the connection and communication between these components.

[0070] Among them, the user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may further include a standard wired interface and a wireless interface.

[0071] Among them, the network interface 304 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0072] Among them, the processor 301 may include one or more processing cores. The processor 301 connects various parts within the entire server through various interfaces and lines. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling the data stored in the memory 305, it performs various functions of the server and processes data. Optionally, the processor 301 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 301 may integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 301 and may be implemented separately by a single chip.

[0073] Among them, the memory 305 may include random access memory (RAM) and may also include read-only memory. Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 305 may also be at least one storage device located far from the aforementioned processor 301. Refer to Figure 3 , as a computer storage medium, the memory 305 may include an operating system, a network communication module, a user interface module, and an application program related to the dynamic allocation of server computing resources.

[0074] In Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an interface for the user to input and obtain the data input by the user; while the processor 301 can be used to call an application program stored in the memory 305 that involves a dynamic allocation method of server computing resources. When executed by one or more processors 301, the electronic device 300 is caused to execute one or more of the methods as described in the foregoing embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be adopted in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0075] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0076] In several implementation manners provided by this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some service interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.

[0077] 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 can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0078] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0079] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, mobile hard disks, magnetic disks, or optical discs.

[0080] The foregoing are only exemplary embodiments of the present disclosure, and the scope of the present disclosure cannot be limited thereby. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. After considering the specification and the disclosure of the practical truth, those skilled in the art will easily think of other implementation manners of the present disclosure.

[0081] The present application aims to cover any variations, uses, or adaptive changes of the present disclosure. These variations, uses, or adaptive changes follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not recorded in the present disclosure. The specification and the embodiments are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A dynamic allocation method for server computing resources, characterized in that Applied to a server, the method includes: At every preset time interval, obtain the first historical task request quantity of the first client, where the first historical task request quantity is the quantity of task requests sent by the first client to the server within the preset time interval; According to the first historical task request quantity, allocate the first computing resource corresponding to the first historical task request quantity to the first client; The step of allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the first historical task request quantity specifically includes: Determine the computing resource allocation weight of the first client according to the first historical task request quantity and the preset weight allocation method; According to the computing resource allocation weight of the first client, allocate the first computing resource corresponding to the first historical task request quantity to the first client; the computing resources of the server include reserved computing resources and computing resources to be allocated; After allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client, the method further includes: Monitor the resource utilization rate of the first computing resource; When the resource utilization rate is greater than the preset resource utilization rate, allocate the reserved computing resources to the first client, where the reserved computing resources include multiple reserved computing resource sub-units; When the resource utilization rate is greater than the preset resource utilization rate, allocate one or more of the reserved computing resource sub-units to the first client; where The computing resource rate of the first client after allocating one or more of the reserved computing resource sub-units is less than or equal to the preset resource utilization rate; The step of allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client specifically includes: Allocate the first computing resource corresponding to the first historical task request quantity to the first client according to the computing resource allocation weight of the first client and the computing resources to be allocated.

2. The method according to claim 1, wherein After the operation of obtaining the first historical task request quantity of the first client, the method further includes: Obtain the second historical task request quantity of the second client, where the second historical task request quantity is the quantity of task requests sent by the second client to the server within the preset time interval; After allocating the first computing resource corresponding to the first historical task request quantity to the first client according to the first historical task request quantity, the method further includes: According to the second historical task request quantity, allocate the second computing resource corresponding to the second historical task request quantity to the second client.

3. The method according to claim 1, wherein The formula for the preset weight allocation method is , where A is the weight value, a is the number of the first historical task requests of the first client, e is the base of the natural logarithm, is the attenuation coefficient, is the preset basic weight.

4. A dynamic allocation device for server computing resources, characterized in that, The device is a server, and the server is used to execute the method according to any one of claims 1-3. The server includes: an obtaining module (201), an allocating module (202); The obtaining module (201) is configured to obtain the first historical task request quantity of the first client at intervals of a preset time period, where the first historical task request quantity is the quantity of task requests sent by the first client to the server within the preset time period; The allocation module (202) is configured to allocate first computing resources corresponding to the first historical task request quantity to the first client according to the first historical task request quantity.

5. An electronic device, characterized in that, It includes a processor (301), a memory (305), a user interface (303), and a network interface (304). The memory (305) is configured to store instructions. The user interface (303) and the network interface (304) are configured to communicate with other devices. The processor (301) is configured to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1-3 is executed.

Citation Information

Patent Citations

  • A computational node cluster elastic distribution system and method

    CN109165093A

  • Resource allocation method and device, computer readable medium and electronic equipment

    CN113230658A

  • Resource scheduling method for AI cloud computing server group

    CN116610457A