Task scheduling method and device, electronic equipment and readable storage medium

By obtaining barrage package production tasks and server load data, and dynamically adjusting scheduling intervals using the prediction model, the task backlog and response time caused by traditional fixed interval scheduling are solved, and efficient and stable scheduling and system of barrage package production tasks are realized. Performance improvement.

CN119248447APending Publication Date: 2025-01-03BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411326918.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The traditional barrage package task scheduling method adopts a fixed scheduling interval, which can easily lead to a backlog of tasks and a long response time when the system is loaded heavily, affecting system performance and user experience.

Method used

By obtaining barrage package production tasks and production scheduling data, including the number of tasks, number of execution servers and system load, the data is input into the target prediction model to output the scheduling time, dynamically adjust the scheduling interval, ensure that the tasks match the server load, and avoid task backlog and The system is overloaded.

Benefits of technology

It realizes efficient and stable scheduling of barrage package production tasks, reduces response time, improves system performance and user experience, and avoids the problems of task backlog and excessive system load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248447A_ABST
    Figure CN119248447A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task scheduling method and device, electronic equipment and a readable storage medium, and the method comprises the steps: obtaining bullet screen package production tasks and production scheduling data, and the production scheduling data comprises the number of bullet screen package production tasks, the number of execution servers, and the system load of each execution server, the average duration of the server responding to the bullet screen package production task is executed; the execution server is used for executing the bullet screen package production task; inputting the production scheduling data into the target prediction model, and outputting scheduling duration; the scheduling duration is used for indicating the interval duration between two adjacent scheduling operations; and according to the scheduling duration, executing a scheduling operation of allocating the bullet screen package production task to an execution server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a task scheduling method, device, electronic device and readable storage medium. Background Art

[0002] At present, in the operation of the barrage system, the production scheduling of barrage packages is a key link. Barrage packages refer to the barrage information within a unit time slice on the video timeline. For example, a one-minute barrage package refers to the aggregation of barrages released within 1 minute of the video. The client obtains the barrage package based on the video and timeline for display. Based on the behavior events such as barrage release, interaction, and reporting, the barrage package production task will be triggered.

[0003] Task scheduling of barrage packages refers to the process of arranging the execution order and execution time of barrage package production tasks in the barrage system according to certain strategies, ensuring that the barrage packages can be generated in time and pushed to the client to meet the needs of users to view barrages while watching videos.

[0004] Traditional bullet-screen package task scheduling methods usually adopt fixed scheduling intervals, which has low flexibility and easily leads to a backlog of bullet-screen package production tasks. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a task scheduling method, device, electronic device and readable storage medium, which can flexibly schedule the production tasks of bullet comment packages. The specific technical solution is as follows:

[0006] In a first aspect of the present invention, a task scheduling method is provided, comprising:

[0007] Obtaining bullet-screen package production tasks and production scheduling data, the production scheduling data includes: the number of tasks for bullet-screen package production tasks, the number of execution servers, the system load of each execution server, and the average time it takes for the execution server to respond to the bullet-screen package production tasks; the execution server is used to execute the bullet-screen package production tasks;

[0008] Input the production scheduling data into the target prediction model and output the scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations;

[0009] According to the scheduling duration, the scheduling operation of allocating the bullet comment package production task to the execution server is executed.

[0010] In a second aspect of the present invention, a task scheduling device is provided, comprising:

[0011] The acquisition module is used to obtain the bullet-screen package production tasks and production scheduling data, the production scheduling data includes: the number of tasks of the bullet-screen package production tasks, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the bullet-screen package production tasks; the execution server is used to execute the bullet-screen package production tasks;

[0012] An input module is used to input production scheduling data into a target prediction model and output a scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations;

[0013] The execution module is used to execute the scheduling operation of allocating the bullet screen package production task to the execution server according to the scheduling duration.

[0014] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-mentioned data forwarding methods.

[0015] In another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned task scheduling methods.

