Resource scheduling method, device, terminal equipment and readable storage medium

By predicting the number of executions and the computing power required for calculations, determining the computing power to be increased or decreased, and expansion and contraction plans, and dynamically adjusting cloud server resources, the problem of untimely resource scheduling in the existing technology is solved, and effective utilization of resources is achieved.

CN117493003BActive Publication Date: 2024-09-03SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311504966.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-09
Publication Date
2024-09-03
Estimated Expiration
2043-11-09

AI Technical Summary

Technical Problem

The existing technology makes it difficult to schedule cloud server resources in a timely manner according to actual business needs, leading to resource waste or shortage problems.

Method used

By obtaining the current and historical number of executions, predicting the number of executions in the next unit of time, and calculating the total computing power required based on the computing power of a single execution, determining the computing power to be increased or decreased and the expansion and contraction plan, and dynamically expanding or shrinking the server cluster. Allow.

Benefits of technology

Accurately determine expansion and contraction plans, adjust server cluster resources in a timely manner, avoid resource waste or shortage, and ensure that resources meet business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117493003B
    Figure CN117493003B
Patent Text Reader

Abstract

This application relates to the field of resource scheduling technology, and provides a resource scheduling method, apparatus, terminal device, and readable storage medium. The resource scheduling method includes: obtaining the current execution count of a target service within the current unit time, and the historical execution count of the target service within a historical unit time; predicting the predicted execution count of the target service within the next unit time based on the current and historical execution counts; calculating the first total computing power required to execute the target service the predicted number of times within the next unit time based on the predicted execution count and the computing power per execution; determining the computing power to be increased or decreased within the next unit time based on the first total computing power; determining a scaling-up / scaling plan for the next unit time based on the computing power to be increased or decreased; and performing resource scheduling according to the scaling-up / scaling plan to scale up or down the current server cluster. This allows the scaled-up / scaled server cluster to meet the execution requirements of the target service within the next unit time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of resource scheduling, and in particular, relates to a resource scheduling method, apparatus, terminal device and readable storage medium. Background Art

[0002] With the continuous development of AI technology, AI has more and more application scenarios, such as multimodal models accelerating text, image and video fusion. Currently, many AI businesses need to use the computing power resources of cloud servers to perform AI calculations. In related technologies, for fixed AI businesses, the number of cloud servers is relatively fixed, making it difficult to schedule resources in a timely manner according to actual business needs, which is prone to resource waste or insufficient resources. Summary of the invention

[0003] The embodiments of the present application provide a resource scheduling method, apparatus, terminal device and readable storage medium, which can solve the problem in related technologies that it is difficult to schedule resources in a timely manner according to actual business needs.

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

[0005] Obtain the current execution count of the target business in the current unit time, and the historical execution count of the target business in the historical unit time;

[0006] Predict the predicted execution times of the target business in the next unit time based on the current execution times and historical execution times;

[0007] Obtain the single execution computing power required to execute the target business, and calculate the first total execution computing power required to execute the target business the predicted number of executions in the next unit time according to the predicted number of executions and the single execution computing power;

[0008] Determine the computing power to be increased or decreased for the next unit time based on the first execution total computing power;

[0009] Determine the expansion and contraction plan for the next unit of time based on the computing power to be increased or decreased;

[0010] Schedule resources according to the expansion and contraction plan to expand or contract the current server cluster.

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

[0012] An acquisition module, used to acquire the current execution times of the target business in the current unit time, and the historical execution times of the target business in the historical unit time;

[0013] A prediction module, used to predict the predicted execution number of the target business in the next unit time according to the current execution number and the historical execution number;

[0014] a calculation module, used to obtain a single execution computing power required to execute the target business, and calculate a first total execution computing power required to execute the target business the predicted number of executions in the next unit time according to the predicted number of executions and the single execution computing power;

[0015] A first determining module, configured to determine the computing power to be increased or decreased in the next unit time based on the first execution total computing power;

[0016] A second determination module is used to determine a capacity expansion or contraction plan for the next unit time based on the computing power to be increased or decreased;

[0017] The scheduling module is used to perform resource scheduling according to the expansion and contraction plan to expand or contract the current server cluster.

[0018] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned resource scheduling method when executing the computer program.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource scheduling method are implemented.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the resource scheduling method described above.

