Operation resource scheduling method and its device, equipment, medium, and product
By pre-training the fitting model, the fitting occupancy of the service process is calculated and tasks are allocated to the optimal equipment, which solves the problem of low resource scheduling efficiency in the service cluster, improves resource utilization efficiency and adaptability, and is especially suitable for CPU-intensive tasks .
Patent Information
- Application Number
- CN202111280122.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-10-28
AI Technical Summary
The prior art lacks effective methods to realize adaptive scheduling of operation resources between different computer devices in the service cluster. Especially when handling CPU-intensive tasks, it is difficult to accurately estimate the CPU consumption of the task, resulting in low resource scheduling efficiency.
The pre-trained fitting model is used to calculate the fitting occupancy of the new task based on the running feature data of the service process, and allocate the new task to the service process of the computer equipment with the estimated total usage, and obtain the feature , fit model training and estimate allocation modules to implement resource scheduling.
It realizes optimal scheduling of new running tasks, improves resource utilization efficiency of service clusters, and reduces deployment costs. It is especially suitable for CPU-intensive tasks such as network live broadcast services.
Smart Images

Figure CN113918306B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a service cluster resource scheduling technology, and in particular to an operation resource scheduling method and its corresponding apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Taking server-side mixed stream transcoding as an example, in the service cluster, there are often computer-intensive tasks. Such tasks are intensive in CPU and memory usage, especially CPU usage.
[0003] For such tasks, in order to fully utilize computer operating resources, a server generally needs to run multiple tasks such as the mixed stream transcoding tasks (hereinafter referred to as tasks) at the same time. The existence of a large number of tasks puts higher requirements on the task scheduling within the service cluster. In order to reasonably allocate and schedule tasks, we first need to know how many tasks a machine can run, and then match subsequent tasks according to the load capacity of the machine.
[0004] So far, there is no standard solution to this problem, because understanding the processing power of each machine depends on the model performance of the machine, the specific parameters of the task, and the current state of the input stream. Usually, only CPU consumption estimates can be made for given machine models and task parameters to guide the task allocation logic.
[0005] The general practice is to conduct an offline test on various machine models for some commonly used task parameters, observe the corresponding CPU consumption, and estimate the approximate CPU consumption of online task parameters based on the observed empirical data. This solution requires offline testing and calculation of related data in advance, which will be more or less different from the actual online operating environment. In addition, due to the diversity of task parameter combinations and machine models, it is difficult to cover the test of various combinations of task parameters and machine models, so the estimated CPU consumption is less accurate.
[0006] Therefore, in the prior art, when scheduling running tasks, the service cluster lacks a solution for adaptively scheduling running resources between different computer devices in the service cluster. Especially for running tasks that are intensive in running resources, it is more urgent to propose such a solution as soon as possible. Summary of the invention
[0007] The primary purpose of the present application is to solve at least one of the above problems and provide an operation resource scheduling method and its corresponding device, computer equipment, computer-readable storage medium, and computer program product.
[0008] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0009] A method for scheduling running resources provided to meet one of the purposes of this application includes the following steps:
[0010] In response to a creation event of a new running task in a service cluster, the running characteristic data of each service process, including the new running task and its current running task, and the device identification of the computer device where the service process is located are obtained; for the computer device pointed to by each device identification, a fitting model pre-trained to convergence is used to match the running characteristic data with a weight vector corresponding to the device identification, and the fitting occupancy of the running resources of each service process after loading the new running task is calculated; for the computer device pointed to by each device identification, the estimated total usage of the running resources of the computer device after loading the new running task is calculated according to the corresponding fitting occupancy of each service process, and the new running task is assigned to the service process of the computer device with the best estimated total usage for execution.
[0011] In a further embodiment, the method also includes the step of training the fitting model: obtaining a test set corresponding to each service process in the service cluster, the test set including the operating characteristic data corresponding to all currently running tasks of the service process, the actual occupancy of the operating resources by the service process, and the device identification of the computer device where the service process is located; using the fitting model to perform data fitting on the operating characteristic data matching weight vector in a test set to obtain the fitted occupancy of the operating resources of the computer device pointed to by the device identification by the corresponding service process; updating the weight vector according to the difference gradient between the actual occupancy and the fitted occupancy to promote convergence of the fitting model, and continuing to iteratively train the fitting model when the fitting model has not converged.
[0012] In a specific embodiment, obtaining a test set corresponding to each service process in a service cluster includes the following steps: regularly collecting operation characteristic data corresponding to each service process in the service cluster, wherein the operation characteristic data includes comprehensive characteristic values of all currently running tasks in the service process associated with preselected operation parameters; associating and collecting device identifications of computer devices where each service process is located and actual occupancy of operating resources occupied by each service process in the corresponding computer device; constructing the operation characteristic data, actual occupancy, and device identification corresponding to each service process into a corresponding test set.
[0013] In a further embodiment, the operation characteristic data corresponding to each service process in the service cluster is collected periodically, including the following steps: obtaining the preselected operation parameters of all current running tasks in each service process; extracting the basic characteristic values corresponding to each preselected operation parameter from the preselected operation parameters; performing square operations on a predetermined part of the basic characteristic values to obtain corresponding second-order composite characteristic values; adding all the basic characteristic values and all the second-order composite characteristic values item by item for all the running tasks to obtain the comprehensive characteristic value corresponding to the service process, and all the comprehensive characteristic values constitute the operation characteristic data.
[0014] In a preferred embodiment, the running task is a computer task for performing mixed stream transcoding on multiple video streams; the basic eigenvalues include a set consisting of any number of the following: output audio bit rate, input video resolution, input video frame rate, input video bit rate, input video encoding type, output video resolution, output video frame rate, output video bit rate, output video encoding type; the partial basic eigenvalues used to calculate the second-order composite eigenvalue include at least one of the following when the set includes it accordingly: output video resolution, output video frame rate, output video bit rate, output video encoding type.
[0015] In a further embodiment, the fitting model performs the following steps: obtaining operation characteristic data corresponding to the service process and its corresponding device identification, the operation characteristic data including multiple comprehensive characteristic values; normalizing the comprehensive characteristic values included in the operation characteristic data into a vector representation of a specific space to form a comprehensive characteristic vector; calculating the weighted sum of each comprehensive characteristic value in the comprehensive characteristic vector as the fitting occupancy of the service process according to the weight vector corresponding to the device identification, the weight vector including multiple corresponding weights corresponding to each comprehensive characteristic value in the comprehensive characteristic vector; updating the weight vector according to the estimated error between the fitting occupancy and the actual occupancy of the service process.
[0016] In a specific embodiment, the weight vector is updated according to the estimated error between the fitted occupancy and the actual occupancy of the service process, comprising the following steps: obtaining the estimated error between the fitted occupancy and the actual occupancy of the service process; determining the weight adjustment coefficient according to the product of a preset step size and the estimated error; updating the weight vector, wherein each weight of the updated weight vector is the difference between its original weight and the product of its corresponding comprehensive characteristic value and the weight adjustment coefficient; and adjusting the preset step size according to the updated weight vector.
[0017] In a further embodiment, the preset step size is adjusted according to the updated weight vector, comprising the following steps: recalculating a new fitting occupancy based on the updated weight vector and the comprehensive feature vector; recalculating a new estimation error based on the new fitting occupancy and the corresponding actual occupancy; determining whether the variance between the new estimation error and the previously obtained estimation error is greater than 0, and when the determination is established, reducing the value of the preset step size.
[0018] In a further embodiment, for each computer device pointed to by a device identifier, the estimated total usage of the computer device's operating resources after loading the new running task is calculated based on the corresponding fitted occupancy of each service process therein, and the new running task is assigned to the service process of the computer device with the best estimated total usage for execution, including the following steps: for each service process running in the computer device pointed to by each device identifier, the corresponding fitted occupancy is added to the current actual occupancy of other service processes in the computer device as the estimated total usage of the operating resources of the computer device where each service process is located after loading the new running task; the corresponding remaining amount of the operating resources of the computer device is calculated based on the estimated total usage; the remaining amounts corresponding to each service process are compared, and the service process corresponding to the highest remaining amount is determined as the target service process, and the new running task is assigned to the target service process for execution.
[0019] A running resource scheduling device provided to meet one of the purposes of the present application includes: a feature acquisition module, a usage fitting module, and an estimated allocation module, wherein the feature acquisition module is used to respond to the creation event of a new running task in a service cluster, and obtain the running feature data of each service process including the new running task and its current running task, and the device identification of the computer device where the service process is located; the usage fitting module is used to match the running feature data with the weight vector corresponding to the device identification for the computer device pointed to by each device identification, using a fitting model pre-trained to convergence, to calculate the fitted occupancy of the running resources of each service process after loading the new running task; the estimated allocation module is used to calculate the estimated total usage of the running resources of the computer device after loading the new running task according to the corresponding fitting occupancy of each service process for the computer device pointed to by each device identification, and allocate the new running task to the service process of the computer device with the best estimated total usage for execution.
[0020] A computer device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the resource scheduling method described in the present application.
[0021] A computer-readable storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the operation resource scheduling method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method are executed.
[0022] A computer program product provided to meet another purpose of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any embodiment of the present application.
[0023] Compared with the prior art, the advantages of this application are as follows:
[0024] First, when the present application needs to allocate a service process for executing a new running task within a service cluster, it is assumed that the new running task is allocated to each corresponding service process within the service cluster, and then the running characteristic data of these service processes after including the new running task are obtained respectively. In addition to including the running characteristic data of the new running task, the running characteristic data also includes the running characteristic data of the current running task of the service process. At the same time, the device identification of the computer device where the service process is located is obtained, and a mapping relationship between the device identification of the computer device, the service process, and the corresponding running characteristic data is established; then, for the computer device pointed to by each device identification, a fitting model is used to match the running characteristic data with the weight vector corresponding to the device identification, and the fitting occupancy of the running resources after each service process loads the new running task can be calculated; finally, for each computer device in the service cluster, the estimated total usage of the running resources corresponding to all service processes of the corresponding computer device after the new running task is added to each service process is calculated, and then the optimal solution is sought based on the estimated total usage of each service process, and the new running task is allocated to the service process of the computer device with the optimal estimated total usage to run, thereby realizing the scheduling and allocation of the new running task. It can be seen that since each new running task is evaluated for the usage of the running resources after being allocated to it, it can be ensured that each new running task is automatically optimally scheduled, so that the overall running resources of the service cluster are used most efficiently.
[0025] Secondly, the present application utilizes a pre-trained fitting model to realize an effective evaluation of the corresponding fitting occupancy after each service process loads a new running task, rather than simply using a fixed quota for mechanical calculations, thereby utilizing the advantages of machine learning and obtaining a more scientific fitting occupancy to guide the subsequent allocation of new running tasks. It can automatically implement adaptive scheduling of new running tasks in the background, and unify the service cluster, computer equipment in the service cluster, service processes in the computer equipment, and running tasks in the service process based on the comparison of the fitting occupancy of the running resources for scheduling, thereby avoiding manual formulation of relevant scheduling strategies, greatly improving the deployment efficiency of the service cluster and reducing deployment costs.
[0026] In addition, the advantages achieved by the present application make the technical solution of the present application particularly suitable for running resource-intensive, especially CPU-intensive running tasks. For example, in live broadcast services, it is often necessary to perform mixed stream transcoding on multiple audio and video streams, and mixed stream transcoding is a CPU-intensive task. In such scenarios, the application of the technical solution of the present application can obtain more obvious advantages, which is obviously helpful in ensuring the stability and smoothness of live broadcast services. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0028] Figure 1 A schematic diagram of the logical architecture of a service cluster to which the operation resource scheduling method of the present application is applied;
[0029] Figure 2 A flowchart of a typical embodiment of the method for scheduling running resources of the present application;
[0030] Figure 3 This is a flow chart of the fitting model training process in the embodiment of the present application;
[0031] Figure 4 A flowchart of the process of collecting a test set of a fitting model in an embodiment of the present application;
[0032] Figure 5 A schematic diagram of a process for preparing operating characteristic data in an embodiment of the present application;
[0033] Figure 6 This is a schematic diagram of the working process of the fitting model in the embodiment of the present application;
[0034] Figure 7 A schematic diagram of a process of updating a weight vector and a preset step size of a fitting model in an embodiment of the present application;
[0035] Figure 8A schematic diagram of a flow chart of a specific process of updating a preset step length of a fitting model in an embodiment of the present application;
[0036] Fig. 9 A flowchart of a process for scheduling a new running task according to the corresponding fitted occupancy of each service process in an embodiment of the present application;
[0037] Fig.10 This is a principle block diagram of the operation resource scheduling device of the present application;
[0038] Fig.11 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION
[0039] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0040] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0041] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0042] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.
[0043] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.
[0044] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.
[0045] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for access.
[0046] The neural network models referenced or may be referenced in this application, unless expressly specified, can be deployed on a remote server and remotely called on the client, or can be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.
[0047] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as it is suitable for being called by the technical solution of this application.
[0048] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.
[0049] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.
[0050] An operation resource scheduling method of the present application can be programmed as a computer program product and deployed in a service cluster for execution, so that the method can be executed by accessing an interface opened after the computer program product is running and performing human-computer interaction with the computer program product through a graphical user interface.
[0051] See also Figure 1 , the service cluster includes multiple computer devices acting as servers. The service cluster can use the microservice architecture for containerized management to obtain multiple service containers. Each service container is essentially a service process for executing one or more running tasks. Therefore, each service process may concurrently process multiple running tasks. Each of the service processes described generally runs in a computer device. Usually, different service processes process running tasks with the same function, such as the computer task of mixing and transcoding multiple audio and video streams in the exemplary live broadcast scenario in this application. The running task can be regarded as a method function in the computer program at the computer program level. When the corresponding task parameters are provided for it, the running task can perform task processing according to the task parameters. For example, for the mixed flow transcoding task, when the corresponding resolution, bit rate, frame rate and other parameters are provided for it, the running task can be mixed and transcoded according to these. For other application scenarios that are not exemplified, the same is true. Therefore, those skilled in the art should understand that the running tasks all have corresponding task parameters, or running parameters. Different running tasks may have different corresponding running parameters, but the functions performed by each running task are basically the same. Accordingly, the service cluster of the present application performs task scheduling based on running tasks.
[0052] See also Figure 2 In a typical embodiment, the operation resource scheduling method of the present application includes the following steps:
[0053] Step S1100: respond to the creation event of a new running task in the service cluster, and obtain the running characteristic data of each service process including the new running task and its current running task, and the device identification of the computer device where the service process is located:
[0054] When a new running task is submitted to the service cluster, thereby triggering a new running task creation event, in order to implement the scheduling allocation of the new running task, it is necessary to collect the running characteristic data associated with it.
[0055] The operation characteristic data needs to be obtained for each service process in the service cluster, so as to obtain the operation characteristic data corresponding to each service process. In order to obtain the operation characteristic data corresponding to each service process, it is assumed that the new operation task is added to the service process for operation, and the operation characteristic data corresponding to the service process is obtained when the assumption is met. Therefore, each set of operation characteristic data includes both the operation characteristic data of the current operation task currently running in its corresponding service process and the operation characteristic data corresponding to the new operation task. The operation characteristic data represents the data characteristics of each operation task in its corresponding service process. These data characteristics highly likely reflect the difference information between different operation tasks, and can usually be extracted and generated from the task parameters of each operation task.
[0056] In order to establish an association between the operating characteristic data of each service process and the computer device where the service process is located, in addition to obtaining the operating characteristic data of the service process, the device identification corresponding to the computer device is further obtained, thereby establishing an associated correspondence between the service process, the operating characteristic data and the device identification.
[0057] Based on this, it is not difficult to understand that for a new running task, the running characteristic data corresponding to each service process is obtained when the new running task is assigned to each service process for execution, and there is also a corresponding relationship between these running characteristic data and the computer device where the service process is located.
[0058] Step S1200: for the computer device pointed to by each device identifier, a pre-trained to converge fitting model is used to match the weight vector corresponding to the device identifier for the running feature data, and the fitting occupancy of the running resource after each service process loads a new running task is calculated:
[0059] Since the running characteristic data of each service process has been obtained, and each service process is running in a different computer device, this step calculates the fitting occupancy of each service process for the device identifier associated with the running characteristic data.
[0060] The fitted occupancy represents the estimated occupancy of the operating resources of the computer device in which a service process is located, obtained by fitting data based on its given operating characteristic data. The operating resources include but are not limited to resources such as CPU, memory space, and hard disk space. In this application, for the sake of simplicity, only CPU resources are used as an example. When there are multiple resources involved in the calculation, in theory, the data of multiple specific resources can be linearly fused to realize related numerical operations. Those skilled in the art can flexibly implement this.
[0061] The calculation of the fitting occupancy is performed with the aid of a fitting model that has been pre-trained to a convergent state. The fitting model can be constructed and implemented based on traditional machine learning principles or deep learning principles. Subsequent embodiments will reveal its algorithm principles and training process, which will be omitted in this embodiment.
[0062] In summary, the fitting model is trained to be suitable for estimating and calculating the amount of operating resources occupied by a service process in the computer device where the service process is located according to the corresponding operating characteristic data of a service process, as the corresponding fitting occupancy. Since the operating resources, operating system and other hardware and software resources of each computer device may not be the same, the fitting model can use the device identification corresponding to the operating characteristic data as a distinguishing basis to adapt different pre-trained generated weight vectors to different computer devices, and use the weight vector to perform an association operation with the operating characteristic data, and the corresponding fitting occupancy of the computer device pointed to by the device identification is obtained.
[0063] It can be seen from this that for a new running task, it is assumed to be added to each service process of the service cluster, so as to obtain the corresponding running characteristic data of each service process. These running characteristic data are all associated with the device identification of the computer device where the corresponding service process is located. Then, through the fitting model, these running characteristic data are respectively calculated using the weight vectors associated with their corresponding device identifications, and the corresponding fitting occupancy of each service process is obtained, thereby indicating that after the new running task is added to each service process, the corresponding service process may utilize the running resources of the computer device where it is located.
[0064] Step S1300: for each computer device pointed to by the device identifier, the estimated total usage of the computer device's running resources after loading the new running task is calculated according to the corresponding fitted occupancy of each service process therein, and the new running task is assigned to the service process of the computer device with the best estimated total usage for running:
[0065] In order to compare horizontally whether the fitting occupancy of the new running task after being added to each service process is optimal, the corresponding fitting occupancy of each service is further evaluated. First, the estimated total usage of the running resources formed by the computer device where each service process is located after loading the new running task is calculated based on the fitting occupancy. Then, according to a certain strategy, the estimated total usage is selected to allocate the new running task to the service process corresponding to the optimal item for execution.
[0066] The estimated total usage, in this embodiment, for a computer device, can be understood as the load of the running resources corresponding to the running of multiple service processes, that is, it can be understood as the sum of the actual occupancy of the running resources of all the service processes therein. Of course, for the fitted occupancy corresponding to the service process participating in the estimation, the actual occupancy of the service process is not used, but the fitted occupancy of the service process is used to participate in the calculation of the total. Therefore, the calculated sum is the sum of the fitted occupancy of the service process with the fitted occupancy and the actual occupancy of the running resources of other service processes in the computer device where the service process is located. This sum is the estimated total usage, which is used to indicate the total usage of the running resources occupied by all the service processes running in the computer device where the service process is located once the new running task is loaded into a service process.
[0067] Accordingly, for all service processes, the corresponding estimated total usage of the computer device where they are located can be calculated. Even if the same computer device runs multiple service processes, these service processes running on the same computer device will also obtain their corresponding estimated total usage.
[0068] After obtaining the estimated total usage corresponding to each service process, the preset strategy can be used to select the best service process, determine the service process corresponding to the best estimated total usage, and assign the new running task to the service process to run, so as to achieve optimal scheduling according to the estimated total usage. These preset strategies can be flexibly determined by those skilled in the art according to the nature of the estimated total usage and its representation form, and do not affect the embodiment of the creative spirit of this application.
[0069] In an alternative embodiment, the strategy can be pre-designed to directly compare the lowest value of the estimated usage. For example, there are N service processes corresponding to the estimated total usage, and the estimated total usage of one service process is expressed as a percentage of 75%, which means that after the service process loads the new running task, the utilization rate of the running resources (CPU usage) of the computer device where it is located is 75%, which is the lowest value of the corresponding items of all service processes. Based on this, the service process corresponding to the estimated total usage can be directly determined as the service process most suitable for loading the new running task, so that the new running task is scheduled to the service process for processing.
[0070] In another alternative embodiment, the strategy can be pre-designed to first calculate the remaining operating resources of the computer device where the corresponding service process is located based on each of the estimated total usage, and then select the best one based on the remaining amount. This alternative embodiment will be disclosed in detail later and will not be discussed here for the time being.
[0071] At this point, it can be understood that this typical embodiment can adaptively achieve optimal scheduling of new running tasks, so as to allocate new running tasks to a certain service process according to the optimal strategy. According to the above disclosure of this typical embodiment, it can be seen that, compared with the prior art, this application achieves the following positive effects:
[0072] First, when the present application needs to allocate a service process for executing a new running task within a service cluster, it is assumed that the new running task is allocated to each corresponding service process within the service cluster, and then the running characteristic data of these service processes after including the new running task are obtained respectively. In addition to including the running characteristic data of the new running task, the running characteristic data also includes the running characteristic data of the current running task of the service process. At the same time, the device identification of the computer device where the service process is located is obtained, and a mapping relationship between the device identification of the computer device, the service process, and the corresponding running characteristic data is established; then, for the computer device pointed to by each device identification, a fitting model is used to match the running characteristic data with the weight vector corresponding to the device identification, and the fitting occupancy of the running resources after each service process loads the new running task can be calculated; finally, for each computer device in the service cluster, the estimated total usage of the running resources corresponding to all service processes of the corresponding computer device after the new running task is added to each service process is calculated, and then the optimal solution is sought based on the estimated total usage of each service process, and the new running task is allocated to the service process of the computer device with the optimal estimated total usage to run, thereby realizing the scheduling and allocation of the new running task. It can be seen that since each new running task is evaluated for the usage of the running resources after being allocated to it, it can be ensured that each new running task is automatically optimally scheduled, so that the overall running resources of the service cluster are used most efficiently.
[0073] Secondly, the present application utilizes a pre-trained fitting model to realize an effective evaluation of the corresponding fitting occupancy after each service process loads a new running task, rather than simply using a fixed quota for mechanical calculations, thereby utilizing the advantages of machine learning and obtaining a more scientific fitting occupancy to guide the subsequent allocation of new running tasks. It can automatically implement adaptive scheduling of new running tasks in the background, and unify the service cluster, computer equipment in the service cluster, service processes in the computer equipment, and running tasks in the service process based on the comparison of the fitting occupancy of the running resources for scheduling, thereby avoiding manual formulation of relevant scheduling strategies, greatly improving the deployment efficiency of the service cluster and reducing deployment costs.
[0074] In addition, the advantages achieved by the present application make the technical solution of the present application particularly suitable for running resource-intensive, especially CPU-intensive running tasks. For example, in live broadcast services, it is often necessary to perform mixed stream transcoding on multiple audio and video streams, and mixed stream transcoding is a CPU-intensive task. In such scenarios, the application of the technical solution of the present application can obtain more obvious advantages, which is obviously helpful in ensuring the stability and smoothness of live broadcast services.
[0075] The fitting model used in this application needs to be pre-trained to reach a convergence state so as to better serve the calculation of the fitting occupancy. To this end, the operating resource scheduling method of this application further includes a training task for training the fitting model, and adapting to the training task, such as Figure 3 As shown, the operation resource scheduling method of the present application also includes the following steps:
[0076] Step S2100: Obtain a test set corresponding to each service process in the service cluster, the test set including operation characteristic data corresponding to all currently running tasks of the service process, the actual occupation of the operation resources by the service process, and the device identifier of the computer device where the service process is located:
[0077] The test set can be prepared by those skilled in the art so as to be called when performing a training task.
[0078] The test set is essentially a training data set that can be collected from each service process of the service cluster. The test set includes multiple groups of sample data, each of which includes a corresponding operation feature data of all currently running tasks collected from the service process, the actual occupation of the operation resources by the service process, and the device identification of the computer device where the service process is located.
[0079] The composition of the operating characteristic data in the sample data is slightly different from the operating characteristic data required for the fitting model of the present application to calculate the fitting occupancy in the production stage. The latter operating characteristic data is a collection of the operating characteristic data of the current running tasks of the service process and the new running tasks assumed to be added, while the operating characteristic data in the sample data only includes the operating characteristic data corresponding to all the running tasks currently actually running the service process at the time of collection.
[0080] The actual occupancy in the sample data is the performance data of the total amount of operating resources actually occupied by the service process providing the operating characteristic data, which represents how much or how much operating resources the service process needs to consume to process all current operating tasks. The actual occupancy can be used as a supervisory label for the fitting occupancy calculated by the fitting model.
[0081] The device identifier in the sample data is the unique characteristic identifier of the computer device where the corresponding service process is located, such as UUID (device uniqueness), network address, and other computer identification identifiers that are convenient for identification, etc. Those skilled in the art can flexibly select them. The device identifier can be used to distinguish the weight vectors corresponding to different computer devices.
[0082] It can be understood that the operation characteristic data in the test set is usually collected in response to a specific operation task. For different operation tasks, the specific operation parameters are different, resulting in different contents and properties of the operation characteristic data. Accordingly, in an embodiment adapted to the exemplary scenario of the present application, the operation task is a computer task for performing mixed-stream transcoding on multiple video streams, and accordingly, the operation characteristic data also collects various operation parameters related to the computer task of mixed-stream transcoding.
[0083] The test set contains a large amount of the sample data. Theoretically, the more sample data, the better. Those skilled in the art can prepare them flexibly.
[0084] Step S2200: Use the fitting model to perform data fitting on the running feature data matching weight vector in a test set to obtain the fitting occupancy amount of the running resources of the computer device pointed to by the device identifier occupied by the corresponding service process:
[0085] The fitting model is in the training stage at this time. It uses a weight vector to perform weighted summation on each part of the running feature data in the sample data to achieve weight matching. The weight vector is associated with each of the device identifiers one by one and can be randomly initialized and enabled. The value obtained by weighted summation of the weight vector is the fitting occupancy after data fitting corresponding to the group of sample data, which indicates the usage of the running resources of the computer device pointed to by the device identifier occupied by the service process corresponding to the sample data.
[0086] The weight vector may be stored in association with its corresponding device identification, so that the fitting model can call the corresponding weight vector according to the device identification during the production stage.
[0087] Step S2300: updating the weight vector according to the difference gradient between the actual occupancy and the fitted occupancy to promote convergence of the fitting model, and continuing to iterate the training of the fitting model when the fitting model has not converged:
[0088] As mentioned above, the actual occupancy in the sample data can be used as a supervisory label. The purpose of training is to make the fitting occupancy calculated by the fitting model based on the operating characteristic data in the sample data as close as possible to the actual occupancy provided in the sample data. Therefore, the difference between the actual occupancy and the fitting occupancy obtained by fitting the data in the previous step can be used to realize the gradient update of the corresponding weight vector, adaptively adjust each specific weight in the weight vector, so that the updated weight vector can better obtain the fitting occupancy close to the actual occupancy, thereby promoting the convergence of the fitting model.
[0089] When the fitting model has not reached a convergence state, or the difference between the fitting occupancy calculated by the fitting model and the actual occupancy has not converged to a certain extent, the next sample data can be called to continue iterative training of the fitting model until the training goal is achieved.
[0090] In this embodiment, a prepared test set is used to train the fitting model constructed based on the principle of machine learning. When it is trained to convergence, it learns the ability to calculate the corresponding fitting occupancy according to the running characteristic data, and can be put into use for data fitting in this application. Since the fitting model can be implemented using a machine learning algorithm, its implementation difficulty is not high, and the effect achieved is significant, so it is conducive to reducing deployment costs.
[0091] See also Figure 4 In a specific embodiment, the step S2100, obtaining the test set corresponding to each service process in the service cluster, includes the following steps:
[0092] Step S2110: regularly collect the operation characteristic data corresponding to each service process in the service cluster, wherein the operation characteristic data includes the comprehensive characteristic values of all currently running tasks in the service process associated with the pre-selected operation parameters:
[0093] In this embodiment, the fitting model can be trained dynamically to achieve timely update of the weight vector corresponding to each device identifier. To this end, a monitoring mechanism or a timing mechanism is used to regularly collect the operation feature data corresponding to each service process in the service cluster to construct a test set for continuing to train the fitting model.
[0094] In this embodiment, the operation characteristic data is extracted and generated based on the operation parameters of the operation tasks processed by the service process. The technical personnel in this field can optimize the relevant operation parameters of the operation tasks as needed to determine the pre-selected operation parameters for generating the operation characteristic data, and then, abstract all the same pre-selected operation parameters in the same service process into corresponding comprehensive characteristic values, and encapsulate these comprehensive characteristic values into the operation characteristic data.
[0095] The frequency of the scheduled collection can also be flexibly set by those skilled in the art, for example, 5 seconds or 10 seconds, which can be flexibly determined in combination with the busyness of the service cluster.
[0096] Step S2120: Correlate and collect the device identification of the computer device where each service process is located and the actual amount of running resources occupied by each service process in the corresponding computer device:
[0097] In order to construct the corresponding test set, in response to the composition of the sample data in the test set, in addition to obtaining the corresponding operating characteristic data of each service process, it is also necessary to obtain the corresponding actual occupancy associated with the operating characteristic data. As required above, the actual occupancy is the usage of the operating resources occupied by the corresponding service process on the computer device where it is located. This data can be directly read from the interface or data file provided by the operating system of the computer device, which is known to those skilled in the art. Of course, the corresponding device identification of the computer device can also be obtained in the same way.
[0098] Step S2130: construct the operation characteristic data, the actual occupancy, and the device identification corresponding to each service process into a corresponding test set:
[0099] At this point, the sample data corresponding to each service process is obtained, including the operating characteristic data, actual occupancy and device identification. Multiple service processes form multiple sample data. These sample data are added to the test set, and you can refer to other embodiments of the present application to continue training the fitting model.
[0100] This embodiment periodically collects relevant sample data in the test set required for training the fitting model from the service cluster for continued training of the fitting model, thereby achieving long-term evolution of the data fitting capability of the fitting model, allowing the fitting model to cyclically improve its own data fitting accuracy without human intervention, thereby adaptively improving and optimizing the resource scheduling capability of the service cluster.
[0101] See also Figure 5 In a further embodiment, the step S2110, periodically collecting the operation characteristic data corresponding to each service process in the service cluster, comprises the following steps:
[0102] Step S2111: Obtain the pre-selected running parameters of all currently running tasks in each service process:
[0103] The preselected operating parameters, as mentioned above, can be selected by a person skilled in the art. In one embodiment adapted to the exemplary scenario of the present application, the operating task is a computer task for performing mixed stream transcoding on multiple video streams, so the corresponding preselected operating parameters can be operating parameters such as audio and video related bit rate, resolution, frame rate, encoding type, etc.
[0104] Step S2112: extracting basic characteristic values corresponding to each pre-selected operating parameter from the pre-selected operating parameters:
[0105] Generally speaking, it is recommended to use numerical parameters for the pre-selected operating parameters so as to extract the corresponding numerical values therefrom, or convert them into numerical values as basic characteristic values. For example, in the aforementioned mixed stream transcoding scenario, the basic characteristic values include a set consisting of any of the following items: output audio bit rate, input video resolution, input video frame rate, input video bit rate, input video encoding type, output video resolution, output video frame rate, output video bit rate, output video encoding type. It can be seen that these basic characteristic values have corresponding pre-selected operating parameters corresponding to them, and the number of basic characteristic values required to construct the operating characteristic data depends on the pre-selection of operating parameters in the operating task by technical personnel in this field.
[0106] Step S2113: square some of the predetermined basic eigenvalues to obtain corresponding second-order composite eigenvalues:
[0107] To make the fitting more accurate, those skilled in the art may further optimize some basic eigenvalues, perform square operations on these basic eigenvalues, and obtain their corresponding second-order composite eigenvalues. The setting of the second-order composite eigenvalue is essentially to convert a linear fit into a polynomial fit, which can make the fitting more accurate.
[0108] Still taking the mixed stream transcoding scenario as an example, given the basic eigenvalues listed in the previous step, any one or more of the following can be selected to calculate the second-order composite eigenvalue: output video resolution, output video frame rate, output video bit rate, output video encoding type.
[0109] Step S2114: All basic eigenvalues and all second-order composite eigenvalues are adapted to add up all running tasks one by one to obtain the comprehensive eigenvalues corresponding to the service process, and all the comprehensive eigenvalues constitute the running characteristic data:
[0110] Finally, for each service process, all of its currently running tasks, each of which contains corresponding multiple basic eigenvalues and multiple second-order composite eigenvalues. For this, these specific values can be used as dimensions, and the basic eigenvalues or second-order composite eigenvalues of the same dimensions of each running task are summed up to obtain the sum, which is the corresponding comprehensive eigenvalue of the dimension. Accordingly, for the multiple basic eigenvalues and multiple second-order composite eigenvalues, multiple comprehensive eigenvalues are obtained, and the comprehensive eigenvalues constitute the running characteristic data.
[0111] This embodiment exemplarily gives a process of extracting characteristic values from pre-selected operating parameters of an operating task, converting corresponding comprehensive characteristic values, and forming operating characteristic data. During the process, some basic characteristic values are squared to achieve a second-order composite conversion, which can further enhance the data fitting capability of the fitting model.
[0112] See also Figure 6 In a further embodiment, the fitting model performs the following steps:
[0113] Step S3100: Obtain operation characteristic data corresponding to the service process and its corresponding device identification, wherein the operation characteristic data includes a plurality of comprehensive characteristic values:
[0114] The fitting model operates according to its inherent business logic, whether in the training stage or in the production stage for fitting the fitting occupancy required for the new running task. Accordingly, when it enters the working state, it first obtains the running characteristic data corresponding to the service process and its corresponding device identification fed into it.
[0115] It can be understood that when the fitting model is in the training stage, the operation characteristic data is only generated for all current running tasks in its corresponding service process, and when the fitting model is in the production stage, the operation characteristic data includes not only the operation characteristic data of all current running tasks in its corresponding service process, but also the operation characteristic data of the new running tasks that have not been assigned. As for the specific generation process of the operation characteristic data, reference can be made to the disclosure of other embodiments of the present application, that is, the operation characteristic data will be expressed as multiple comprehensive characteristic values, each of which is the same pre-operation parameter extracted for all running tasks in the same service process. This embodiment will not be repeated.
[0116] Step S3200: normalize the comprehensive feature values contained in the operation feature data into a vector representation of a specific space to form a comprehensive feature vector:
[0117] In order to facilitate the calculation of the fitting model, each comprehensive eigenvalue in the running characteristic data is normalized and mapped to a specific numerical space, specifically to [-1,1], so as to achieve vectorization and form a comprehensive feature vector.
[0118] Step S3300: Calculate the weighted sum of each comprehensive feature value in the comprehensive feature vector as the fitting occupancy of the service process according to the weight vector corresponding to the device identifier, wherein the weight vector includes a plurality of corresponding weights corresponding to each comprehensive feature value in the comprehensive feature vector:
[0119] Similar to the comprehensive feature vector, the weight vector is also expressed as a vector, and its corresponding character sets multiple corresponding weights according to the number of elements in the comprehensive feature vector. For a device identifier, when the weight vector is initially enabled, an initialized weight vector can be used, in which each weight can be pre-randomly assigned a random value between 0 and 1. When the corresponding weight vector exists for the device identifier, it can be called accordingly.
[0120] Based on this, each element in the comprehensive feature vector is matched with the weight in the weight vector and added to obtain the weighted sum value, which can be used as the fitting occupancy of the corresponding service process. Of course, this fitting occupancy is not a directly usable value during the training stage of the fitting model, but it can be directly used to implement the scheduling of new running tasks during the production stage of the fitting model.
[0121] Step S3400: updating the weight vector according to the estimated error between the fitted occupancy and the actual occupancy of the service process:
[0122] During the training stage of the fitting model, after the fitting model obtains the corresponding fitting occupancy, it can perform error calculation with the actual occupancy provided by the sample data to obtain the corresponding estimated error. The estimated error can be used to update the corresponding weight vector. Usually, the weight vector is continuously corrected so that the fitting occupancy calculated by the fitting model is closer and closer to the corresponding actual occupancy.
[0123] According to the disclosure of the algorithmic principle of the fitting model in this embodiment, it can be understood that each computer device pointed to by a device identifier has a corresponding weight vector. Under the action of the weight vector, the pre-trained fitting model can calculate the corresponding fitting occupancy for the service process running in the computer device. The fitting occupancy is theoretically infinitely close to the corresponding actual occupancy. Therefore, the fitting model can effectively estimate the actual occupancy after the new running task is added to the service process based on the running feature data including the new running task that has not been run, so that the service cluster can implement task scheduling accordingly.
[0124] This embodiment actually also reveals the machine learning principle of the fitting model, wherein the fitting process of the fitting model to the comprehensive feature vector can be implemented as a linear layer, and the process of encoding the operating feature data into the comprehensive feature vector can theoretically also be implemented based on the deep semantic learning principle and using a neural network model. Therefore, this embodiment provides a variety of solutions for the flexible implementation of the fitting model, which can be used as a reference for implementation by those skilled in the art.
[0125] See also Figure 7 In a specific embodiment, the step S3400, updating the weight vector according to the estimated error between the fitted occupancy and the actual occupancy of the service process, comprises the following steps:
[0126] Step S3410: Calculate the estimated error between the fitted occupancy of the service process and its actual occupancy:
[0127] In the training stage of the fitting model, for the fitting occupancy obtained in the training process of a sample data, the corresponding estimation error can be obtained by directly subtracting the corresponding actual occupancy from the fitting occupancy.
[0128] Step S3420: determine the weight adjustment coefficient according to the product of the preset step length and the estimation error:
[0129] When implementing the training of the fitting model, a preset step size can be matched for the weight vector corresponding to each device identifier. The preset step size can control the adjustment amplitude of the weight vector. During initialization, it can be assigned an empirically appropriate value, such as 0.01.
[0130] After the estimated error is obtained, the weight adjustment coefficient can be determined according to the product of the estimated error and the preset step length.
[0131] Step S3430: Update the weight vector, where each weight of the updated weight vector is the difference between its original weight and the product of its corresponding comprehensive eigenvalue and the weight adjustment coefficient:
[0132] According to: new weight = original weight - (weight adjustment coefficient * comprehensive eigenvalue), each weight in the weight vector is updated. That is, for an element of the weight vector, the original weight stored in the element is subtracted from the product of the weight adjustment coefficient and the comprehensive eigenvalue in the comprehensive eigenvector corresponding to the element, and the difference obtained is used as the new weight stored in the element.
[0133] Step S3440: adjusting the preset step length according to the updated weight vector:
[0134] Although the weight vector has been updated, in order to improve the convergence speed of the fitting model, the value of the preset step size can be further adjusted so that the preset step size is also updated in association with the updated weight vector. Subsequently, under the action of the updated weight vector and the preset step size, in theory, when calculating the fitting occupancy of sample data corresponding to the same device identifier, a result closer to the corresponding actual occupancy can be obtained.
[0135] In this embodiment, by revealing the associated update logic of the weight vector and the preset step size, it can be understood that the weight vector can be dynamically updated according to the fitting occupancy calculated by the fitting model cloud, and the preset step size is also updated accordingly with the weight vector. This mechanism can promote the fitting model to converge faster, reduce training costs, and improve the calculation accuracy of the fitting occupancy.
[0136] See also Figure 8 In a further embodiment, the step S3440, adjusting the preset step size according to the updated weight vector, comprises the following steps:
[0137] Step S3441, recalculate the new fitting occupancy according to the updated weight vector and the comprehensive feature vector:
[0138] In order to realize the calculation of the preset step length, in this embodiment, the optional method of adjusting the preset step length according to the preset value is not adopted, but a cyclic verification mechanism is adopted to obtain a better adjustment effect. Therefore, in this step, the calculation logic of the fitting model on the fitting occupancy can be cyclically called, and the updated weight vector is used to match the corresponding comprehensive feature vector to recalculate the new fitting occupancy.
[0139] Step S3442: recalculate a new estimation error according to the new fitted occupancy and the corresponding actual occupancy:
[0140] Similarly, the new fitted occupancy is subtracted from the actual occupancy originally provided with the sample data to obtain a new estimated error.
[0141] Step S3443: determine whether the variance between the new estimated error and the previously obtained estimated error is greater than 0. If the determination is true, reduce the value of the preset step length:
[0142] The variance between the new estimated error and the original estimated error calculated based on the same sample data is checked to see whether the variance is greater than 0. The square of the new estimated error is compared to see whether it is greater than the square of the old estimated error. When the former is greater than the latter, the preset step size is multiplied by a given proportional factor so that the value of the preset step size is greatly reduced by the proportional factor, for example, reduced to 1 / 10 of the original value, thereby achieving specific adjustment of the preset step size.
[0143] In this embodiment, a cyclic verification mechanism is adopted, and the occupancy is refitted using the updated weight vector. The estimated error is recalculated based on the new fitted occupancy, and then the preset step size is adjusted to reduce it based on the square difference between the two estimated errors. This implements an automated mechanism for dynamically adjusting the preset step size to follow the updated weight vector for correlation. This is different from the mechanism of using a fixed value to adjust the preset step size, and can be more conducive to the rapid convergence of the fitting model.
[0144] See also Fig. 9 In a further embodiment, the step S1300, for each computer device pointed to by the device identifier, calculates the estimated total usage of the computer device running resources after loading the new running task according to the corresponding fitted occupancy of each service process therein, and allocates the new running task to the service process of the computer device with the best estimated total usage for running, including the following steps:
[0145] Step S1310: for each service process running in the computer device pointed to by each device identifier, add the corresponding fitted occupancy to the current actual occupancy of other service processes in the computer device, as the estimated total usage of the running resources of the computer device where each service process is located after loading the new running task:
[0146] Please combine the disclosure of step S1300 in the typical implementation column of the present application, it can be known that when it is desired to assign a new running task to a designated service process of a computer device for execution, according to the disclosure of the various embodiments of the present application, the fitted occupancy of the running resources of the service process after loading the new running task in the computer device can be obtained, and the current actual occupancy of the running resources in the computer device by other service processes in the computer device can also be directly called. Therefore, this fitted occupancy can be taken as the sum of the corresponding current actual occupancy of other service processes, as the estimated total usage of the running resources of the computer device once the new running task is assigned to the designated service process for execution.
[0147] It can be understood that, in theory, for the same computer device, in fact, if the new running task is assigned to each service process in the computer device, different estimated total usage may be obtained. The same is true for assigning the new running task to each service process of other computer devices in the service cluster. Therefore, it is necessary to calculate the estimated total usage corresponding to these different service processes one by one and then compare them.
[0148] Step S1320: Calculate the remaining amount of operating resources of the corresponding computer device according to the estimated total amount of usage:
[0149] Different from the previous embodiment that directly uses the estimated total usage for selection, this embodiment uses another strategy. Specifically, after each service process calculates its corresponding estimated total usage, the total amount of operating resources of the computer device where the service process is located is subtracted from the estimated total usage to obtain how much operating resources the computer device will have left once the corresponding new operating usage is placed after the service process. Therefore, it can also be understood that for the new operating tasks to be allocated to different service processes, even if these service processes are in the same computer device, each corresponding margin can be obtained according to each corresponding pre-selected total usage.
[0150] Step S1330: compare the margins corresponding to the various service processes, determine the service process corresponding to the highest margin as the target service process, and assign the new running task to the target service process for running:
[0151] It is understandable that if a computer device has more running resources left after running a new task, the operation of the computer device will be healthier and more stable. Therefore, by comparing the size of the remaining running resources corresponding to each service process, the service process with the highest remaining resource is selected as the target service process, and then the new running task is assigned to the target service process to complete the scheduling.
[0152] In this embodiment, a scheduling strategy is adopted that prioritizes ensuring that the computer device still has a high margin of operating resources after loading a new running task in its internal service process, so that a target service process with sufficient computer device operating resources is selected for a new running task in the service cluster, thereby ensuring load balancing of the servers in the service cluster, making the operation of each server more stable and efficient, and ensuring that the computer device of each server can respond quickly when executing a task, thereby being more capable of processing resource-intensive tasks.
[0153] See also Fig.10, a running resource scheduling device provided to meet one of the purposes of the present application, comprising: a feature acquisition module 1100, a usage fitting module 1200, and an estimated allocation module 1300, wherein the feature acquisition module 1100 is used to respond to the creation event of a new running task in a service cluster, and obtain the running feature data of each service process including the new running task and its current running task and the device identification of the computer device where the service process is located; the usage fitting module 1200 is used to match the running feature data with the weight vector corresponding to the device identification for the computer device pointed to by each device identification, using a pre-trained to converge fitting model, and calculate the fitting occupancy of the running resources of each service process after loading the new running task; the estimated allocation module 1300 is used to calculate the estimated total usage of the running resources of the computer device after loading the new running task according to the corresponding fitting occupancy of each service process for each computer device pointed to by the device identification, and allocate the new running task to the service process of the computer device with the best estimated total usage for running.
[0154] In a further embodiment, the operation resource scheduling device also includes: a sample acquisition module, which is used to obtain a test set corresponding to each service process in the service cluster, and the test set includes the operation feature data corresponding to all currently running tasks of the service process, the actual occupancy of the operation resources by the service process, and the device identification of the computer device where the service process is located; a training execution module, which is used to use a fitting model to perform data fitting on the operation feature data matching weight vector in a test set to obtain the fitting occupancy of the operation resources of the computer device pointed to by the device identification occupied by the corresponding service process; a propagation update module, which is used to update the weight vector according to the difference gradient between the actual occupancy and the fitted occupancy to promote the convergence of the fitting model, and continue to iteratively train the fitting model when the fitting model has not converged.
[0155] In a specific embodiment, the sample acquisition module includes: a feature collection submodule, which is used to periodically collect operating feature data corresponding to each service process in the service cluster, and the operating feature data includes comprehensive feature values associated with pre-selected operating parameters of all currently running tasks in the service process; an actual occupancy collection submodule, which is used to associate and collect the device identification of the computer device where the each service process is located and the actual occupancy of the operating resources occupied by each service process in the corresponding computer device; a sample construction submodule, which is used to construct the operating feature data, the actual occupancy, and the device identification corresponding to each service process into a corresponding test set.
[0156] In a further embodiment, the feature acquisition submodule includes: a parameter extraction unit, used to obtain pre-selected operating parameters of all currently running tasks in each service process; a feature extraction unit, used to extract basic eigenvalues corresponding to each pre-selected operating parameter from the pre-selected operating parameters; a feature processing unit, used to perform square operations on a predetermined part of the basic eigenvalues to obtain corresponding second-order composite eigenvalues; a feature integration unit, used to adapt all basic eigenvalues and all second-order composite eigenvalues to add all running tasks item by item to obtain the comprehensive eigenvalue corresponding to the service process, and all comprehensive eigenvalues constitute the operating feature data.
[0157] In a preferred embodiment, the running task is a computer task for performing mixed stream transcoding on multiple video streams; the basic eigenvalues include a set consisting of any number of the following: output audio bit rate, input video resolution, input video frame rate, input video bit rate, input video encoding type, output video resolution, output video frame rate, output video bit rate, output video encoding type; the partial basic eigenvalues used to calculate the second-order composite eigenvalue include at least one of the following when the set includes it accordingly: output video resolution, output video frame rate, output video bit rate, output video encoding type.
[0158] In a further embodiment, the fitting model includes: an input preparation module, used to obtain the operation characteristic data corresponding to the service process and its corresponding device identification, the operation characteristic data including multiple comprehensive characteristic values; a feature normalization module, used to normalize the comprehensive characteristic values included in the operation characteristic data into a vector representation of a specific space to form a comprehensive characteristic vector; a fitting calculation module, used to calculate the weighted sum of each comprehensive characteristic value in the comprehensive characteristic vector as the fitting occupancy of the service process according to the weight vector corresponding to the device identification, the weight vector including multiple corresponding weights corresponding to each comprehensive characteristic value in the comprehensive characteristic vector; an error correction module, used to update the weight vector according to the estimated error between the fitting occupancy and the actual occupancy of the service process.
[0159] In a specific embodiment, the error correction module includes: an error estimation submodule, used to obtain the estimated error between the fitted occupancy of the service process and its actual occupancy; a system calculation submodule, used to determine the weight adjustment coefficient based on the product of a preset step size and the estimated error; a weight update submodule, used to update the weight vector, each weight of the updated weight vector is the difference between its original weight and the product of its corresponding comprehensive characteristic value and the weight adjustment coefficient; a step size adjustment submodule, used to adjust the preset step size according to the updated weight vector.
[0160] In a further embodiment, the step size adjustment submodule includes: a fitting recalculation unit, used to recalculate the new fitting occupancy based on the updated weight vector and the comprehensive feature vector; an error recalculation unit, used to recalculate the new estimated error based on the new fitting occupancy and the corresponding actual occupancy; a step size fine-tuning unit, used to determine whether the variance between the new estimated error and the previously obtained estimated error is greater than 0, and when the judgment is established, reduce the value of the preset step size.
[0161] In a further embodiment, the estimated allocation module 1300 includes: a separate estimation sub-module, which is used to add the corresponding fitted occupancy of each service process running in the computer device pointed to by each device identifier to the current actual occupancy of other service processes in the computer device, as the estimated total usage of the operating resources of the computer device where each service process is located after loading the new running task; a ratio calculation sub-module, which is used to calculate the surplus of the operating resources of the corresponding computer device according to the estimated total usage; a comparison and selection sub-module, which is used to compare the surplus corresponding to each service process, determine the service process corresponding to the highest surplus as the target service process, and allocate the new running task to the target service process for running.
[0162] In order to solve the above technical problems, the present application also provides a computer device. Fig.11 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement an operation resource scheduling method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the operation resource scheduling method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0163] In this embodiment, the processor is used to execute Fig. 9The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the operation resource scheduling device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0164] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the operation resource scheduling method of any embodiment of the present application.
[0165] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.
[0166] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0167] To summarize, the present application can utilize the running characteristic data of each service process in the service cluster to automatically update the fitting model, so that the fitting model can be suitable for estimating the fitting occupancy of the new running task after it is loaded, thereby matching a better target service process for the new running task according to the fitting occupancy, and scheduling it to the target service process for execution, thereby achieving the effect of load balancing of the entire service cluster, and is particularly suitable for task scheduling of resource-intensive computer tasks such as mixed stream transcoding.
[0168] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.
[0169] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for scheduling running resources, characterized in that: The steps include: In response to a creation event of a new running task in the service cluster, the running characteristic data of each service process, including the new running task and the current running task, and the device identifier of the computer device where the service process is located are obtained; For the computer devices pointed to by each device identifier, a pre-trained to converge fitting model is used to match the weight vector corresponding to the device identifier for the running feature data, and the fitting occupancy of the running resources after each service process loads a new running task is calculated; For each computer device pointed to by the device identifier, the estimated total usage of the computer device's operating resources after loading the new running task is calculated according to the corresponding fitted occupancy of each service process therein, and the new running task is assigned to the service process of the computer device with the best estimated total usage for running; Also included is the step of training the fitting model: Obtain a test set corresponding to each service process in the service cluster, the test set including operation characteristic data corresponding to all currently running tasks of the service process, the actual occupation of the operation resources by the service process, and the device identification of the computer device where the service process is located; Using the fitting model to perform data fitting on the running feature data matching weight vector in a test set, and obtain the fitting occupancy amount of the running resources of the computer device pointed to by the device identifier occupied by the corresponding service process; The weight vector is updated according to the difference gradient between the actual occupancy and the fitted occupancy to promote the convergence of the fitting model, and the fitting model is continuously iterated for training when the fitting model has not converged.
2. The operation resource scheduling method according to claim 1, characterized in that: Obtain the test set corresponding to each service process in the service cluster, including the following steps: Regularly collect the operation characteristic data corresponding to each service process in the service cluster, wherein the operation characteristic data includes the comprehensive characteristic values of all currently running tasks in the service process associated with the pre-selected operation parameters; Correlation collection of device identifications of the computer devices where the various service processes are located and actual usage of the operating resources of the various service processes on the corresponding computer devices; The operation characteristic data, the actual occupancy, and the device identification corresponding to each service process are constructed into a corresponding test set.
3. The operation resource scheduling method according to claim 2, characterized in that: The periodic collection of running characteristic data corresponding to each service process in the service cluster includes the following steps: Get the pre-selected running parameters of all currently running tasks in each service process; Extracting basic characteristic values corresponding to each preselected operating parameter from the preselected operating parameters; Performing square operations on predetermined parts of the basic eigenvalues to obtain corresponding second-order composite eigenvalues; All basic characteristic values and all second-order composite characteristic values are adapted to be added up item by item for all running tasks to obtain the comprehensive characteristic values corresponding to the service process, and all the comprehensive characteristic values constitute the said running characteristic data.
4. The operation resource scheduling method according to claim 3, characterized in that: The running task is a computer task for performing mixed stream transcoding on multiple video streams; The basic feature values include a set consisting of any of the following items: output audio bit rate, input video resolution, input video frame rate, input video bit rate, input video encoding type, output video resolution, output video frame rate, output video bit rate, output video encoding type; The partial basic eigenvalues used to calculate the second-order composite eigenvalue include at least one of the following when the set includes it accordingly: output video resolution, output video frame rate, output video bit rate, output video encoding type.
5. The operation resource scheduling method according to any one of claims 1 to 4, characterized in that: The fitting model performs the following steps: Acquire operation characteristic data corresponding to the service process and its corresponding device identification, wherein the operation characteristic data includes a plurality of comprehensive characteristic values; Normalizing the comprehensive characteristic values contained in the operation characteristic data into a vector representation in a specific space to form a comprehensive characteristic vector; Calculate the weighted sum of each comprehensive feature value in the comprehensive feature vector as the fitting occupancy of the service process according to the weight vector corresponding to the device identifier, wherein the weight vector includes a plurality of corresponding weights corresponding to each comprehensive feature value in the comprehensive feature vector; The weight vector is updated according to an estimated error between the fitted occupancy and the actual occupancy of the service process.
6. The operation resource scheduling method according to claim 5, characterized in that: Updating the weight vector according to the estimated error between the fitted occupancy and the actual occupancy of the service process comprises the following steps: Obtain the estimated error between the fitted occupancy of the service process and its actual occupancy; Determining a weight adjustment coefficient according to a product of a preset step length and the estimation error; Updating the weight vector, wherein each weight of the updated weight vector is the difference between its original weight and the product of its corresponding comprehensive characteristic value and the weight adjustment coefficient; The preset step size is adjusted according to the updated weight vector.
7. The operation resource scheduling method according to claim 6, characterized in that: Adjusting the preset step size according to the updated weight vector comprises the following steps: recalculating a new fitting occupancy according to the updated weight vector and the comprehensive feature vector; Recalculate a new estimation error according to the new fitted occupancy and the corresponding actual occupancy; It is determined whether the variance between the new estimated error and the previously obtained estimated error is greater than 0. If the determination is established, the value of the preset step size is reduced.
8. The operation resource scheduling method according to any one of claims 1 to 4, characterized in that: For each computer device pointed to by the device identifier, the estimated total usage of the computer device running resources after the new running task is loaded is calculated according to the corresponding fitted occupancy of each service process therein, and the new running task is allocated to the service process of the computer device with the best estimated total usage for running, including the following steps: For each service process running in the computer device pointed to by each device identifier, the corresponding fitted occupancy is added to the current actual occupancy of other service processes in the computer device as the estimated total usage of the running resources of the computer device where each service process is located after loading the new running task; Calculating the remaining amount of operating resources of the corresponding computer device according to the estimated total usage; The margins corresponding to the various service processes are compared, a service process corresponding to the highest margin is determined as a target service process, and the new running task is allocated to the target service process for running.
9. A computer device comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: It stores a computer program implemented by the method according to any one of claims 1 to 8 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.