[0016] According to an embodiment of the present invention, barrage package production tasks and production scheduling data are obtained, and the production scheduling data includes: the number of barrage package production tasks, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the barrage package production tasks; since the production scheduling data can reflect the number of barrage package production tasks and the task intensity that the execution server can withstand, the production scheduling data is input into the target prediction model, and the scheduling duration is output, so that the reasonable interval duration between two adjacent scheduling operations can be calculated quickly and accurately; according to the scheduling duration, the scheduling operation of allocating the barrage package production tasks to the execution server is executed, so that the barrage package production tasks can be efficiently and stably scheduled, so that the barrage package production tasks can be matched with the load of the execution server, thereby avoiding task backlogs and excessive system load. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0018] Figure 1 is a flowchart of a task scheduling method provided by an embodiment of the present application;

[0019] Figure 2 is a flowchart of another task scheduling method provided by an embodiment of the present application;

[0020] Figure 3 A schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0023] The task scheduling method provided in the embodiment of the present application can be applied to at least the following application scenarios, which are described below.

[0024] In the operation of the bullet-screen system, the production scheduling of bullet-screen packages is a key link. The traditional bullet-screen package production scheduling algorithm usually adopts a fixed scheduling interval, which can ensure better scheduling efficiency when the system load is light.

[0025] A barrage package is a collection of barrage information within a unit time slice on the video timeline. For example, a one-minute barrage package contains all the barrages posted within every 1 minute of the video.

[0026] The production process of the bullet comment package includes: real-time collection of bullet comment data posted by users during video playback, including bullet comment content, posting time, and user information; cleaning the collected bullet comment data to remove invalid data; aggregating the bullet comment data within a specific time period according to the video timeline to form a bullet comment package. For example, all bullet comment data within each minute is aggregated into a one-minute bullet comment package; the generated bullet comment package is stored in a database or cache, so that the client can obtain the bullet comment package according to the video and timeline for display.

[0027] When the system load is light, traditional fixed time interval scheduling can ensure scheduling efficiency. For example, a bullet screen package is generated once a minute and scheduled to the server. The system triggers the bullet screen package production task at a fixed time interval; after the task is triggered, the system starts to execute the bullet screen package production task; after the bullet screen package production task is completed, the bullet screen package within a specific time period is obtained; the generated bullet screen package is scheduled to the server; the client obtains the corresponding bullet screen package from the server according to the video playback progress and timeline, and displays the bullet screen during video playback.

[0028] For example, the user is watching a 1-hour video, and the system uses a scheduling strategy to generate a bullet comment package every minute. The time axis of the video is 00:00-01:00; the scheduling interval is 1 minute, that is, the time points of the bullet comment package generation, including: 00:01, 00:02, 00:03, ..., 01:00.

[0029] However, when the system is heavily loaded, scheduling at fixed scheduling intervals will lead to task backlogs and long waiting times, which will in turn lead to longer response times and affect the performance of the entire system.

[0030] System load refers to the number of tasks the system is currently processing and the resource usage. A heavy system load means that the system is processing a large number of tasks and the resource usage is high.

[0031] Among them, high CPU usage means that the system CPU is under high load for a long time and cannot process new tasks in time. High memory usage means that the system memory is insufficient, resulting in frequent memory swapping, which affects the efficiency of task execution. High network bandwidth usage means that the amount of network data transmission is large, resulting in increased network delay and affecting data transmission efficiency.

[0032] When the system is heavily loaded, scheduling at a fixed scheduling interval will cause new tasks to be generated continuously, but the system's processing capacity is limited and it cannot process all tasks in time, resulting in a backlog of tasks. A heavy system load will cause the processing time of each task to become longer, further exacerbating the backlog of tasks.

[0033] Task backlogs will cause tasks to wait longer in the queue, and new tasks will need to wait until the previous tasks are completed before they can start executing. Heavy system load will lead to increased resource contention. For example, multiple tasks will compete for CPU resources at the same time, resulting in longer task execution time.

[0034] Task backlogs and long waiting times will lead to increased task processing time, which in turn will cause the system response time to become longer; longer response time will lead to a decline in user experience. For example, after a user posts a barrage, they need to wait a long time before they can see the barrage, which affects the user's experience of watching a video.