[0021] The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application first predicts the predicted number of executions of the target business in the next unit time through the current number of executions and the historical number of executions. Then, based on the predicted number of executions and the computing power of a single execution, the first total execution computing power required to execute the predicted number of executions of the target business in the next unit time is calculated. Then, based on the first total execution computing power, the computing power to be increased or decreased in the next unit time is determined, and then the expansion and contraction plan for the next unit time is determined based on the computing power to be increased or decreased, and finally the current server cluster is expanded or contracted according to the expansion and contraction plan. The embodiment of the present application can accurately determine the expansion and contraction plan for the next unit time, so as to perform resource scheduling according to the expansion and contraction plan, and expand or contract the current server cluster in time, so that the server cluster after expansion and contraction can meet the execution requirements of the target business in the next unit time, avoiding the phenomenon of resource waste or insufficient resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0023] Figure 1 It is a schematic diagram of an implementation flow of a resource scheduling method provided in an embodiment of the present application;

[0024] Figure 2 It is a schematic diagram of an implementation flow of determining a capacity expansion and contraction plan for the next unit time provided in an embodiment of the present application;

[0025] Figure 3 This is a schematic diagram of a process for implementing the determination of the computing power to be increased or decreased in the next unit time provided by an embodiment of the present application;

[0026] Figure 4 It is a schematic diagram of the implementation flow of calculating the first execution total computing power provided in an embodiment of the present application;

[0027] Figure 5 It is a schematic diagram of the implementation process of resource scheduling for the current server cluster provided by an embodiment of the present application;

[0028] Figure 6 It is a structural diagram of a resource scheduling device provided in an embodiment of the present application;

[0029] Figure 7 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.

[0031] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.

[0032] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0033] With the continuous development of AI technology, AI has more and more application scenarios, such as multimodal models accelerating text, image and video fusion. Currently, many AI businesses need to use the computing power resources of cloud servers to perform AI calculations. In related technologies, for fixed AI businesses, the number of cloud servers is relatively fixed, making it difficult to schedule resources in a timely manner according to actual business needs, which is prone to resource waste or insufficient resources.

[0034] In view of this, the embodiments of the present application can accurately determine the expansion or reduction plan for the next unit time, thereby performing resource scheduling according to the expansion or reduction plan, and timely expanding or reducing the capacity of the current server cluster so that the expanded or reduced server cluster can meet the execution requirements of the target business in the next unit time, avoiding waste of resources or insufficient resources.

[0035] For ease of understanding, some usage scenarios of this application example are described here:

[0036] The embodiments of the present application can be applied to AI special effects scenarios. Exemplarily, the embodiments of the present application can be specifically applied to face fusion effects in AI special effects. In the video editing process, face fusion technology can be used to replace different faces to achieve a more vivid video effect. The user can send a call request to call the face fusion effect on the user terminal. The execution subject of the embodiment of the present application (i.e., the terminal device) can use the GPU computing power resources of the cloud server according to the user's call request to perform face fusion on the different faces input by the user, and return the output result to the user to provide the user with corresponding AI services.

[0037] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0038] Figure 1 The present invention provides a schematic diagram of a resource scheduling method according to an embodiment of the present invention, which can be applied to a terminal device, such as a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.

[0039] Specifically, the resource scheduling method may include the following steps S101 to S106.

[0040] Step S101, obtaining the current execution times of the target service in the current unit time and the historical execution times of the target service in the historical unit time.

[0041] Among them, unit time refers to a certain time period as a unit within a certain period of time, which can represent a time period and can be set according to actual needs, for example, it can be set to 10 minutes. The current unit time may refer to the unit time at the current time. The historical unit time may refer to one or more unit times before the current unit time. The target business may be a business that uses the computing power resources of the server to execute, or it may be an AI business, specifically a certain AI special effect, such as face fusion special effects, watercolor effects special effects, etc. The number of executions may refer to the number of times the corresponding target business is called, for example, it may be the number of times the face fusion special effects are called. It is understandable that the terminal device can record the number of executions of the target business in each unit time.

[0042] In the implementation of the present application, a user may send a call request to a terminal device to call a target service. It is understandable that multiple users may request to call the same target service, or a user may request to call the target service multiple times. The terminal device may receive the call request sent by the user in the current unit time and the historical unit time, thereby obtaining the current execution count and the historical execution count.

[0043] Step S102: predicting the predicted execution times of the target business in the next unit time according to the current execution times and the historical execution times.

[0044] The next unit time refers to the next unit time after the current unit time. The predicted execution times are the times of calling the target service in the next unit time obtained through prediction.

[0045] In an implementation manner of the present application, the terminal device may predict the predicted execution times of the target service in the next unit time by various prediction methods, for example, a moving average method, a linear regression method, etc. may be used.

[0046] In some specific implementations of the present application, the above-mentioned prediction of the predicted execution number of the target service in the next unit time based on the current execution number and the historical execution number may specifically include the following steps:

[0047] Using the moving average method, the predicted execution times of the target business in the next unit time are predicted based on the current execution times and the historical execution times.

