Task allocation method and device, computer equipment, readable storage medium and program product
By calculating resource priorities based on the task type and the predicted load conditions of the computing nodes, determining the target computing nodes and adjusting the number of resources, the problem of unbalanced resource allocation in cloud computing is solved, and priority guarantee and resource utilization of delay-sensitive tasks are achieved. rate optimization.
Patent Information
- Application Number
- CN202411127877.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
The existing cloud computing resource allocation algorithm cannot fully consider the task type and the load of the computing node, resulting in unbalanced resource allocation, some nodes are overloaded while other nodes are idle, and it is impossible to efficiently utilize computing resources.
By receiving task operation requests, calculate resource priorities based on task type and predicted load conditions of computing nodes, determine target computing nodes, and dynamically adjust the number of resources to ensure that the requirements of delay-sensitive tasks are prioritized and the overall resource utilization rate optimization.
The task type is used to provide priority guarantee for the needs of delay-sensitive applications, and at the same time, the resource utilization rate of the overall system is optimized, node overload and resource idleness are avoided, and efficient utilization of computing resources is improved.
Smart Images

Figure CN119127419A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a task allocation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid development of Internet technology, cloud computing has become an important pillar of modern information technology. Cloud computing platforms use virtualization technology to abstract physical computing resources (such as CPU, memory, storage, and network bandwidth) into a series of virtual resources to provide users with elastic, on-demand computing services. However, with the diversification of cloud computing applications and the continuous increase in user demand, how to efficiently allocate computing resources has become a key challenge.
[0003] At present, in the process of allocating computing resources to applications, there is often an imbalance in resource allocation. For example, existing resource allocation algorithms, such as simple polling or least-connection methods, cannot fully consider the needs of different task types and the load of computing nodes, which can easily lead to overload of some nodes and idle resources of other nodes, resulting in inefficient use of computing resources. Summary of the invention
[0004] Based on this, it is necessary to provide a task allocation method, apparatus, computer equipment, computer-readable storage medium and computer program product that can efficiently utilize computing resources in order to address the above technical problems.
[0005] In a first aspect, the present application provides a task allocation method, comprising:
[0006] Receive a running request for a task to be executed; the running request carries a task type;
[0007] Determine the target computing node for each of the tasks to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated based on the predicted load of each computing node;
[0008] Allocate the task to be executed to the target computing node.
[0009] In one embodiment, the calculation process of resource priority includes:
[0010] Obtain real-time load data of each computing node;
[0011] According to the real-time load data, predict the load condition of each computing node in the next time period to obtain the predicted load condition;
[0012] The resource priority is obtained by sorting according to the predicted load conditions.
[0013] In one embodiment, the load condition of each computing node in the next time period is predicted based on the real-time load data, and the predicted load condition is obtained by a pre-trained load prediction model; the training process of the load prediction model includes:
[0014] Acquire historical load data; the historical load data carries a load tag;
[0015] Inputting the historical load data into the initial model for training to obtain the initial load condition;
[0016] A target loss function is obtained based on the initial load condition and the load label, and the parameters of the initial model are adjusted according to the target loss function until the training is completed to obtain the load prediction model.
[0017] In one embodiment, determining the target computing node for each of the tasks to be executed based on the task type and the resource priority of each computing node includes:
[0018] If the task type is delay-sensitive, the computing node with the first resource priority is used as the initial node;
[0019] If the delay threshold of the initial node meets the preset requirement, the initial node is used as the target node;
[0020] If the delay threshold of the initial node does not meet the preset requirement, it is determined whether the next computing node meets the preset requirement in the order of the resource priority until the target node is obtained.
[0021] In one embodiment, the method further comprises:
[0022] According to the predicted load condition, the quantity of resources of each computing node is adjusted.
[0023] In one embodiment, adjusting the quantity of resources of each computing node according to the predicted load condition includes:
[0024] Get the resource quantity adjustment range;
[0025] Calculating resource changes according to the predicted load condition and the real-time load data;
[0026] Compare the resource change amount with the real-time load data to obtain a resource adjustment ratio;
[0027] Obtaining a resource adjustment amount for each computing node according to the resource adjustment ratio and the resource quantity adjustment range;
[0028] The resource quantity of each computing node is adjusted according to the resource adjustment amount.
[0029] In a second aspect, the present application further provides a task allocation device, the device comprising:
[0030] A receiving module, used to receive a running request for a task to be executed; the running request carries a task type;
[0031] A node determination module, used to determine the target computing node of each of the tasks to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated according to the predicted load of each of the computing nodes;
[0032] The allocation module is used to allocate the task to be executed to the target computing node.
[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0034] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0035] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0036] The above-mentioned task allocation method, apparatus, computer equipment, computer-readable storage medium and computer program product determine the target computing node for each task to be executed based on the task type and the resource priority of each computing node, wherein the resource priority is calculated according to the predicted load situation. In this way, by combining load trend prediction and resource priority, it is ensured that the needs of delay-sensitive applications of the task type are given priority, while optimizing the resource utilization of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 An application environment diagram of a task allocation method in one embodiment;
[0039] Figure 2 A flowchart of a task allocation method in one embodiment;
[0040] Figure 3 is a schematic diagram of the cloud platform structure in one embodiment;
[0041] Figure 4 is a structural block diagram of a task allocation device in one embodiment;
[0042] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The task allocation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the computing node 102 communicates with the cloud platform 104 through the network. The data storage system can store the data that the cloud platform 104 needs to process. The data storage system can be integrated on the cloud platform 104, or it can be placed on the cloud or other network servers. The cloud platform 104 receives a running request for a task to be executed, wherein the running request carries the task type. The cloud platform 104 determines the target computing node for each task to be executed from each computing node 102 based on the task nature and the resource priority of each computing node 102, and finally assigns the task to be executed to the target node. Among them, the cloud platform 104 and the computing nodes can be independent physical servers, or they can be a server cluster or distributed system composed of multiple physical servers, or they can be cloud servers that provide cloud computing services.
[0045] In an exemplary embodiment, Figure 2 As shown, a task allocation method is provided, which is applied to Figure 1 Taking the cloud platform 104 in FIG. 1 as an example, the method includes the following steps S202 to S206. Among them:
[0046] Step S202, receiving a running request for a task to be executed; the running request carries the task type.
[0047] The task to be executed is a software program or task that is about to be started or run, and may be a task, application program or service that has been defined but not yet executed.
[0048] Among them, the task type refers to the category or nature of the task, and different task types have different execution requirements, priorities, and processing methods. Optionally, the task type can be classified according to multiple dimensions based on actual application scenarios, such as time sensitivity, computational complexity, and resource requirements.
[0049] Exemplarily, the task type of the task to be executed may be delay-sensitive. This type of task to be executed has strict requirements on execution time and response time and requires rapid response and processing. Any delay will affect the effect of the task.
[0050] Furthermore, in cloud computing scenarios, there are various users, and different users have different needs. For example, in online games, the player's operation needs to be reflected in the game immediately, and any delay will affect the smoothness of the game and the player's experience, so this type of task is time-sensitive. For example, batch processing tasks, these tasks usually involve the processing of a large amount of data, but can be run in the background, and there is no strict requirement for real-time performance, so this type of task is not time-sensitive.
[0051] In other embodiments, time-sensitive tasks may also include video conferencing, real-time monitoring, financial transactions, emergency alarms, autonomous driving, virtual display and enhanced display, etc.; non-time-sensitive tasks may also include data backup and archiving, software updates and patch applications, data migration and conversion, and background computing and analysis.
[0052] Optionally, an interface or endpoint for receiving requests may be created in advance on the cloud platform to receive tasks to be executed. This interface may be an HTTP endpoint.
[0053] Optionally, after receiving the running request, the cloud platform parses the running request and extracts the task type from the received running request.
[0054] Step S204, based on the task type and the resource priority of each computing node, determine the target computing node for each task to be executed; the resource priority is calculated according to the predicted load of each computing node.
[0055] In this embodiment, the resource priority of each computing node is calculated according to the predicted load of each computing node, and each computing node is sorted according to the resource priority of the computing node.
[0056] Optionally, when the task type of the task to be executed is time-sensitive, the priority of the task to be executed is higher than that of other tasks to be executed, and then the computing node with the highest resource priority is used as the target computing node of the current task to be executed.
[0057] In this way, it can be ensured that each task to be executed is evenly distributed on each node, avoiding overloading of some nodes.
[0058] Optionally, if the cloud platform receives multiple running requests for the same tasks to be executed at the same time, the multiple tasks to be executed will be sorted according to the task type to obtain a queue of tasks to be executed.
[0059] Furthermore, the time-sensitive tasks are arranged ahead of the non-time-sensitive tasks to obtain a queue of tasks to be executed.
[0060] Optionally, if the cloud platform receives multiple tasks to be executed at the same time and all of them are time-sensitive tasks, the estimated running time of each task to be executed on different computing nodes is estimated and sorted in ascending order according to the estimated running time, which can reduce the total waiting time and response time.
[0061] Optionally, each task to be executed also carries a completion time. The cloud platform can estimate the completion time of each task to be executed on each computing node, and sort the tasks by combining the completion time of each task to be executed on each computing node with the completion time of the tasks to be executed.
[0062] In this way, by calculating the gap between the estimated completion time and the required completion time of the task, those tasks that are closer to the completion time can be prioritized to ensure that each task to be executed can be completed on time and avoid overtime.
[0063] One thing that needs to be explained is that the duration of the same task to be executed on each computing node is different, because the resources, current load and performance of each node are different.
[0064] Optionally, on the basis of obtaining the to-be-executed task queue, each to-be-executed task in the to-be-executed task queue is sequentially allocated to a corresponding target node for execution.
[0065] Furthermore, each time a task to be executed is assigned to a target node, the queue of tasks to be executed will be reordered. This is because one of the computing nodes is occupied by the task to be executed, and the subsequent tasks to be executed that are not assigned to the target computing node are sorted by the completion time on each computing node. Therefore, when a computing node is occupied by the task to be executed, the load of the computing node will change, and the remaining load may not be enough to support the running of the next task to be executed. The completion time of the subsequent tasks to be executed that are not assigned to the target computing node on the remaining computing nodes will change. Therefore, the resource priority of each computing node will be reordered and the calculation and reordering of the queue of tasks to be executed will be performed according to the method in the above embodiment.
[0066] Step S206: Allocate the task to be executed to the target computing node.
[0067] In step S204, a target computing node is allocated for the task to be executed, the task to be executed is allocated to the target computing node, and the load information of each computing node is updated.
[0068] In the above task allocation method, the target computing node for each task to be executed by each application to be executed is determined based on the task type and the resource priority of each computing node, wherein the resource priority is calculated based on the predicted load conditions. In this way, by combining load trend prediction and resource priority, it is ensured that the needs of delay-sensitive applications are given priority, while optimizing the resource utilization of the overall system.
[0069] In one of the embodiments, the calculation process according to resource priority includes: obtaining real-time load data of each computing node; predicting the load conditions of each computing node in the next time period based on the real-time load data to obtain predicted load conditions; and sorting according to the predicted load conditions to obtain resource priority.
[0070] Optionally, the real-time load data of each computing node may be synchronized to the cloud platform through a synchronization mechanism.
[0071] Exemplarily, each computing node needs to implement a data collection function, be able to collect information such as CPU usage, memory usage, I / O load, etc. as load data, and synchronize the collected load data to the cloud platform via the network.
[0072] After the cloud platform receives the real-time load data, it processes and analyzes the data based on the real-time load data to predict the load of each computing node in the next time. The load data of each computing node in the next time can be obtained by a pre-trained load prediction model. The training process of the load prediction model will be described in detail later.
[0073] After the predicted load situation is obtained, the load change of each computing node is calculated according to the real-time load data and the predicted load data, and the computing nodes are sorted according to the load change.
[0074] For example, the real-time load data received is as follows:
[0075] Load data of location P1 in the last minute: 60%;
[0076] Load data of location P2 in the last minute: 40%;
[0077] Load data of location P3 in the last minute: 50%;
[0078] The locations P1, P2, and P3 represent different computing nodes.
[0079] The predicted load data for the next time period is:
[0080] The load forecast for location P1 is 65%;
[0081] The load forecast for location P2 is 45%;
[0082] The load forecast for location P3 is 55%;
[0083] The default load increase trend is P2 > P3 > P1, and the resource priority is P2 > P3 > P1.
[0084] For example, a delay-sensitive application request arrives and a node needs to be selected from P1-P3 for task scheduling. The request is assigned to location P2 because it has the lowest predicted load and also meets the requirements of the delay-sensitive application.
[0085] In this way, by real-time monitoring of the load data of each computing node, combined with load prediction and resource change calculation, the resource priority of each node can be dynamically determined. In this way, when scheduling tasks, those nodes with smaller resource changes can be given priority, thereby optimizing resource utilization and ensuring efficient and stable operation of the system.
[0086] Optionally, the cloud platform includes a dynamic load balancing module, which is used to execute the steps in the above-mentioned calculation process based on resource priority.
[0087] Among them, according to the real-time load data, the load conditions of each computing node in the next time period are predicted, and the predicted load conditions are obtained through a pre-trained load prediction model; the training process of the load prediction model includes: obtaining historical load data; historical load data carries load labels; inputting historical load data into the initial model for training to obtain initial load conditions; based on the initial load conditions and load labels, the target loss function is obtained, and the parameters of the initial model are adjusted according to the target loss function until the training is completed to obtain the load prediction model.
[0088] Among them, the dynamic load balancing module collects historical load data. The exemplary dynamic load balancing module regularly collects real-time load data of each computing node and delay threshold. The load data of the past hour is persistently saved in the historical load data record for subsequent training and analysis of the prediction model.
[0089] Afterwards, the historical load data is sorted and used as sample data for the training model. The historical load data is sorted in time series to construct a training data set. Each sample contains load data within a period of time as a feature, and the load data of the next time period is used as the target value. Model selection and training: Select a linear regression model and use the training data set to train the model. Model evaluation: Use the test data set to evaluate the trained model to measure its prediction accuracy and performance. Optionally, the historical load data is input into the initial model for training. The initial model can be any one of a simple linear regression, a time series model (such as ARIMA, LSTM) or a complex deep learning model (such as RNN, GRU), which is not specifically limited in this embodiment. According to the target loss function, the parameters of the initial model are adjusted by an optimization algorithm, such as gradient descent, to reduce the value of the loss function. After the loss function converges or reaches a preset number of training rounds, stop training to obtain the final load prediction model.
[0090] For example, in one embodiment, a linear regression model is used as an initial model, and the linear regression model is used to train historical load data, wherein the specific training process is:
[0091] S302, collect training sample data. The training samples are as follows:
[0092] Location P1: Load condition is 70%, and the number of calculations is 10;
[0093] Location P2: Load condition is 40%, and the number of calculations is 10;
[0094] Location P3: Load condition is 50%, and the number of calculations is 10;
[0095] In this embodiment, the locations P1, P2, and P3 represent different computing nodes; the computing quantity is the resource quantity of each computing node.
[0096] S304, preprocessing the sample data.
[0097] The collected training sample data is preprocessed. In this example, the data has been cleaned and reasonably scaled. Cleaning and scaling are conventional technical means in the art and will not be described in detail here.
[0098] S306, split the data set: divide the preprocessed training sample data set into a training set and a test set, with 80% of the data as the training set and 20% of the data as the test set.
[0099] S308, model training: Use the characteristics (load conditions) and target values (number of computing nodes) of the training set to train the linear regression model. The model will estimate and optimize parameters based on the load conditions of the training samples and the corresponding number of computing nodes to fit the best linear relationship.
[0100] In the above embodiment, a load prediction model is trained to predict the future load conditions of each computing node, thereby helping the cloud platform to perform resource allocation and task scheduling.
[0101] Furthermore, in one of the embodiments, the target computing node for each task to be executed is determined based on the task type and the resource priority of each computing node, including: if the task type is delay-sensitive, the computing node with the first resource priority is used as the initial node; if the delay threshold of the initial node meets the preset requirements, the initial node is used as the target node; if the delay threshold of the initial node does not meet the preset requirements, it is determined whether the next computing node meets the preset requirements in the order of resource priority until the target node is obtained.
[0102] Exemplarily, in combination with the example in the above embodiment, the resource priority is P2 > P3 > P1. If the task type is delay-sensitive, the current task to be executed takes precedence over other tasks to be executed, that is, the target node is allocated to the task type that is delay-sensitive.
[0103] Among them, in the process of allocating target nodes, the computing node with the first resource priority is first used as the initial node, that is, P2, and then it is determined whether the delay threshold of P2 meets the preset requirements. If it does, P2 is used as the target node. Otherwise, it is judged in the order of resource priority, that is, it is determined in turn whether the delay thresholds of P3 and P1 meet the preset requirements until the target node is obtained.
[0104] In this way, according to resource priority, the computing nodes with the best resource utilization are selected first to improve resource utilization, and through delay threshold judgment, it is ensured that delay-sensitive tasks can be completed within the preset delay range.
[0105] Optionally, if the task type is non-delay sensitive, since non-delay sensitive tasks do not have high requirements on delay, when allocating target resources for delay sensitive tasks, tasks are allocated in reverse order of resource priority, for example, P1 is given priority. In this way, each computing node can work efficiently and improve resource utilization.
[0106] In one of the embodiments, the method further includes: adjusting the quantity of resources of each computing node according to the predicted load condition.
[0107] In this embodiment, based on the predicted load situation, the load change trend of each computing node is identified to determine whether the load is increasing or decreasing. If it is predicted that the load of a computing node will increase, the number of resources of the node can be increased. For example, the number of CPU cores, memory size, or I / O bandwidth can be increased; if it is predicted that the load of a computing node will decrease, the number of resources of the node can be reduced to release the excess resources to other computing nodes in need.
[0108] Optionally, the cloud platform also includes an elastic scaling module. Specifically, when the elastic scaling module receives the prediction result of the dynamic load balancing module and obtains a load increasing trend, the elastic scaling module increases the number of resources of each computing node. When the elastic scaling module receives the prediction result of the dynamic load balancing module and obtains a load decreasing trend, the elastic scaling module reduces the number of resources of each computing node.
[0109] For example, computing nodes are deployed in different geographical locations. Preset locations P1-3, 10 computing nodes are deployed in each location, totaling 30 computing nodes. The node at location P1 is closest to the user, and the node at location P3 is farthest away. A communication network is built to enable each computing node to communicate and collaborate with each other, monitor the load status and response time indicators of the nodes, obtain the real-time status information of the nodes, and set the delay thresholds of nodes at different locations according to the delay sensitivity requirements. When the dynamic load balancing module predicts the load trend to be P 1 > P 3 > P2, the elastic expansion module selects a location with lower load according to the load situation and increases the number of resources at that location. In this case, choose to increase P 2 The number of resources.
[0110] In the above real-time, when the load forecast trend is increasing, the number of resources at the location with lower load is increased; when the load forecast trend is decreasing, the elastic shrinking module will automatically reduce the number of resources at the location with lower load (such as P1 or P3).
[0111] Furthermore, in one of the embodiments, the quantity of resources of each computing node is adjusted according to the predicted load conditions, including: obtaining a resource quantity adjustment range; calculating a resource change amount according to the predicted load conditions and real-time load data; comparing the resource change amount with the real-time load data to obtain a resource adjustment ratio; obtaining a resource adjustment amount of each computing node according to the resource adjustment ratio and the resource quantity adjustment range; and adjusting the resource quantity of each computing node according to the resource adjustment amount.
[0112] The resource quantity adjustment range refers to the quantity of resources that can be increased or decreased on a computing node.
[0113] Specifically, first obtain the resource quantity adjustment range, and calculate the resource change amount of each computing node according to the predicted load situation and the real-time load data. Among them, resource change amount = predicted load − real-time load. Then, compare the resource change amount with the real-time load data to obtain the resource adjustment ratio, that is, the resource adjustment ratio is the ratio of the resource change amount to the real-time load. After obtaining the resource adjustment ratio, multiply the resource adjustment ratio by the resource adjustment range to obtain the resource adjustment amount. Finally, increase or decrease each computing node according to the calculated resource quantity. Exemplarily, in one embodiment, the resource adjustment range is 5 to 15 units. When the load prediction trend requires an increase in the number of computing nodes, the resource adjustment amount is determined according to the method described in the above embodiment, and the resource adjustment amount is increased based on the current number of computing nodes. On the contrary, when the load prediction trend requires a decrease in the number of computing nodes, the resource adjustment amount can be gradually increased based on the current number of computing nodes.
[0114] In the above embodiment, by obtaining the resource quantity adjustment range, calculating the resource change amount, obtaining the resource adjustment ratio, and then calculating the resource adjustment amount according to the adjustment ratio, and finally adjusting the resource quantity of each computing node, dynamic resource management can be effectively implemented to improve resource utilization and system performance.
[0115] In an exemplary embodiment, a task allocation method is proposed, combining Figure 3 , Figure 3 The figure is a schematic diagram of the cloud platform structure in an embodiment. It includes a computing resource pool module, a data set definition module, a dynamic load balancing module, and an elastic expansion and contraction module. By adopting distributed storage and data synchronization mechanisms, the management of data sets is simplified, the complexity of data set management is reduced, and accurate coordination and synchronization work is achieved; dynamic load balancing is introduced, resource priority adjustment: according to the application type and priority requirements, the resource allocation ratio of different nodes is adjusted, and dynamic resource scheduling: according to the real-time load situation and priority requirements, the allocation and use of resources are dynamically adjusted to reduce system dependency problems and ensure the smooth progress of scheduling tasks; combined with the elastic expansion and contraction mechanism, the load situation is monitored: the load situation of the node is monitored in real time, and the appropriate resources can be selected for scheduling more accurately, and the distributed computing resources of the computing resource pool module are used for task scheduling.
[0116] Among them, the computing resource pool module is connected with the dynamic load balancing module, the elastic expansion and contraction module, and the data set definition module to establish a regional distributed computing resource pool: by deploying computing nodes in different geographical locations, the requirements of latency-sensitive application scenarios for response time and computing resource distance are met, and the best distributed computing resources are selected in real time for task scheduling according to application requirements and node load conditions. Among them, the dynamic load balancing module is connected with the computing resource pool module and the data set definition module to combine real-time monitoring data and prediction models, and adopt dynamic load balancing strategies to balance the computing resource allocation of different application scenarios, and adjust resource priorities according to the computing power demand level and application type to ensure that high-priority latency-sensitive applications can get sufficient resource support.
[0117] Among them, the elastic expansion and contraction module is connected with the dynamic load balancing module and the computing resource pool module, and is used to adopt the elastic expansion and contraction mechanism in non-delay-sensitive application scenarios, automatically increase or decrease the number of computing nodes according to the current load conditions, and perform dynamic resource scheduling to adapt to changes in different workloads;
[0118] Among them, the data set definition module is connected with the dynamic load balancing module and the computing resource pool module to adopt distributed storage and data synchronization mechanism to simplify data set management.
[0119] Furthermore, the data definition module establishes a centralized data management platform using cloud storage services for users to upload and manage data sets;
[0120] The data definition module manages the data of the dynamic load balancing module and the computing resource pool module. The data set presets the metadata information of the data set. The preset image data is recorded as A, the data format is JPEG, and the data structure is a picture file; the text data is recorded as B, the data format is CSV, and the data structure is in table form;
[0121] Use version control for each data set to record historical changes to the data set. For data set A, the platform records creation, update, and deletion operations, and provides rollback and recovery functions.
[0122] The dataset metadata is recorded in a centralized data management platform, recording the metadata information of each dataset, such as name, size, and format.
[0123] Optionally, use Hadoop Distributed File System (HDFS) as the distributed storage system; Storage unit division: divide the storage system into three storage units, namely virtual volume A, partition B and object storage bucket C; Data synchronization mechanism, data synchronization method between sub-center and scheduling platform: use real-time synchronization method to maintain real-time synchronization update of data sets between sub-center and scheduling platform.
[0124] Optionally, select Amazon S3 as a centralized data management platform for data set upload and management. Users upload data sets to Amazon S3 through the interface or API, and rename, delete, and retrieve data sets on the platform.
[0125] For example, users use HDFS to store image dataset A and text dataset B in the branch center. These data will be synchronized to the Amazon S3 centralized data management platform of the scheduling platform through a real-time synchronization mechanism. Users can upload, rename, delete and retrieve datasets through the interface or API, and can perform version control on datasets A and B, record and track each change operation, and metadata information (name, size, format) will also be recorded in the centralized data management platform to facilitate users to query and retrieve the required datasets.
[0126] Exemplarily, the data collection and analysis in the dynamic load balancing module is to collect the real-time load data of the computing nodes of the computing resource module, and perform data analysis in combination with the prediction model to predict the load trend. It is preset that the load data of the past hour is used to use a linear regression model to predict the load situation of the next hour. Specifically, the process of the dynamic load balancing module performing prediction can refer to the steps in the above embodiment.
[0127] Exemplarily, the resource priority adjustment in the dynamic load balancing module adjusts the resource allocation ratio of different computing nodes according to the application type and priority requirements; the delay-sensitive resource priority adjustment adjusts the resource priority according to the delay requirements of the node distance from the user and the load of the node in the computing power resource pool module. The specific process can be referred to the records in the above embodiment, and will not be repeated here.
[0128] Exemplarily, the elastic expansion module receives the current load status of the dynamic load balancing module and compares it with the preset delay threshold in the computing resource pool module for dynamic resource scheduling and automatically increases or decreases the number of computing nodes. The specific process can be referred to the records in the above embodiment and will not be repeated here.
[0129] In the above embodiment, a centralized data management platform is established to use cloud storage services for user uploads and cooperate with the computing power resource pool module and the dynamic load balancing module to perform data set management to simplify data set management and reduce the complexity of data set management. The prediction model in the dynamic load balancing module is used to perform data analysis to obtain load trend predictions and dynamically adjust the allocation of computing power resources in combination with resource priorities, thereby reducing system dependency issues and ensuring the smooth scheduling of tasks. The load increase and decrease trend judgment in the elastic scaling module is used to provide the computing power resource pool module with the best distributed computing power resources for task scheduling support. It can more accurately select appropriate resources for scheduling and improve the accuracy and efficiency of the scheduling algorithm. The present invention has great market promotion value.
[0130] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0131] Based on the same inventive concept, the embodiment of the present application also provides a task allocation device for implementing the task allocation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more task allocation device embodiments provided below can refer to the limitations on the task allocation method above, and will not be repeated here.
[0132] In an exemplary embodiment, Figure 4 As shown, a task allocation device is provided, including: a receiving module 410, a node determination module 420 and an allocation module 430, wherein:
[0133] Receiving module 410, for receiving a running request for a task to be executed; the running request carries the task type.
[0134] The node determination module 420 is used to determine the target computing node for each task to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated based on the predicted load of each computing node.
[0135] The allocation module 430 is used to allocate the tasks to be executed to the target computing nodes.
[0136] In one of the embodiments, the above module further includes a priority calculation module, and the priority calculation module is used to calculate the resource priority of each computing node.
[0137] In one embodiment, the priority calculation module includes:
[0138] The load acquisition unit is used to obtain the real-time load data of each computing node.
[0139] The load prediction unit is used to predict the load conditions of each computing node in the next time period according to the real-time load data to obtain the predicted load conditions.
[0140] The sorting unit is used to sort the computing nodes according to the predicted load conditions to obtain resource priorities.
[0141] In one embodiment, the load prediction unit includes:
[0142] The sample acquisition subunit is used to acquire historical load data; the historical load data carries a load tag.
[0143] The training subunit is used to input historical load data into the initial model for training to obtain the initial load conditions.
[0144] The adjustment subunit is used to obtain the target loss function based on the initial load situation and the load label, and adjust the parameters of the initial model according to the target loss function until the training is completed to obtain the load prediction model.
[0145] In one embodiment, the node determination unit includes:
[0146] The first allocation subunit is used to use the computing node with the first resource priority as the initial node if the task type is delay-sensitive.
[0147] The second allocation subunit is used to use the initial node as the target node if the delay threshold of the initial node meets the preset requirement.
[0148] The third allocation subunit is used to determine whether the next computing node meets the preset requirements according to the order of resource priority if the delay threshold of the initial node does not meet the preset requirements until the target node is obtained.
[0149] In one embodiment, the above device further comprises:
[0150] The resource adjustment module is used to adjust the resource quantity of each computing node according to the predicted load situation.
[0151] In one embodiment, the resource adjustment module includes:
[0152] The range acquisition subunit is used to obtain the resource quantity adjustment range.
[0153] The variation calculation subunit is used to calculate the resource variation according to the predicted load condition and the real-time load data.
[0154] The ratio calculation subunit is used to compare the resource change amount with the real-time load data to obtain the resource adjustment ratio.
[0155] The adjustment subunit is used to adjust the resource quantity of each computing node according to the resource adjustment amount.
[0156] Each module in the above task allocation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0157] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store historical load data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task allocation method is implemented.
[0158] Those skilled in the art will understand that Figure 5 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.
[0159] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: receiving a request for executing a task to be executed; the request for executing the task carries the task type; determining a target computing node for each task to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated based on the predicted load of each computing node; and allocating the task to be executed to the target computing node.
[0160] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining real-time load data of each computing node; predicting the load conditions of each computing node in the next time period based on the real-time load data to obtain predicted load conditions; and sorting the computing nodes according to the predicted load conditions to obtain resource priorities.
[0161] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining historical load data; the historical load data carries a load label; inputting the historical load data into the initial model for training to obtain an initial load condition; obtaining a target loss function based on the initial load condition and the load label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a load prediction model.
[0162] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the task type is delay-sensitive, the computing node with the first resource priority is used as the initial node; if the delay threshold of the initial node meets the preset requirements, the initial node is used as the target node; if the delay threshold of the initial node does not meet the preset requirements, it is determined whether the next computing node meets the preset requirements in the order of resource priority until the target node is obtained.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: adjusting the quantity of resources of each computing node according to the predicted load condition.
[0164] In one embodiment, the processor also implements the following steps when executing the computer program: obtaining a resource quantity adjustment range; calculating a resource change amount based on predicted load conditions and real-time load data; comparing the resource change amount with the real-time load data to obtain a resource adjustment ratio; obtaining a resource adjustment amount for each computing node based on the resource adjustment ratio and the resource quantity adjustment range; and adjusting the resource quantity of each computing node based on the resource adjustment amount.
[0165] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: receiving a request for executing a task to be executed; the request for executing the task carries the task type; based on the task type and the resource priority of each computing node, determining the target computing node for each task to be executed; the resource priority is calculated based on the predicted load of each computing node; and allocating the task to be executed to the target computing node.
[0166] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining real-time load data of each computing node; predicting the load conditions of each computing node in the next time period based on the real-time load data to obtain predicted load conditions; and sorting the computing nodes according to the predicted load conditions to obtain resource priorities.
[0167] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining historical load data; the historical load data carries a load label; inputting the historical load data into the initial model for training to obtain an initial load condition; obtaining a target loss function based on the initial load condition and the load label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a load prediction model.
[0168] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the task type is delay-sensitive, the computing node with the first resource priority is used as the initial node; if the delay threshold of the initial node meets the preset requirements, the initial node is used as the target node; if the delay threshold of the initial node does not meet the preset requirements, it is determined whether the next computing node meets the preset requirements in the order of resource priority until the target node is obtained.
[0169] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: adjusting the quantity of resources of each computing node according to the predicted load condition.
[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a resource quantity adjustment range; calculating a resource change amount based on predicted load conditions and real-time load data; comparing the resource change amount with the real-time load data to obtain a resource adjustment ratio; obtaining a resource adjustment amount for each computing node based on the resource adjustment ratio and the resource quantity adjustment range; and adjusting the resource quantity of each computing node based on the resource adjustment amount.
[0171] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: receiving a request to run a task to be executed; the request to run carries the task type; determining a target computing node for each task to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated based on the predicted load of each computing node; and allocating the task to be executed to the target computing node.
[0172] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining real-time load data of each computing node; predicting the load conditions of each computing node in the next time period based on the real-time load data to obtain predicted load conditions; and sorting the computing nodes according to the predicted load conditions to obtain resource priorities.
[0173] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining historical load data; the historical load data carries a load label; inputting the historical load data into the initial model for training to obtain an initial load condition; obtaining a target loss function based on the initial load condition and the load label, and adjusting the parameters of the initial model according to the target loss function until the training is completed to obtain a load prediction model.
[0174] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the task type is delay-sensitive, the computing node with the first resource priority is used as the initial node; if the delay threshold of the initial node meets the preset requirements, the initial node is used as the target node; if the delay threshold of the initial node does not meet the preset requirements, it is determined whether the next computing node meets the preset requirements in the order of resource priority until the target node is obtained.
[0175] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: adjusting the quantity of resources of each computing node according to the predicted load condition.
[0176] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a resource quantity adjustment range; calculating a resource change amount based on predicted load conditions and real-time load data; comparing the resource change amount with the real-time load data to obtain a resource adjustment ratio; obtaining a resource adjustment amount for each computing node based on the resource adjustment ratio and the resource quantity adjustment range; and adjusting the resource quantity of each computing node based on the resource adjustment amount.
[0177] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0178] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0179] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A task allocation method, characterized in that: The method comprises: Receive a running request for a task to be executed; the running request carries a task type; Determine the target computing node for each of the tasks to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated based on the predicted load of each computing node; Allocate the task to be executed to the target computing node.
2. The task allocation method according to claim 1, characterized in that: The calculation process of resource priority includes: Obtain real-time load data of each computing node; According to the real-time load data, predict the load condition of each computing node in the next time period to obtain the predicted load condition; The computing nodes are sorted according to the predicted load conditions to obtain the resource priorities.
3. The task allocation method according to claim 2, characterized in that: The load condition of each computing node in the next time period is predicted based on the real-time load data, and the predicted load condition is obtained by a pre-trained load prediction model; the training process of the load prediction model includes: Acquire historical load data; the historical load data carries a load tag; Inputting the historical load data into the initial model for training to obtain the initial load condition; A target loss function is obtained based on the initial load condition and the load label, and the parameters of the initial model are adjusted according to the target loss function until the training is completed to obtain the load prediction model.
4. The task allocation method according to claim 1, characterized in that: The determining of the target computing node of each of the tasks to be executed based on the task type and the resource priority of each computing node includes: If the task type is delay-sensitive, the computing node with the first resource priority is used as the initial node; If the delay threshold of the initial node meets the preset requirement, the initial node is used as the target node; If the delay threshold of the initial node does not meet the preset requirement, it is determined whether the next computing node meets the preset requirement in the order of the resource priority until the target node is obtained.
5. The task allocation method according to claim 2, characterized in that: The method further comprises: According to the predicted load condition, the quantity of resources of each computing node is adjusted.
6. The task allocation method according to claim 5, characterized in that: The adjusting the quantity of resources of each computing node according to the predicted load condition includes: Get the resource quantity adjustment range; Calculating resource changes according to the predicted load condition and the real-time load data; Compare the resource change amount with the real-time load data to obtain a resource adjustment ratio; Obtaining a resource adjustment amount for each computing node according to the resource adjustment ratio and the resource quantity adjustment range; The resource quantity of each computing node is adjusted according to the resource adjustment amount.
7. A task allocation device, characterized in that: The device comprises: A receiving module, used to receive a running request for a task to be executed; the running request carries a task type; A node determination module, used to determine the target computing node of each of the tasks to be executed based on the task type and the resource priority of each computing node; the resource priority is calculated according to the predicted load of each of the computing nodes; The allocation module is used to allocate the task to be executed to the target computing node.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Task processing method and system based on distributed voice gateway, and storage medium
CN119718674A
Computing power cloud resource scheduling method and system based on adaptive learning
CN120336026A
A computing power cloud resource scheduling method and system based on adaptive learning
CN120336026B
Stream computing resource adaptive scheduling method and system
CN120386627A
Cloud resource pool scheduling method for multiple users, computer equipment and medium
CN120762917A