[0035] Among them, the production of barrage packages refers to the barrage package refresh tasks caused by barrage release, interaction, reporting and other behavioral events. The process of barrage package production involves: event publishing end, scheduling end, and barrage package production end. The process of barrage package production includes: the event publishing end delivers the event to the scheduling end, the scheduling end asynchronously sends the barrage package production task to the message queue according to the scheduling interval, and the barrage package production end (ie, the execution server) receives the task message to produce the barrage package. Among them, the task scheduling method provided in the embodiment of the present application is executed by the scheduling end.

[0036] Based on the above application scenarios, the task scheduling method provided in the embodiments of the present application is described below.

[0037] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application.

[0038] like Figure 1As shown, the task scheduling method may include steps 110 to 130, and the method is applied to a task scheduling device, as shown below:

[0039] Step 110, obtaining the bullet screen package production task and production scheduling data, the production scheduling data including: the task quantity of the bullet screen package production task, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the bullet screen package production task; the execution server is used to execute the bullet screen package production task;

[0040] The task quantity of the bullet comment package production task refers to the task quantity of the bullet comment package production tasks to be processed by the execution server;

[0041] The execution server is a server used to execute the bullet comment package production task;

[0042] The time it takes for the execution server to respond to the task of producing a bullet comment package, which is the time it takes for the execution server to complete a task of producing a bullet comment package;

[0043] The average duration for the execution server to respond to the task of producing a barrage package is the quotient of the sum of the durations for the execution servers to respond to the task of producing a barrage package and the number of execution servers.

[0044] The system load of the execution server can be determined based on the system's CPU usage and memory usage.

[0045] Step 120, input the production scheduling data into the target prediction model, and output the scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations;

[0046] Since the production scheduling data can reflect the number of bullet-screen package production tasks and the task intensity that the execution server can bear, the production scheduling data is input into the target prediction model, and the scheduling duration is output, which can quickly and accurately calculate the reasonable interval between two adjacent scheduling operations. Here, the future scheduling interval is accurately predicted through the production scheduling data, thereby reducing unnecessary task scheduling and resource waste.

[0047] Step 130, according to the scheduling duration, execute the scheduling operation of allocating the bullet screen package production task to the execution server.

[0048] According to the scheduling duration, the bullet screen package production tasks can be flexibly allocated to the execution server, which can minimize the response time of the execution server while ensuring the completion of the task. It can effectively improve the scheduling efficiency and optimize the system performance under different system loads. Therefore, the scheduling duration can be dynamically adjusted according to the production scheduling data to improve the scheduling efficiency.

[0049] According to an embodiment of the present invention, barrage package production tasks and production scheduling data are obtained, and the production scheduling data includes: the number of barrage package production tasks, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the barrage package production tasks; since the production scheduling data can reflect the number of barrage package production tasks and the task intensity that the execution server can withstand, the production scheduling data is input into the target prediction model, and the scheduling duration is output, so that the reasonable interval duration between two adjacent scheduling operations can be calculated quickly and accurately; according to the scheduling duration, the scheduling operation of allocating the barrage package production tasks to the execution server is executed, so that the barrage package production tasks can be efficiently and stably scheduled, so that the barrage package production tasks can be matched with the load of the execution server, thereby avoiding task backlogs and excessive system load.

[0050] Steps 110 to 130 are described below respectively:

[0051] This involves step 110 .

[0052] Among them, the system load can be determined based on the system's CPU usage and memory usage.

[0053] The average time it takes to execute the server response barrage package production task can be determined by monitoring the average response time of the system.

[0054] This involves step 120 .

[0055] In a possible embodiment, the target prediction model is trained based on historical production scheduling data and preset scheduling duration; the historical production scheduling data includes: the historical number of barrage package production tasks, the historical number of execution servers, the historical system load of each execution server, and the historical average duration of the execution server responding to the barrage package production tasks.

[0056] Among them, historical production scheduling data includes:

[0057] The number of historical tasks indicates the total number of bullet comment package production tasks in the past period of time, reflecting the scale and frequency of production tasks;

[0058] The historical number of execution servers indicates the number of servers used to execute bullet commentary package production tasks in the past period of time, reflecting the resource allocation situation;

[0059] The historical system load of each execution server indicates the system load of each execution server in the past period of time, including the usage of resources such as CPU, memory, and disk I / O;