[0048] It is understandable that the use scenario of the implementation scheme of the present application is generally a use scenario with relatively stable demand, so the moving average method can be used to predict the predicted execution times of the target service in the next unit time. Specifically, the terminal device can select a time window length, for example, 3 unit time periods can be selected, and the average of the execution times of the three unit time periods can be calculated based on the current execution times of the current unit time and the execution times of the first two unit time periods of the current unit time, and the average value is used as the predicted execution times of the target service in the next unit time.

[0049] Step S103, obtaining the single execution computing power required to execute the target business, and calculating the first total execution computing power required to execute the target business the predicted number of executions in the next unit time according to the predicted number of executions and the single execution computing power.

[0050] The single execution computing power may refer to the computing power required to execute a target service once. It is understandable that the single execution computing power may be preset and stored in the memory of the terminal device. The first execution total computing power may be the total computing power resources required to execute the target service for the predicted number of executions in the next unit time.

[0051] In an embodiment of the present application, the terminal device can obtain the single execution computing power required to execute the target business in the memory, and use the predicted number of executions and the single execution computing power to calculate the first total execution computing power required to execute the target business the predicted number of executions in the next unit time.

[0052] In some specific implementations of the present application, the first total execution computing power required to execute the predicted number of executions of the target service in the next unit time is calculated based on the predicted number of executions and the single execution computing power, which may specifically include the following steps:

[0053] Multiply the predicted number of executions by the single execution computing power to obtain the first execution total computing power.

[0054] In the implementation manner of the present application, it can be understood that by multiplying the predicted number of executions by the single execution computing power, the first total execution computing power can be obtained.

[0055] Step S104: Determine the computing power to be increased or decreased for the next unit time based on the first execution total computing power.

[0056] The computing power to be increased or decreased is used to represent the computing power that needs to be increased or decreased to achieve the first execution total computing power based on the computing power that the server cluster can provide in the current unit time. The computing power to be increased or decreased may include computing power to be increased and computing power to be decreased.

[0057] In an implementation of the present application, the terminal device may first determine the total computing power of the current server cluster, and then determine the computing power to be increased or decreased in the next unit time according to the total computing power of the current server cluster and the first execution total computing power.

[0058] Step S105: determining a capacity expansion or contraction plan for the next unit time based on the computing power to be increased or decreased.

[0059] The expansion and contraction plan is used to indicate how many servers the terminal device needs to expand or contract before the next unit time. Specifically, the expansion and contraction plan can be a table, which can record the types and quantities of servers that need to be increased or decreased.

[0060] In an implementation manner of the present application, the terminal device can increase or decrease the computing power, as well as the computing power of a single server, to determine how many servers need to be added or reduced before the next unit time, that is, to obtain a capacity expansion or contraction plan for the next unit time.

[0061] Step S106: perform resource scheduling according to the expansion and contraction plan, and expand or reduce the capacity of the current server cluster.

[0062] The server cluster may be a cluster composed of multiple cloud servers. It is understood that the terminal device can use the computing resources (such as GPU computing resources) of the server cluster to execute the target business. The current server cluster may refer to the server cluster used in the current unit time. Cloud servers may include A10, A30, V100, T4 and other servers.

[0063] In the implementation of the present application, the terminal device can perform resource scheduling according to the expansion and contraction plan to expand or contract the current server cluster. For example, if the expansion and contraction plan is to add 10 A10 servers, the terminal device can perform resource scheduling according to the expansion and contraction plan to add 10 A10 servers to the current server cluster.

[0064] The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application first predicts the predicted number of executions of the target business in the next unit time through the current number of executions and the historical number of executions. Then, based on the predicted number of executions and the computing power of a single execution, the first total execution computing power required to execute the predicted number of executions of the target business in the next unit time is calculated. Then, based on the first total execution computing power, the computing power to be increased or decreased in the next unit time is determined, and then the expansion and contraction plan for the next unit time is determined based on the computing power to be increased or decreased, and finally the current server cluster is expanded or contracted according to the expansion and contraction plan. The embodiment of the present application can accurately determine the expansion and contraction plan for the next unit time, so as to perform resource scheduling according to the expansion and contraction plan, and expand or contract the current server cluster in time, so that the server cluster after expansion and contraction can meet the execution requirements of the target business in the next unit time, avoiding the phenomenon of resource waste or insufficient resources.

[0065] like Figure 2 As shown, in some implementations of the present application, the above-mentioned determination of the expansion and contraction plan for the next unit time based on the computing power to be increased or decreased may specifically include steps S201 to S205.

[0066] Step S201, obtaining a server applicable model of a target business, and determining an applicable server corresponding to the server applicable model.