[0060] The historical average time it takes for the execution server to respond to the barrage package production task, which indicates the average time it takes for each execution server to process the barrage package production task, reflecting the processing efficiency of the server.

[0061] Therefore, the target prediction model can effectively predict future production scheduling by analyzing historical production scheduling data and preset scheduling duration, thereby improving the production efficiency and system stability of barrage package production tasks.

[0062] The step of inputting the production scheduling data into the target prediction model and outputting the scheduling duration may further include:

[0063] Perform data cleaning and preprocessing on production scheduling data. Data cleaning and preprocessing include processing missing values, outliers, feature scaling or standardization, etc. to ensure data quality and consistency.

[0064] Among them, the preset scheduling duration is given based on practical experience and expert experience evaluation.

[0065] The target prediction model is trained based on historical production scheduling data and preset scheduling duration, which can make the scheduling duration output by the target prediction model adaptive to the actual load and response time of the system, thereby optimizing the system performance and realizing the production scheduling of barrage packages with adaptive scheduling intervals.

[0066] The production scheduling data can be used as the independent variable (x). The scheduling duration can be used as the dependent variable (y). Then, a linear regression model (y) = a(x) + b is used for modeling. The linear regression model includes: model parameter a and model parameter b.

[0067] The linear regression model can be trained according to the historical production scheduling data until the linear regression model converges to determine the model parameters a and b. At the same time, in order to improve the accuracy of the linear regression model prediction, the model parameters a and b of the linear regression model need to be updated regularly to make the model prediction more accurate.

[0068] The historical production scheduling data includes: the historical number of barrage package production tasks, the historical number of execution servers, the historical system load of each execution server, and the historical average time for the execution server to respond to the barrage package production tasks.

[0069] Among them, the number of tasks and scheduling time are negatively correlated; the system load and scheduling time are positively correlated.

[0070] The number of tasks and the scheduling duration are negatively correlated, that is, the more tasks there are, the shorter the scheduling duration is, which can reduce the response time of the execution server, thereby avoiding task backlogs.

[0071] The system load and scheduling time are positively correlated, that is, the greater the system load, the longer the scheduling time, which can reduce unnecessary task scheduling and resource waste, thereby ensuring system performance.

[0072] Therefore, the scheduling duration is determined based on the production scheduling data, which can quickly and accurately predict the scheduling interval of the next stage, achieving the purpose of dynamically adjusting the scheduling interval. On the premise of ensuring the completion of the task, the time for executing the server to respond to the barrage package production task can be minimized, thereby improving the scheduling efficiency.

[0073] In a possible embodiment, before the above-mentioned step of inputting the production scheduling data into the target prediction model and outputting the scheduling duration, the following steps may also be included:

[0074] Obtain historical production scheduling data and preset scheduling duration;

[0075] Input historical production scheduling data into the initial forecasting model to obtain the forecast scheduling duration;

[0076] Determine the loss value based on the predicted dispatch time and the preset dispatch time;

[0077] According to the loss value, the initial prediction model is trained until the initial prediction model meets the training conditions and the target prediction model is obtained.

[0078] Select appropriate historical production scheduling data, such as the number of servers executing tasks, system load, response time, and number of tasks, and use the historical production scheduling data as the independent variable (x) and the scheduling time interval as the dependent variable (y). Then, use the linear regression model y=ax+b to build a model.

[0079] X: [server_count, system_load, response_time, task_count];

[0080] Y: [scheduling_interval];

[0081] Among them, X is the historical production scheduling data, and Y is the predicted scheduling duration;

[0082] server_count: the number of execution servers;

[0083] system_load: system load of each execution server;

[0084] response_time: the average time it takes to execute the server's response to the bullet comment package production task;

[0085] task_count: the number of tasks for producing bullet comment packages;

[0086] scheduling_interval: predicted scheduling duration;

[0087] In the step of determining the loss value based on the predicted scheduling duration and the preset scheduling duration, the test sample set can be used to evaluate the model, and some evaluation indicators such as mean square error or R^2 score can be used to determine the loss value to evaluate the performance and accuracy of the model. The R^2 score is an indicator in statistics and machine learning that is used to evaluate the goodness of fit of a regression model.