[0067] Among them, the server applicable model may refer to the model of the server applicable to the target business. It is understandable that since each target business (such as AI special effects) may have differences in the compilation of online services, different target businesses may be adapted to different servers. For example, some AI special effects can only run on GeForce RTX 4090 servers, while other AI special effects can only run on A10 and A30 servers. It is also understandable that developers can pre-store the server applicable models corresponding to each target business in the memory. The applicable server may refer to a server applicable to the target business.

[0068] In an implementation manner of the present application, the terminal device may retrieve the applicable server model corresponding to the target service from the memory according to the type of the target service, thereby determining the applicable server corresponding to the target service.

[0069] S202, obtaining the average processing time and cost of each applicable server for the target service.

[0070] The average processing time may refer to the average time taken to call a target service using an applicable server, for example, 5 seconds. The processing cost may refer to the cost of using an applicable server. It is understandable that the developer may store the average processing time and the processing cost in the memory in advance.

[0071] In an implementation manner of the present application, the terminal device can directly retrieve from the memory the average processing time and processing cost of each applicable server for the target service.

[0072] S203: Determine the priority of scaling up or down of applicable servers according to the average processing time and processing cost.

[0073] The scaling priority is used to represent the priority order of scaling using applicable servers.

[0074] In the implementation of the present application, the terminal device may multiply the average processing time and processing cost of each applicable server to obtain a corresponding product. It is understandable that the larger the product, the higher the time cost and money cost of using the corresponding server. The terminal device may determine the scaling priority of the applicable servers according to the product size of each used server. Specifically, the smaller the product, the higher the scaling priority of the corresponding applicable server.

[0075] S204, obtaining the server computing power of each applicable server.

[0076] The server computing power may be the computing power resources that the server can provide. It is understandable that the developer may store the server computing power of each applicable server in the memory in advance.

[0077] In an implementation manner of the present application, the terminal device can directly retrieve the server computing power of each applicable server from the memory.

[0078] S205: Determine the expansion and contraction plan for the next unit time according to the computing power to be increased or decreased, the server computing power, and the priority of expansion and contraction.

[0079] In the implementation manner of the present application, the terminal device may determine the applicable server for expansion and contraction according to the expansion and contraction priority order, for example, the applicable server ranked first in the expansion and contraction priority order may be selected for expansion and contraction. The terminal device may divide the computing power to be increased or decreased by the server computing power of the applicable server to obtain a factor of the two, and the factor is the expansion and contraction quantity of the applicable server. If there is a remainder after the division of the two, the factor is increased by 1, and the factor plus 1 is the expansion and contraction quantity of the applicable server.

[0080] In some scenarios, if the actual number of applicable servers ranked first in the scaling priority order provided by the cloud server vendor is less than the scaling number of applicable servers obtained in the above steps, the scaling plan can be adjusted according to the actual situation so that the time cost and money cost of using the applicable servers are minimized when actual conditions permit. This application will not elaborate on this in the implementation method.

[0081] like Figure 3 As shown, in some implementations of the present application, the above-mentioned determination of the computing power to be increased or decreased in the next unit time based on the first execution total computing power may specifically include steps S301 to S306.

[0082] Step S301 , dividing the unit time by the average processing time, to obtain the first maximum number of processing times of the target service by each applicable server in the current unit time.

[0083] The first maximum number of processing times may be the maximum number of processing times of the target service by each applicable server in the current unit time, for example, 3 times.

[0084] In an implementation manner of the present application, the terminal device may divide the unit time by the average processing time, and the factor of the two is the first maximum number of processing times.

[0085] For example, assuming that the unit time is 10 minutes, and the average processing time of a certain applicable server on the target service is 3 minutes, then the maximum number of times that the applicable server processes the target service within the unit time is 3 times.

[0086] Step S302, obtaining the server quantity of each applicable server in the current server cluster, and obtaining the second maximum processing number of the current server cluster in the current unit time according to the first maximum processing number of each applicable server and the corresponding server quantity.

[0087] The second maximum number of processing times may be the maximum number of processing times of the target service by the current server cluster within the current unit time, for example, 36 times.

[0088] In an implementation of the present application, the terminal device can directly obtain the server quantity of each applicable server in the current server cluster, and multiply the first maximum processing number by the corresponding server quantity. The product of the two is the second maximum processing number of the current server cluster in the current unit time.

[0089] For example, assuming that there is only one applicable server in the current server cluster, the number of applicable servers is 12, and the maximum number of processing times of the applicable server per unit time (i.e., the first maximum number of processing times) is 3 times, then the maximum number of processing times of the target business by the current server cluster per unit time is 36 times.

[0090] Step S303: Obtain the number of unfinished operations for the target business within the current unit time according to the current execution number and the second maximum processing number.

[0091] The number of unfinished operations is the number of unfinished executions of the target service in the current unit time. For example, it can be 4 times. It is understandable that in actual use, due to computing power or other reasons, the number of times the current service cluster actually executes the target service may be less than the number of times the user applies to call the target service, that is, there is an unfinished number.

[0092] In an implementation manner of the present application, the terminal device may subtract the current execution times from the second maximum processing times, and the difference between the two is the number of unfinished operations for the target service in the current unit time.

[0093] Exemplarily, assuming that the current number of executions is 40 and the second highest number of processings is 36, then the number of unfinished operations of the target business is 4 in the current unit time.

[0094] Step S304, according to the number of unfinished operations and the single execution computing power, obtain the compensation computing power required to execute the target business the number of unfinished operations in the next unit time.

[0095] The compensation computing power can be the computing power used to compensate for the number of unfinished tasks in the current unit time in the next unit time. It is understandable that if there are unfinished tasks in the current unit time, then in the next unit time, the target service needs to be executed for the number of unfinished tasks first, and then executed for the number of times corresponding to the next unit time, so as to execute all the user's call requests for the target service.

[0096] In an implementation manner of the present application, the terminal device may multiply the number of incomplete executions by the single execution computing power, and the product of the two is the compensation computing power required to execute the target business for the number of incomplete executions in the next unit time.

[0097] For example, assuming that the number of unfinished operations is 4 and the computing power for a single execution is 10, the compensatory computing power required to execute the target business for the number of unfinished operations in the next unit time is 40.

[0098] Step S305, obtaining the total server computing power of the current server cluster in the current unit time, and obtaining the available computing power of the current server cluster in the next unit time based on the total server computing power and the compensation computing power.

[0099] The available computing power can be the computing power that the current server cluster can provide for executing the target business with the predicted execution times in the next unit time. It can be understood that the computing power that the current server cluster can provide for executing the target business with the predicted execution times in the next unit time is the difference between the total computing power of the current server cluster and the compensation computing power required to execute the target business with the unfinished times.

[0100] In an implementation manner of the present application, the terminal device can directly obtain the total server computing power of the current server cluster in the current unit time, and subtract the total server computing power from the compensation computing power. The difference between the two is the available computing power of the current server cluster in the next unit time.

[0101] For example, assuming that the total server computing power of the current server cluster is 400 and the compensation computing power is 40, then in the next unit time, the available computing power of the current server cluster is 360.

[0102] Step S306: Obtain computing power to be increased or decreased for the next unit time according to the first execution total computing power and the available computing power.

[0103] In an implementation manner of the present application, the terminal device may subtract the first execution total computing power from the available computing power, and the difference between the two is the computing power to be increased or decreased in the next unit time.

[0104] For example, assuming that the total computing power of the first execution is 500 and the available computing power is 360, the computing power to be increased or decreased in the next unit time is 140.

[0105] In some scenarios, if the target business is not executed the current number of times in the current unit time, and the number of times that are not executed in the current unit time is not taken into account in the next unit time, the calculated total computing power for the next unit time cannot provide sufficient computing power for both the predicted number of executions and the number of times that are not executed in the current unit time in the next unit time, resulting in some users' call requests not being executed.

[0106] In view of this, if Figure 4 As shown, in some embodiments of the present application, the above-mentioned calculation based on the predicted number of executions and the single execution computing power is used to obtain the first total execution computing power required to execute the predicted number of executions of the target business in the next unit time, which may specifically include steps S401 to S404.

[0107] Step S401, obtaining the total server computing power of the current server cluster in the current unit time.

[0108] In an implementation manner of the present application, the terminal device can directly obtain the total server computing power of the current server cluster in the current unit time.

[0109] Step S402, according to the current number of executions and the single execution computing power, obtain the second total execution computing power required to execute the target business the current number of executions in the current unit time.

[0110] The second total execution computing power may be the total computing power required to execute the target business the current number of times within the current unit time.

[0111] In an implementation manner of the present application, the terminal device may multiply the current number of executions by the single execution computing power, and the product of the two is the second total execution computing power required to execute the target service the current number of executions within the current unit time.

[0112] Step S403, calculating the number of unexecuted times for the target business within the current time according to the second total execution computing power, the total computing power of the server and the single execution computing power.

[0113] The number of non-executions may be the number of times the target service has not been executed within the current unit time.

[0114] In an implementation manner of the present application, the terminal device may subtract the total computing power of the server from the second total computing power, and then divide the difference between the two by the single execution computing power. The resulting factor is the number of unexecuted times for the target service within the current time.

[0115] Step S404, based on the predicted number of executions, the number of unexecuted times, and the single execution computing power, calculate the first total execution computing power required to execute the predicted number of executions and the number of unexecuted times of the target business in the next unit time.

[0116] In an implementation manner of the present application, the terminal device can add the predicted number of executions to the number of non-executions, and then multiply the sum of the two by the single execution computing power. The product obtained is the total execution computing power required to execute the predicted number of executions and the number of non-executions of the target business in the next unit time.