[0088] The initial prediction model is a linear regression model, and the linear regression model is (y) = a(x) + b. (x) is the historical production scheduling data, and (y) is the predicted scheduling duration.

[0089] Therefore, according to the loss value, the initial prediction model is trained to make the predicted scheduling duration and the preset scheduling duration closer and closer, until the initial prediction model meets the training conditions, and the target prediction model is obtained to improve the prediction accuracy of the target prediction model, so that the production scheduling data can be input into the target prediction model in the future, and the scheduling duration can be output quickly and accurately.

[0090] This involves step 130 .

[0091] The scheduling server will distribute the bullet screen package production task to the execution server for processing based on the scheduling duration.

[0092] The execution server can be a physical server, virtual machine or container used to execute the bullet message package task.

[0093] In a possible embodiment, step 130 includes:

[0094] Calculate the scheduling time point according to the scheduling duration;

[0095] All the bullet comment package production tasks to be assigned are stored in the priority queue and sorted according to the priority of the bullet comment package production tasks;

[0096] When the current time reaches the scheduling time point, the highest priority bullet screen package production task is taken out from the priority queue, and the highest priority bullet screen package production task is allocated to the execution server.

[0097] The scheduling time point refers to the time point calculated by the system based on the preset scheduling duration. The task allocation operation is triggered at the scheduling time point. The scheduling time point is used to control the frequency of task allocation, ensuring that the time interval of each scheduling operation meets the preset scheduling duration to avoid task backlog.

[0098] The priority of the bullet comment package production task can be determined based on factors such as the importance and urgency of the task. When the scheduling server is scheduling, the higher the priority of the bullet comment package production task, the earlier it will be scheduled and distributed.

[0099] For example, the priority queue is: [A1, B1, A2, B2];

[0100] Scheduling time points, including:

[0101] The last scheduling operation time: 2024-09-09, 10:00:00;

[0102] The next scheduling time is: 2024-09-09, 10:01:00;

[0103] If the current time is 2024-09-09, 10:01:00, the next scheduling time point is reached; the highest priority task A1 is taken out from the priority queue; task A1 is assigned to the execution server. The highest priority task B1 is taken out from the priority queue; task B1 is assigned to the execution server.

[0104] Update the last scheduling operation time point to 2024-09-09, 10:01:00, and calculate the new next scheduling time point to 2024-09-09, 10:02:00;

[0105] If the current time is 2023-10-26 10:02:00, the next scheduling time point is reached; the highest priority task A2 is taken out from the priority queue; task A2 is assigned to the execution server; the highest priority task B2 is taken out from the priority queue; task B2 is assigned to the execution server.

[0106] Therefore, according to the priority and scheduling duration of the barrage package production task, the barrage package production task is allocated to the available execution server, which can ensure that the barrage package production tasks with high priority can be executed in time.

[0107] Before the step of storing all the barrage package production tasks to be assigned into the priority queue and sorting them according to the priority of the barrage package production tasks, the following steps may also be included:

[0108] Get the video online time and video popularity data associated with the bullet comment package production task;

[0109] Determine the priority of the barrage package production task based on the video online time and video popularity data.

[0110] The video online time refers to the time when the video is released to the online platform;

[0111] Video popularity data can be determined based on the following data: click-through rate, playback volume, viewing time, interaction rate, conversion rate, sharing volume and social media exposure rate.

[0112] The smaller the difference between the video online time and the current system time, the higher the priority of the video-associated barrage package production task; the higher the video popularity data, the higher the priority of the video-associated barrage package production task.

[0113] In other words, the newer the video is and the more popular it is, the higher the priority of the corresponding barrage package production task will be, and the sooner it will be assigned to the execution server for processing.

[0114] According to the video online time and popularity data, different priorities are set for the barrage package production tasks of different videos, and the barrage packages of newly launched videos and high-popularity videos are given priority to ensure that users can see the latest and most popular barrage in time.

[0115] Specifically, the priority score of each video is calculated based on the video heat data and the video heat weight, which can be calculated by the following formula:

[0116] Priority score = weight of newly launched video * launch time + weight of playback volume * weight of playback volume + number of likes * weight of number of likes + number of comments * weight of number of comments + number of shares * weight of number of shares + number of barrages * number of barrages.

[0117] All barrage package production tasks are sorted according to the priority score. The higher the priority score, the higher the task priority. When scheduling tasks, high-priority tasks are given priority to ensure that the barrage packages for newly launched videos and highly popular videos can be generated and pushed in a timely manner.

[0118] Therefore, the priority of the bullet screen package production task can be determined according to the video online time and video popularity data, which can effectively determine the priority of the bullet screen package production task to ensure that the bullet screen package production task with a higher priority is assigned to the execution server for processing earlier. Ensure that users can see the latest and most popular bullet screens in a timely manner, improve user experience, give priority to high-priority tasks, and ensure that the bullet screen packages of newly launched videos and highly popular videos can be generated and pushed in a timely manner.

[0119] In a possible embodiment, step 130 includes:

[0120] Get the first time point of the last scheduling operation;

[0121] Determine a second time point according to the first time point and the scheduling duration;

[0122] When the system time reaches the second time point, a scheduling operation is performed to allocate the bullet screen package production task to the execution server.

[0123] Exemplarily, the first time point of the last scheduling operation is 12:00; the scheduling duration is 10 minutes, and the second time point can be obtained as 12:10 according to the first time point and the scheduling duration.

[0124] Determine whether the system time has reached the second time point. If the system time has not reached the second time point, continue to determine whether the system time has reached the second time point after a preset time length. The preset time length can be 1 second or 2 seconds.

[0125] When the system time reaches 12:10, the scheduling operation of allocating the bullet comment package production task to the execution server is executed.

[0126] In practical applications, in order to improve system throughput and response speed, multiple tasks are usually processed in a concurrent manner, that is, the system processes multiple tasks at the same time instead of processing them one by one. When multiple tasks have the same priority, the system needs to decide how to schedule these tasks. The scheduling strategies include:

[0127] First-in-first-out scheduling strategy, processing tasks in the order they arrive;

[0128] Polling scheduling strategy, which allocates a fixed time slice to each task in turn, and switches to the next task after the time slice is used up;

[0129] Fair share scheduling strategy allocates a fair share of resources to each task based on its priority and resource requirements;

[0130] The weighted round-robin scheduling strategy assigns different weights to each task. Tasks with higher weights are allocated more time slices.

[0131] Therefore, when the system time reaches the second time point, the scheduling operation of allocating the barrage package production task to the execution server is executed, which can ensure that the scheduling operation of allocating the barrage package production task to the execution server can be carried out on time.

[0132] According to an embodiment of the present invention, barrage package production tasks and production scheduling data are obtained, and the production scheduling data includes: the number of barrage package production tasks, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the barrage package production tasks; since the production scheduling data can reflect the number of barrage package production tasks and the task intensity that the execution server can withstand, the production scheduling data is input into the target prediction model, and the scheduling duration is output, so that the reasonable interval duration between two adjacent scheduling operations can be calculated quickly and accurately; according to the scheduling duration, the scheduling operation of allocating the barrage package production tasks to the execution server is executed, so that the barrage package production tasks can be efficiently and stably scheduled, so that the barrage package production tasks can be matched with the load of the execution server, thereby avoiding task backlogs and excessive system load.

[0133] Based on the above Figure 1 The task scheduling method shown in the embodiment of the present application also provides a task scheduling method, such as Figure 2 As shown, the task scheduling process may include:

[0134] First, the task number of the barrage package production task is collected in real time through the task queue; and the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the barrage package production task are collected in real time.

[0135] Then, the production scheduling data is input into the target prediction model and the scheduling duration is output.

[0136] Next, based on the first time point and the scheduling duration, the second time point is determined, and it is judged whether the system time has reached the second time point. When the system time reaches the second time point, the barrage package production task is allocated to the execution server according to the priority and scheduling duration of the barrage package production task; when the system time has not reached the second time point, after an interval of a preset judgment duration, which may be 1 second, it is continued to be judged whether the system time has reached the second time point, and the judgment frequency may be once per second.

[0137] Finally, the scheduling operation of allocating the bullet comment package production task to the execution server is executed.