[0117] The implementation mode of the present application calculates the number of non-executions of the target business in the current time, and fully considers the number of non-executions in the current unit time when calculating the first total execution computing power required for the next unit time, so that the first total execution computing power finally calculated covers the computing power required for executing the predicted number of executions and the number of non-executions in the current unit time, thereby preventing the situation where some users' call requests are not executed.

[0118] like Figure 5 As shown, in some specific implementations of the present application, the above-mentioned resource scheduling according to the expansion and contraction plan to expand or contract the current server cluster may specifically include steps S501 to S503.

[0119] Step S501: perform resource scheduling according to the expansion and contraction plan to expand or contract the servers in the current server cluster.

[0120] In the implementation of the present application, after obtaining the expansion and contraction plan, the terminal device can perform resource scheduling according to the expansion and contraction plan to expand or contract the server for the current server cluster. For example, if the expansion and contraction plan is to add 10 A30 processors, the terminal device can add 10 A30 processors to the current server cluster.

[0121] Step S502: Obtain a configuration file corresponding to the target service.

[0122] The configuration file is used to configure server parameters for the expanded or reduced server. Developers can store the configuration file corresponding to each target business in the memory of the terminal device.

[0123] In an implementation manner of the present application, after obtaining the server to be added, the terminal device can directly obtain the corresponding configuration file from the memory of the terminal device.

[0124] Step S503: configuring parameters for the expanded server or the reduced server according to the configuration file.

[0125] In an implementation manner of the present application, the terminal device may configure parameters for the expanded server or the reduced server according to the configuration file, so that the expanded or reduced server is ready for service.

[0126] Figure 6 A schematic diagram of the structure of a resource scheduling device provided in an embodiment of the present application is shown. The resource scheduling device 6 may be configured on a terminal device. Specifically, the resource scheduling device 6 may include:

[0127] The acquisition module 601 is used to acquire the current execution times of the target service in the current unit time and the historical execution times of the target service in the historical unit time.

[0128] The prediction module 602 is used to predict the predicted execution number of the target business in the next unit time according to the current execution number and the historical execution number.

[0129] The calculation module 603 is used to obtain the single execution computing power required to execute the target business, and calculate the first total execution computing power required to execute the target business the predicted number of executions in the next unit time based on the predicted number of executions and the single execution computing power.

[0130] The first determining module 604 is configured to determine the computing power to be increased or decreased in the next unit time based on the first execution total computing power.

[0131] The second determination module 605 is used to determine the expansion and reduction plan for the next unit time based on the computing power to be increased or decreased.

[0132] The scheduling module 606 is used to perform resource scheduling according to the expansion and contraction plan, and expand or reduce the capacity of the current server cluster.

[0133] The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application first predicts the predicted number of executions of the target business in the next unit time through the current number of executions and the historical number of executions. Then, based on the predicted number of executions and the computing power of a single execution, the first total execution computing power required to execute the predicted number of executions of the target business in the next unit time is calculated. Then, based on the first total execution computing power, the computing power to be increased or decreased in the next unit time is determined, and then the expansion and contraction plan for the next unit time is determined based on the computing power to be increased or decreased, and finally the current server cluster is expanded or contracted according to the expansion and contraction plan. The embodiment of the present application can accurately determine the expansion and contraction plan for the next unit time, so as to perform resource scheduling according to the expansion and contraction plan, and expand or contract the current server cluster in time, so that the server cluster after expansion and contraction can meet the execution requirements of the target business in the next unit time, avoiding the phenomenon of resource waste or insufficient resources.

[0134] In some embodiments of the present application, the above-mentioned second determination module 605 can also be used to: obtain the applicable server model of the target business, and determine the applicable server corresponding to the applicable server model; obtain the average processing time and processing cost of each applicable server for the target business; determine the scaling priority of the applicable servers based on the average processing time and processing cost; obtain the server computing power of each applicable server; determine the scaling plan for the next unit time based on the computing power to be increased or decreased, the server computing power and the scaling priority.

[0135] In some embodiments of the present application, the above-mentioned first determination module 604 can also be used to: divide the unit time by the average processing time to obtain the first maximum number of processing times of the target business by each applicable server in the current unit time; obtain the server number of each applicable server in the current server cluster, and obtain the second maximum number of processing times of the current server cluster in the current unit time based on the first maximum number of processing times of each applicable server and the corresponding number of servers; obtain the number of incomplete times of the target business in the current unit time based on the current execution number and the second maximum number of processing times; obtain the compensation computing power required to execute the incomplete number of target business in the next unit time based on the incomplete number and the single execution computing power; obtain the total server computing power of the current server cluster in the current unit time, and obtain the available computing power of the current server cluster in the next unit time based on the total server computing power and the compensation computing power; obtain the computing power to be increased or decreased in the next unit time based on the first execution total computing power and the available computing power.