[0138] According to an embodiment of the present invention, barrage package production tasks and production scheduling data are obtained, and the production scheduling data includes: the number of barrage package production tasks, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the barrage package production tasks; since the production scheduling data can reflect the number of barrage package production tasks and the task intensity that the execution server can withstand, the production scheduling data is input into the target prediction model, and the scheduling duration is output, so that the reasonable interval duration between two adjacent scheduling operations can be calculated quickly and accurately; according to the scheduling duration, the scheduling operation of allocating the barrage package production tasks to the execution server is executed, so that the barrage package production tasks can be efficiently and stably scheduled, so that the barrage package production tasks can be matched with the load of the execution server, thereby avoiding task backlogs and excessive system load.

[0139] Based on the above Figure 1 The task scheduling method shown in the embodiment of the present application also provides a task scheduling device, such as Figure 3 As shown, the task scheduling device 300 may include:

[0140] The acquisition module 310 is used to acquire the bullet-screen package production task and production scheduling data, the production scheduling data including: the task quantity of the bullet-screen package production task, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the bullet-screen package production task; the execution server is used to execute the bullet-screen package production task;

[0141] An input module 320 is used to input production scheduling data into a target prediction model and output a scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations;

[0142] The execution module 330 is used to execute the scheduling operation of allocating the bullet screen package production task to the execution server according to the scheduling duration.

[0143] In a possible embodiment, the target prediction model is trained based on historical production scheduling data and preset scheduling duration; the historical production scheduling data includes: the historical number of barrage package production tasks, the historical number of execution servers, the historical system load of each execution server, and the historical average duration of the execution server responding to the barrage package production tasks.

[0144] In a possible embodiment, the acquisition module 310 is further used to acquire historical production scheduling data and preset scheduling duration;

[0145] The input module 320 is also used to input the historical production scheduling data into the initial prediction model to obtain the predicted scheduling duration;

[0146] The task scheduling device 300 may further include:

[0147] A first determination module is used to determine the loss value according to the predicted scheduling duration and the preset scheduling duration;

[0148] The training module is used to train the initial prediction model according to the loss value until the initial prediction model meets the training conditions to obtain the target prediction model.

[0149] In a possible embodiment, the initial prediction model is a linear regression model.

[0150] In a possible embodiment, the execution module 330 is specifically configured to:

[0151] Calculate the scheduling time point according to the scheduling duration;

[0152] All the bullet comment package production tasks to be assigned are stored in the priority queue and sorted according to the priority of the bullet comment package production tasks;

[0153] When the current time reaches the scheduling time point, the highest priority bullet screen package production task is taken out from the priority queue, and the highest priority bullet screen package production task is allocated to the execution server.

[0154] In a possible embodiment, the acquisition module 310 is further used to obtain the video online time and video popularity data associated with the bullet comment package production task;

[0155] The task scheduling device 300 may further include:

[0156] The second determination module is also used to determine the priority of the bullet screen package production task according to the video online time and video popularity data.

[0157] In a possible embodiment, the execution module 330 is specifically configured to:

[0158] Get the first time point of the last scheduling operation;

[0159] Determine a second time point according to the first time point and the scheduling duration;

[0160] When the system time reaches the second time point, a scheduling operation is performed to allocate the bullet screen package production task to the execution server.

[0161] According to an embodiment of the present invention, barrage package production tasks and production scheduling data are obtained, and the production scheduling data includes: the number of barrage package production tasks, the number of execution servers, the system load of each execution server, and the average time for the execution server to respond to the barrage package production tasks; since the production scheduling data can reflect the number of barrage package production tasks and the task intensity that the execution server can withstand, the production scheduling data is input into the target prediction model, and the scheduling duration is output, so that the reasonable interval duration between two adjacent scheduling operations can be calculated quickly and accurately; according to the scheduling duration, the scheduling operation of allocating the barrage package production tasks to the execution server is executed, so that the barrage package production tasks can be efficiently and stably scheduled, so that the barrage package production tasks can be matched with the load of the execution server, thereby avoiding task backlogs and excessive system load.

[0162] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0163] Memory 403, used for storing computer programs;

[0164] The processor 401 is used to execute the program stored in the memory 403 to implement the following steps:

[0165] Obtaining bullet-screen package production tasks and production scheduling data, the production scheduling data includes: the number of tasks for bullet-screen package production tasks, the number of execution servers, the system load of each execution server, and the average time it takes for the execution server to respond to the bullet-screen package production tasks; the execution server is used to execute the bullet-screen package production tasks;

[0166] Input the production scheduling data into the target prediction model and output the scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations;

[0167] According to the scheduling duration, the scheduling operation of allocating the bullet comment package production task to the execution server is executed.

[0168] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0169] The communication interface is used for communication between the above terminal and other devices.

[0170] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0171] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0172] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the task scheduling method described in any one of the above embodiments.

[0173] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the task scheduling method described in any one of the above embodiments.

[0174] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0175] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0176] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0177] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A task scheduling method, characterized in that: The method comprises: Obtaining a bullet-screen package production task and production scheduling data, the production scheduling data including: the task quantity of the bullet-screen package production task, the number of execution servers, the system load of each of the execution servers, and the average time it takes for the execution server to respond to the bullet-screen package production task; the execution server is used to execute the bullet-screen package production task; Input the production scheduling data into the target prediction model and output the scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations; According to the scheduling duration, a scheduling operation is performed to allocate the bullet screen package production task to the execution server.

2. The method according to claim 1, characterized in that The target prediction model is trained based on historical production scheduling data and preset scheduling duration; the historical production scheduling data includes: the historical number of barrage package production tasks, the historical number of execution servers, the historical system load of each of the execution servers, and the historical average duration of the execution server responding to the barrage package production tasks.

3. The method according to claim 1, characterized in that Before inputting the production scheduling data into the target prediction model and outputting the scheduling duration, the method further includes: Acquiring the historical production scheduling data and the preset scheduling duration; Inputting the historical production scheduling data into the initial prediction model to obtain the predicted scheduling duration; Determining a loss value according to the predicted scheduling duration and the preset scheduling duration; According to the loss value, the initial prediction model is trained until the initial prediction model meets the training conditions, thereby obtaining the target prediction model.

4. The method according to claim 1, characterized in that: The initial prediction model is a linear regression model.

5. The method according to claim 1, characterized in that The performing the scheduling operation of allocating the bullet screen package production task to the execution server according to the scheduling duration includes: Calculate the scheduling time point according to the scheduling duration; All the bullet comment package production tasks to be assigned are stored in the priority queue and sorted according to the priority of the bullet comment package production tasks; When the current time reaches the scheduling time point, the highest priority bullet screen package production task is taken out from the priority queue, and the highest priority bullet screen package production task is allocated to the execution server.

6. The method according to claim 5, characterized in that Before storing all the barrage package production tasks to be allocated in the priority queue and sorting them according to the priorities of the barrage package production tasks, the method further includes: Get the video online time and video popularity data associated with the bullet comment package production task; The priority of the bullet screen package production task is determined according to the video online time and the video popularity data.

7. The method according to claim 1, characterized in that The performing the scheduling operation of allocating the bullet screen package production task to the execution server according to the scheduling duration includes: Obtain the first time point when the scheduling operation was last executed; Determining a second time point according to the first time point and the scheduling duration; When the system time reaches the second time point, a scheduling operation is performed to allocate the bullet screen package production task to the execution server.

8. The method according to claim 1, characterized in that The number of tasks is negatively correlated with the scheduling duration; the system load is positively correlated with the scheduling duration.

9. A task scheduling device, characterized in that: The device comprises: An acquisition module is used to acquire a bullet-screen package production task and production scheduling data, wherein the production scheduling data includes: the task quantity of the bullet-screen package production task, the number of execution servers, the system load of each of the execution servers, and the average time for the execution server to respond to the bullet-screen package production task; the execution server is used to execute the bullet-screen package production task; An input module, used to input the production scheduling data into a target prediction model and output a scheduling duration; the scheduling duration is used to indicate the interval between two adjacent scheduling operations; An execution module is used to execute a scheduling operation of allocating the bullet screen package production task to the execution server according to the scheduling duration.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.