[0136] In some embodiments of the present application, the above-mentioned computing module 603 can also be used to: obtain the total server computing power of the current server cluster in the current unit time; obtain the second total execution computing power required to execute the current number of executions of the target business in the current unit time based on the current number of executions and the single execution computing power; calculate the number of non-executions of the target business in the current time based on the second total execution computing power, the total server computing power and the single execution computing power; calculate the first total execution computing power required to execute the predicted number of executions and the number of non-executions of the target business in the next unit time based on the predicted number of executions, the number of non-executions and the single execution computing power.

[0137] In some implementations of the present application, the prediction module 602 may also be used to: use a moving average method to predict the predicted execution times of the target business in the next unit time according to the current execution times and the historical execution times.

[0138] In some embodiments of the present application, the above-mentioned scheduling module 606 can also be used to: perform resource scheduling according to the expansion and contraction plan, expand or reduce the server capacity of the current server cluster; obtain the configuration file corresponding to the target business; and configure parameters for the expanded or reduced server according to the configuration file.

[0139] In some implementations of the present application, the above-mentioned calculation module 603 can also be used to: multiply the predicted number of executions by the single execution computing power to obtain the first total execution computing power.

[0140] like Figure 7, which is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 7 may include: a processor 701, a memory 702, and a computer program 703 stored in the memory 702 and executable on the processor 701, such as a resource scheduling program. When the processor 701 executes the computer program 703, the steps in the above-mentioned resource scheduling method embodiments are implemented, such as Figure 1 Alternatively, when the processor 701 executes the computer program 703, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 The obtained module 601, the predicted module 602, the calculated module 603, the first determined module 604, the second determined module 605, and the scheduling module 606 are shown.

[0141] The computer program may be divided into one or more modules / units, which are stored in the memory 702 and executed by the processor 701 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0142] The terminal device may include, but is not limited to, a processor 701 and a memory 702. Those skilled in the art will appreciate that Figure 7 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access equipment, buses, etc.

[0143] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0144] The memory 702 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 702 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Furthermore, the memory 702 may include both an internal storage unit of the terminal device and an external storage device. The memory 702 is used to store the computer program and other programs and data required by the terminal device. The memory 702 may also be used to temporarily store data that has been output or is to be output.

[0145] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.

[0146] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0147] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned resource scheduling method can be implemented.

[0148] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned resource scheduling method when executing the computer program product.

[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0150] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0151] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0154] If the integrated module / 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 storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0155] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A resource scheduling method, It is characterized in that include: Obtain the current execution count of the target business in the current unit time, and the historical execution count of the target business in the historical unit time; Predicting the predicted execution times of the target business within the next unit time according to the current execution times and the historical execution times; Obtaining a single execution computing power required to execute the target business, and calculating a first total execution computing power required to execute the target business the predicted number of executions in the next unit time according to the predicted number of executions and the single execution computing power; Determining the computing power to be increased or decreased for the next unit time based on the first execution total computing power; Determine a capacity expansion or contraction plan for the next unit time based on the computing power to be increased or decreased; Perform resource scheduling according to the expansion and contraction plan to expand or contract the current server cluster; The step of determining the expansion and contraction plan for the next unit time based on the computing power to be increased or decreased includes: Obtaining a server applicable model for the target business, and determining an applicable server corresponding to the server applicable model; Obtaining the average processing time and processing cost of each applicable server for the target business; Determining the priority order of scaling up and down of the applicable servers according to the average processing time and processing cost; Obtaining the server computing power of each of the applicable servers; Determine the capacity expansion and contraction plan for the next unit time according to the computing power to be increased or decreased, the server computing power, and the capacity expansion and contraction priority order; The determining of the computing power to be increased or decreased for the next unit time based on the first execution total computing power includes: Divide the unit time by the average processing time to obtain the first maximum number of processing times of the target service by each applicable server in the current unit time; Obtaining the server quantity of each applicable server in the current server cluster, and obtaining the second maximum processing number of the current server cluster in a current unit time according to the first maximum processing number of each applicable server and the corresponding server quantity; Obtaining the number of unfinished operations for the target business within a current unit time according to the current number of executions and the second maximum number of processings; According to the unfinished times and the single execution computing power, obtaining the compensation computing power required to execute the target business the unfinished times in the next unit time; Obtaining the total server computing power of the current server cluster in the current unit time, and obtaining the available computing power of the current server cluster in the next unit time according to the total server computing power and the compensation computing power; Obtaining the computing power to be increased or decreased for the next unit time according to the first execution total computing power and the available computing power; The step of calculating the first total execution computing power required to execute the target service the predicted number of executions in the next unit time according to the predicted number of executions and the single execution computing power includes: Obtain the total server computing power of the current server cluster within the current unit time; Obtaining, according to the current number of executions and the single execution computing power, a second total execution computing power required to execute the target service the current number of executions in a current unit time; Calculate the number of unexecuted times for the target business within the current time according to the second total execution computing power, the total server computing power, and the single execution computing power; A first total execution computing power required for executing the target business with the predicted number of executions and the number of non-executions within the next unit time is calculated according to the predicted number of executions, the number of non-executions and the single execution computing power.

2. The resource scheduling method according to claim 1, It is characterized in that The predicting the predicted execution number of the target service in the next unit time according to the current execution number and the historical execution number includes: The predicted execution number of the target business in the next unit time is predicted by using a moving average method according to the current execution number and the historical execution number.

3. The resource scheduling method according to claim 1, It is characterized in that The performing resource scheduling according to the expansion and contraction plan to expand or contract the current server cluster includes: Perform resource scheduling according to the expansion and contraction plan to expand or contract the server capacity of the current server cluster; Obtaining a configuration file corresponding to the target service; Parameters are configured for the expanded server or the reduced server according to the configuration file.

4. The resource scheduling method according to any one of claims 1 to 3, It is characterized in that The calculating, based on the predicted number of executions and the single execution computing power, to obtain a first total execution computing power required to execute the target service the predicted number of executions in the next unit time also includes: The predicted number of executions is multiplied by the single execution computing power to obtain the first total execution computing power.

5. A resource scheduling device, It is characterized in that include: An acquisition module, used to acquire the current execution times of the target business in the current unit time, and the historical execution times of the target business in the historical unit time; A prediction module, used to predict the predicted execution number of the target business in the next unit time according to the current execution number and the historical execution number; a calculation module, used to obtain a single execution computing power required to execute the target business, and calculate a first total execution computing power required to execute the target business the predicted number of executions in the next unit time according to the predicted number of executions and the single execution computing power; A first determining module, configured to determine the computing power to be increased or decreased in the next unit time based on the first execution total computing power; A second determination module is used to determine a capacity expansion or contraction plan for the next unit time based on the computing power to be increased or decreased; A scheduling module, used to schedule resources according to the expansion and contraction plan, and to expand or contract the current server cluster; Wherein, the second determining module is specifically used for: Obtaining a server applicable model for the target business, and determining an applicable server corresponding to the server applicable model; Obtaining the average processing time and processing cost of each applicable server for the target business; Determining the priority order of scaling up and down of the applicable servers according to the average processing time and processing cost; Obtaining the server computing power of each of the applicable servers; Determine the capacity expansion and contraction plan for the next unit time according to the computing power to be increased or decreased, the server computing power, and the capacity expansion and contraction priority order; Wherein, the first determining module is specifically used for: Divide the unit time by the average processing time to obtain the first maximum number of processing times of the target service by each applicable server in the current unit time; Obtaining the server quantity of each applicable server in the current server cluster, and obtaining the second maximum processing number of the current server cluster in a current unit time according to the first maximum processing number of each applicable server and the corresponding server quantity; Obtaining the number of unfinished operations for the target business within a current unit time according to the current number of executions and the second maximum number of processings; According to the unfinished times and the single execution computing power, obtaining the compensation computing power required to execute the target business the unfinished times in the next unit time; Obtaining the total server computing power of the current server cluster in the current unit time, and obtaining the available computing power of the current server cluster in the next unit time according to the total server computing power and the compensation computing power; Obtaining the computing power to be increased or decreased for the next unit time according to the first execution total computing power and the available computing power; Wherein, the calculation module is specifically used for: Obtain the total server computing power of the current server cluster within the current unit time; Obtaining, according to the current number of executions and the single execution computing power, a second total execution computing power required to execute the target service the current number of executions in a current unit time; Calculate the number of unexecuted times for the target business within the current time according to the second total execution computing power, the total server computing power, and the single execution computing power; A first total execution computing power required for executing the target business with the predicted number of executions and the number of non-executions within the next unit time is calculated according to the predicted number of executions, the number of non-executions and the single execution computing power.

6. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the resource scheduling method as claimed in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the resource scheduling method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • System resource dynamic capacity expanding and shrinking method and device, computer device and storage medium

    CN109766182A

  • Scheduling method and device for public cloud computing resources, equipment and storage medium

    CN112269662A

  • Data processing method, computer equipment and readable storage medium

    CN113434294A

  • Automatic capacity expansion and contraction method and device, equipment and storage medium

    CN116166427A

  • Pod scheduling method based on k8s, storage medium and equipment

    CN116244061A