Task scheduling method and device

By implementing resource preemption and subtask allocation in the task scheduling method, the problem of stable access to event data from different data sources is solved, achieving stable access to event data and self-balancing of data traffic, thereby improving the stability and efficiency of task processing.

CN114675954BActive Publication Date: 2026-04-21ALIBABA CLOUD COMPUTING CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2022-03-29
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, event data from different data sources cannot be reliably accessed when processing tasks are performed due to the different data protocols.

Method used

By preempting resources during the first execution cycle of a task to be executed, the system seizes the task's operation rights, and then allocates subtasks to the server that successfully preempted the resources during the second execution cycle. This achieves decentralization of the tasks to be executed and self-balancing of data traffic, thereby ensuring stable access to event data.

Benefits of technology

It enables stable access to event data from different data sources, ensures self-balancing of data traffic, and improves the stability and efficiency of task processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114675954B_ABST
    Figure CN114675954B_ABST
Patent Text Reader

Abstract

The application provides a task scheduling method and device, the method comprising: in a first execution cycle of a to-be-executed task, performing a resource preemption operation of the to-be-executed task, the resource preemption operation being used for preoccupying the operation authority of the resource of the to-be-executed task, the to-be-executed task being used for accessing event data of different data sources; if the server resource preemption succeeds, obtaining information of the to-be-executed task, the information of the to-be-executed task being used for indicating the server to which each subtask of the to-be-executed task is allocated; and according to the information of the to-be-executed task, executing the subtask corresponding to the server in a second execution cycle of the to-be-executed task, the second execution cycle being the next cycle of the first execution cycle. In this way, the subtasks of the to-be-executed task are allocated to the server whose resource preemption succeeds for execution, the decentralization of the to-be-executed task is realized, the self-balancing of data flow is ensured, and the stable access of event data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information processing technology, and in particular to a task scheduling method and apparatus. Background Technology

[0002] Against the backdrop of digital technology transformation, in order to meet the needs of unified management of urban events, it is necessary to aggregate events from different data sources, thereby achieving unified scheduling of processing tasks for different events.

[0003] In related technologies, event data from different data sources, such as 12315 hotline events, conflict mediation events, and grid reporting events, often have different data protocols and different event processing task scheduling schemes, which makes it impossible to guarantee stable access to event data when executing event processing tasks. Summary of the Invention

[0004] This application provides a task scheduling method and apparatus to address the problem of how to achieve stable access to event data in the prior art.

[0005] In a first aspect, embodiments of this application provide a task scheduling method applied to a server, the method comprising:

[0006] In the first execution cycle of the task to be executed, a resource preemption operation is performed on the task to be executed. The resource preemption operation is used to preempt the operation permission of the resources of the task to be executed. The task to be executed is used to access event data from different data sources.

[0007] If the server resource preemption is successful, the information of the task to be executed is obtained. The information of the task to be executed is used to indicate the server allocated to each subtask of the task to be executed.

[0008] Based on the information of the task to be executed, the subtask corresponding to the server is executed in the second execution cycle of the task to be executed, and the second execution cycle is the next cycle after the first execution cycle.

[0009] In one optional implementation, the information of the tasks to be executed includes a list of servers that have successfully preempted resources, a list of the tasks to be executed, and a list of subtasks of the tasks to be executed.

[0010] The list of tasks to be executed includes the historical read time and the historical access event volume of the tasks to be executed; the list of subtasks of the tasks to be executed includes the server assigned to each subtask.

[0011] In one optional implementation, the subtasks of the task to be executed are generated by splitting the task based on the historical access event volume of the task to be executed.

[0012] In an optional implementation, after executing the subtask corresponding to the server in the second execution cycle of the task to be executed based on the information of the task to be executed, the method further includes:

[0013] Determine the number of events received by the subtask corresponding to the server in the second execution cycle;

[0014] Based on the number of events accessed during the second execution cycle, update the historical number of events accessed for each task in the list of tasks to be executed.

[0015] In an optional implementation, after executing the subtask corresponding to the server in the second execution cycle of the task to be executed based on the information of the task to be executed, the method further includes:

[0016] Receive the event access request sent by the terminal device for the subtask corresponding to the server;

[0017] Based on the event access request, the new event is accessed in the subtask corresponding to the server.

[0018] In one optional implementation, the event access request includes the data source of the new event, the scheduling period of the new event, and the conversion method of the data format of the new event.

[0019] In one optional implementation, each subtask corresponds to a remote data pointer, which is used to mark the data point currently being retrieved by the subtask.

[0020] Secondly, embodiments of this application provide a task scheduling apparatus, the method comprising:

[0021] The lock-grabbing module is used to perform a resource preemption operation on the task to be executed during the first execution cycle of the task to be executed. The resource preemption operation is used to preempt the operation permission of the resource of the task to be executed, which is used to access event data from different data sources.

[0022] The acquisition module is used to acquire information about the task to be executed if the task scheduling device successfully preempts the resources. The information about the task to be executed is used to indicate the task scheduling device allocated to each subtask of the task to be executed.

[0023] The execution module is used to execute the subtask corresponding to the task scheduling device in the second execution cycle of the task to be executed, based on the information of the task to be executed, wherein the second execution cycle is the next cycle after the first execution cycle.

[0024] In one optional implementation, the information of the task to be executed includes a list of task scheduling devices that have successfully preempted resources, a list of the tasks to be executed, and a list of subtasks of the tasks to be executed.

[0025] The list of tasks to be executed includes the historical reading time and the historical access event volume of the tasks to be executed; the list of subtasks of the tasks to be executed includes the task scheduling device assigned to each subtask.

[0026] In one optional implementation, the subtasks of the task to be executed are generated by splitting the task based on the historical access event volume of the task to be executed.

[0027] In one optional implementation, the execution module is further configured to determine the number of events accessed by the subtask corresponding to the task scheduling device in the second execution cycle; and update the historical number of events accessed by the task to be executed in the list of tasks to be executed according to the number of events accessed in the second execution cycle.

[0028] In one optional implementation, the execution module is further configured to receive an event access request from the terminal device for a subtask corresponding to the task scheduling device; and to access a new event in the subtask corresponding to the task scheduling device according to the event access request.

[0029] In one optional implementation, the event access request includes the data source of the new event, the scheduling period of the new event, and the conversion method of the data format of the new event.

[0030] In one optional implementation, each subtask corresponds to a remote data pointer, which is used to mark the data point currently being retrieved by the subtask.

[0031] Thirdly, this application also provides an electronic device, including: a processor and a memory; the memory being used to store a computer program of the processor; the processor being configured to implement any of the possible methods in the first aspect by executing the computer program.

[0032] Fourthly, the present invention also provides a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing any of the possible methods of the first aspect.

[0033] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in the first aspect above and in various possible designs of the first aspect.

[0034] The task scheduling method and apparatus provided in this application involve the server first performing a resource preemption operation during the first execution cycle of a task to be executed. This resource preemption operation is used to preempt the operation rights of the resources of the task to be executed. Subsequently, if the server successfully preempts the resources, it obtains information about the task to be executed, which is used to indicate the server assigned to each subtask of the task. Finally, based on the information about the task to be executed, the server executes the corresponding subtask of the server during the second execution cycle of the task to be executed, which is the cycle following the first execution cycle. This method allocates the subtasks of the task to be executed to the server that successfully preempted the resources, achieving decentralization of the task to be executed, ensuring self-balancing of data traffic, and thus achieving stable access to event data. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a schematic diagram of an existing task scheduling method;

[0037] Figure 2 A flowchart illustrating a task scheduling method provided in an embodiment of this application;

[0038] Figure 3 A schematic diagram illustrating the principle of a task scheduling method provided in an embodiment of this application;

[0039] Figure 4 A flowchart illustrating another task scheduling method provided in an embodiment of this application;

[0040] Figure 5 A flowchart illustrating another task scheduling method provided in an embodiment of this application;

[0041] Figure 6 A schematic diagram of an event access request provided in an embodiment of this application;

[0042] Figure 7 This is a schematic diagram of the structure of a task scheduling device provided in an embodiment of this application;

[0043] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0046] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0047] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0048] Against the backdrop of digital technology transformation, in order to meet the needs of unified management of urban events, it is necessary to aggregate events from different data sources to achieve unified scheduling of event processing tasks. However, related technologies often use different data protocols and have different scheduling schemes for event processing tasks from different data sources, such as 12315 hotline events, conflict mediation events, and grid-reported events. This makes it impossible to guarantee stable access to event data when executing event processing tasks.

[0049] The data sources for event data can include relational database management systems (MySQL), logistics data centers (DataHub), message queues (RocketMQ), and Hypertext Transfer Protocol (HTTP) application programming interfaces (APIs).

[0050] To address the aforementioned issues, this application provides a task scheduling method and apparatus. By allocating subtasks of a task to be executed to a server that has successfully preempted resources, the server executes the corresponding subtasks of the task to be executed in each execution cycle, thereby achieving decentralization of the task to be executed, ensuring self-balancing of data traffic, and thus achieving stable access to event data.

[0051] Figure 1 This is a schematic diagram of an existing task scheduling method. (For example...) Figure 1 As shown, servers 101, 102, and 103 form a distributed server cluster. When scheduling tasks for executing event data, servers 101, 102, and 103 first perform resource preemption in the first execution cycle to seize the operation rights of the resources for the task to be executed. Subsequently, if servers 101, 102, and 103 successfully preempt resources, they further determine the sub-tasks of the assigned task to be executed. Then, servers 101, 102, and 103 execute the assigned sub-tasks in the next execution cycle and access the event data corresponding to the task to be executed from data sources such as terminal device 104.

[0052] The terminal device 104 can be a tablet computer, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in self-driving vehicles, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in a smart home, etc. The terminal device 104 provides event data to server 101, server 102, or server 103.

[0053] Servers 101, 102, and 103 can be a server group consisting of multiple network servers or a cloud based on cloud computing, consisting of a large number of computers or network servers. Cloud computing is a type of distributed computing, consisting of a super virtual computer composed of a group of loosely coupled computers.

[0054] It is understood that the above task scheduling method can be implemented by the task scheduling device provided in the embodiments of this application. The task scheduling device can be part or all of a certain device, such as the above-mentioned server.

[0055] The following uses a playback device and server with integrated or installed relevant execution code as an example to provide a detailed description of the technical solutions of the embodiments of this application. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0056] Figure 2 This is a flowchart illustrating a task scheduling method provided in an embodiment of this application. Figure 3 This is a schematic diagram illustrating the principle of a task scheduling method provided in an embodiment of this application. This embodiment relates to how to schedule subtasks of a task to be executed among multiple servers. For example... Figure 2 and Figure 3 As shown, the method includes:

[0057] S201. In the first execution cycle of the task to be executed, perform resource preemption operation for the task to be executed.

[0058] In this embodiment of the application, before scheduling the tasks to be executed, all servers to be used can preempt the resources of the tasks to be executed.

[0059] The tasks to be executed are used to access event data from different data sources.

[0060] This application does not limit the accessed event data. In some embodiments, the accessed event data is used to reflect pending events in the city, such as 12315 hotline events, conflict mediation events, grid reporting events, etc.

[0061] This application does not limit the type of data source. For example, the data source may include MySQL source, DataHub source, RocketMQ source, HTTP API source, etc.

[0062] It should be understood that the resource preemption operation described above is used to preempt the operation right of the resources of the task to be executed. In some embodiments, distributed locks such as Redis locks can be used to achieve synchronized access to resources by different threads in a distributed system.

[0063] In this embodiment of the application, when scheduling tasks to be executed, the scheduling process of the tasks to be executed can be divided into multiple execution cycles, and the time of each execution cycle can be the same or different. For example, Figure 3As shown, the first execution cycle T0 can be the first execution cycle in the scheduling process of the task to be executed, used for the server to preempt resources. In subsequent execution cycles, the task to be executed can be re-split into at least one sub-task based on the amount of events received by the task to be executed in the previous execution cycle, and the at least one sub-task can be assigned to the server for execution.

[0064] S202. If the server resources are successfully preempted, the information of the task to be executed is obtained and a subtask to be executed in the second execution cycle is generated. The information of the task to be executed is used to indicate the server to which each subtask of the task to be executed is allocated.

[0065] In some embodiments, the information of the tasks to be executed includes a list of servers that have successfully preempted resources, a list of tasks to be executed, and a list of subtasks of the tasks to be executed.

[0066] The list of tasks to be executed includes the historical read time and the historical number of events accessed for each task. The list of subtasks for each task includes the server assigned to it.

[0067] In some embodiments, the list of servers that have successfully preempted resources may also be a list of active servers, which includes the machine heartbeat of each active server.

[0068] It should be understood that the embodiments of this application do not limit how the task to be executed is divided into at least one subtask. In some embodiments, the task to be executed can be divided into at least one subtask based on the historical access event volume of the task. For example, Figure 3 As shown, if the amount of data in the Datahub pull task exceeds the first data volume threshold, the Datahub pull task needs to be split so that the average amount of data allocated to the split subtasks T_D1 and T_D2 is less than the first quantity threshold.

[0069] It should be understood that the embodiments of this application do not limit how the subtasks of the task to be executed are allocated to the servers. In some embodiments, the principle of equal distribution is adopted, and the subtasks of the task to be executed are evenly distributed to each server. In other embodiments, different servers may be instructed to execute at least one subtask according to the processing speed of different servers, so as to ensure that the speed at which each server executes the subtask in the same execution cycle is as similar as possible.

[0070] For example, such as Figure 3 As shown, T_D2 and T_RM1 can be assigned to server 1, T_H1 to server 2, and T_D1, T_R1, and T_RM2 to server 3.

[0071] S203. Based on the information of the task to be executed, execute the corresponding subtask of the server in the second execution cycle of the task to be executed.

[0072] In this step, after the server obtains the information of the task to be executed, it can instruct the assigned subtask based on the information of the task to be executed, and execute the corresponding subtask of the server in the second execution cycle of the task to be executed.

[0073] The second execution cycle is the cycle following the first execution cycle.

[0074] It should be understood that the embodiments of this application do not limit how the server executes the subtasks of the task to be executed. In some embodiments, the server can continuously pull the event data of the data source access corresponding to the task to be executed during the second execution cycle.

[0075] It should be noted that each subtask corresponds to a remote data pointer, which is used to identify the data point currently being fetched by the subtask. When the server executes the subtask, it can start fetching event data based on the data point currently being fetched by the subtask, as indicated by the remote data pointer.

[0076] In other embodiments, after the server executes the subtask corresponding to the server in the second execution cycle of the task to be executed, it can also determine the number of events accessed by the subtask corresponding to the server in the second execution cycle, and then update the historical access of the task to be executed in the list of tasks to be executed according to the number of events accessed in the second execution cycle.

[0077] It should be understood that the embodiments of this application do not limit how event data is accessed. In some embodiments, the server can receive an event access request from the terminal device for the subtask corresponding to the server, and access the new event in the subtask corresponding to the server according to the event access request.

[0078] The event access request includes the data source of the new event, the scheduling period of the new event, and the conversion method of the data format of the new event.

[0079] The task scheduling method provided in this application involves the server first performing a resource preemption operation during the first execution cycle of the task to be executed. This preemption operation is used to preempt the operation rights of the resources of the task to be executed. Subsequently, if the server successfully preempts the resources, it obtains the information of the task to be executed, which is used to indicate the server assigned to each subtask of the task. Finally, based on the information of the task to be executed, the server executes the corresponding subtask of the server during the second execution cycle of the task to be executed, which is the cycle following the first execution cycle. This method allocates the subtasks of the task to be executed to the server that successfully preempted the resources, achieving decentralization of the task to be executed, ensuring self-balancing of data traffic, and thus achieving stable access to event data.

[0080] Based on the above embodiments, the following explains how to update the historical access event volume of the task to be executed. Figure 4 This is a flowchart illustrating another task scheduling method provided in an embodiment of this application. Figure 4 As shown, the method includes:

[0081] S301. In the first execution cycle of the task to be executed, a resource preemption operation is performed on the task to be executed. The resource preemption operation is used to preempt the operation permission of the resources of the task to be executed, and the task to be executed is used to access event data.

[0082] In some embodiments, the information for the tasks to be executed includes a list of servers that have successfully preempted resources, a list of tasks to be executed, and a list of subtasks of the tasks to be executed.

[0083] The list of tasks to be executed includes the historical read time and the historical access event volume of the tasks to be executed; the list of subtasks of the tasks to be executed includes the server assigned to each subtask.

[0084] In some embodiments, subtasks of the task to be executed are generated by splitting the task based on the historical access event volume of the task to be executed.

[0085] S302. If the server resources are successfully preempted, the information of the task to be executed is obtained and a subtask to be executed in the second execution cycle is generated. The information of the task to be executed is used to indicate the server to which each subtask of the task to be executed is allocated.

[0086] S303. Based on the information of the task to be executed, execute the subtask corresponding to the server in the second execution cycle of the task to be executed. The second execution cycle is the cycle following the first execution cycle.

[0087] The technical terms, technical effects, technical features, and optional implementation methods of steps S301 to S303 can be found in [reference]. Figure 2 The steps S201 to S203 shown are understood, and repeated information will not be described again here.

[0088] S304. Determine the number of events that the subtask corresponding to the server will receive in the second execution cycle.

[0089] S305. Based on the number of events accessed in the second execution cycle, update the historical number of events accessed for the tasks to be executed in the list of tasks to be executed.

[0090] It should be noted that, in the embodiments of this application, the historical access event volume of the task to be executed updated in the previous cycle can be used to split the task to be executed into at least one sub-task in the next cycle.

[0091] For example, after updating the historical event volume of the task to be executed using the event volume of the second cycle, the updated historical event volume of the task to be executed can be used to re-split the task to be executed so that the re-split subtasks can be redistributed to each server in the third cycle.

[0092] Based on the above embodiments, the following explains how to access new events. Figure 5 This is a flowchart illustrating another task scheduling method provided in an embodiment of this application. Figure 5 As shown, the method includes:

[0093] S401. In the first execution cycle of the task to be executed, a resource preemption operation is performed on the task to be executed. The resource preemption operation is used to preempt the operation permission of the resources of the task to be executed, and the task to be executed is used to access event data.

[0094] S402. If the server resource preemption is successful, the information of the task to be executed is obtained and a subtask to be executed in the second execution cycle is generated. The information of the task to be executed is used to indicate the server to which each subtask of the task to be executed is allocated.

[0095] S403. Based on the information of the task to be executed, execute the subtask corresponding to the server in the second execution cycle of the task to be executed. The second execution cycle is the cycle following the first execution cycle.

[0096] The technical terms, technical effects, technical features, and optional implementation methods of steps S401 to S403 can be found in [reference]. Figure 2 The steps S201 to S203 shown are understood, and repeated information will not be described again here.

[0097] S404. Receive the event access request sent by the terminal device for the subtask corresponding to the server.

[0098] The event access request includes the data source of the new event, the scheduling period of the new event, and the conversion method of the data format of the new event.

[0099] For example, Figure 6 This is a schematic diagram of an event access request provided in an embodiment of this application. Figure 6 As shown, when a user submits an event access request using a terminal device, they can fill in the information for the new event on the event access request page. For example, the information about the data source for the new event may include the name of the configuration item from which the event source originates, the type of the event source, and its title. For example, the event access request page may also allow the user to fill in the start date and unit of the event's scheduling period. For example, the event access request page may also allow the user to fill in the data format conversion method, such as adding a constant and / or copying.

[0100] In this application, by converting the data format, it is possible to access event data with different configurations from multiple data sources, and to support traffic control expansion when pulling hundreds of millions of data points.

[0101] S405. Based on the event access request, access the new event in the corresponding subtask on the server.

[0102] In this embodiment of the application, by converting the data format of newly added events during event access, it is possible to configure and access event data from multiple data sources, thereby increasing the data range of task processing.

[0103] The task scheduling method provided in this application involves the server first performing a resource preemption operation during the first execution cycle of the task to be executed. This preemption operation is used to preempt the operation rights of the resources of the task to be executed. Subsequently, if the server successfully preempts the resources, it obtains the information of the task to be executed, which is used to indicate the server assigned to each subtask of the task. Finally, based on the information of the task to be executed, the server executes the corresponding subtask of the server during the second execution cycle of the task to be executed, which is the cycle following the first execution cycle. This method allocates the subtasks of the task to be executed to the server that successfully preempted the resources, achieving decentralization of the task to be executed, ensuring self-balancing of data traffic, and thus achieving stable access to event data.

[0104] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.

[0105] Figure 7 This is a schematic diagram of a task scheduling device provided in an embodiment of this application. This task scheduling device can be implemented through software, hardware, or a combination of both to execute the same task scheduling method described in the above embodiments. Figure 7 As shown, the task scheduling device 500 includes: a lock-grabbing module 501, an acquisition module 502, and an execution module 503.

[0106] The lock-grabbing module 501 is used to perform resource preemption operations on the task to be executed during the first execution cycle of the task to be executed. The resource preemption operation is used to preempt the operation rights of the resources of the task to be executed, and the task to be executed is used to access event data.

[0107] The acquisition module 502 is used to acquire information about the task to be executed if the task scheduling device successfully preempts the resources. The information about the task to be executed is used to indicate the task scheduling device allocated to each subtask of the task to be executed.

[0108] The execution module 503 is used to execute the subtask corresponding to the task scheduling device in the second execution cycle of the task to be executed, based on the information of the task to be executed. The second execution cycle is the cycle following the first execution cycle.

[0109] In one optional implementation, the information of the tasks to be executed includes a list of task scheduling devices that have successfully preempted resources, a list of tasks to be executed, and a list of subtasks of the tasks to be executed.

[0110] The list of tasks to be executed includes the historical read time and the number of historical access events for each task; the list of subtasks to be executed includes the task scheduling device assigned to each subtask.

[0111] In one alternative implementation, the subtasks of the task to be executed are generated by splitting them based on the historical access event volume of the task to be executed.

[0112] In an optional implementation, the execution module 503 is further configured to determine the number of events accessed by the subtask corresponding to the task scheduling device in the second execution cycle; and update the historical number of events accessed by the task to be executed in the list of tasks to be executed according to the number of events accessed in the second execution cycle.

[0113] In one optional implementation, the execution module 503 is further configured to receive an event access request from the terminal device for the subtask corresponding to the task scheduling device; and to access the new event in the subtask corresponding to the task scheduling device according to the event access request.

[0114] In one optional implementation, the event access request includes the data source of the new event, the scheduling period of the new event, and the conversion method of the data format of the new event.

[0115] In one alternative implementation, each subtask corresponds to a remote data pointer, which is used to mark the data point currently being retrieved by the subtask.

[0116] It needs to be explained that, Figure 7 The task scheduling apparatus provided in the illustrated embodiments can be used to execute the task scheduling method provided in any of the above embodiments. The specific implementation and technical effects are similar, and will not be described in detail here.

[0117] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device may include: multiple processors 601 and memory 602. Figure 8 The example is an electronic device with a processor, which can be the aforementioned server.

[0118] The memory 602 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.

[0119] Memory 602 may include high-speed RAM memory, and may also include non-volatile memory, such as multiple disk drives.

[0120] The processor 601 is used to execute computer execution instructions stored in the memory 602 to implement the above-described task scheduling method.

[0121] The processor 601 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0122] Optionally, in specific implementations, if the communication interface, memory 602, and processor 601 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0123] Optionally, in a specific implementation, if the communication interface, memory 602, and processor 601 are integrated on a single chip, then the communication interface, memory 602, and processor 601 can communicate through an internal interface.

[0124] It should be noted that, Figure 8 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0125] This application also provides a chip, including a processor and an interface. The interface is used to input and output data or instructions processed by the processor. The processor is used to execute the methods provided in the above method embodiments. This chip can be applied in a task scheduling device.

[0126] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a disk, or an optical disk. Specifically, the computer-readable storage medium stores program information, which is used in the above-mentioned task scheduling method.

[0127] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the task scheduling method described above.

[0128] This application also provides a computer program that causes a computer to perform the above-described task scheduling method.

[0129] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated. 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. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A task scheduling method, characterized in that, Applied to a server, the method includes: In the first execution cycle of the task to be executed, a resource preemption operation is performed on the task to be executed. The resource preemption operation is used to preempt the operation permission of the resources of the task to be executed. The task to be executed is used to access event data from different data sources. If the server resource preemption is successful, the information of the task to be executed is obtained. The information of the task to be executed includes a list of subtasks of the task to be executed. The subtasks in the list are generated by splitting the historical access event volume of the task to be executed, and servers for executing each subtask are pre-allocated. The historical access event volume of the task to be executed is determined. If the data volume of the historical access event volume exceeds a first data volume threshold, the task to be executed is split so that the data volume allocated to the split subtasks is less than the first data volume threshold. Based on the information of the task to be executed, the subtask corresponding to the server is executed in the second execution cycle of the task to be executed, and the second execution cycle is the next cycle after the first execution cycle; Receive an event access request from a terminal device for a subtask corresponding to the server; and add a new event to the subtask corresponding to the server based on the event access request.

2. The method according to claim 1, characterized in that, The information regarding tasks to be executed also includes a list of servers that have successfully preempted resources and a list of tasks to be executed. The list of tasks to be executed includes the historical read time and the historical access event volume of the tasks to be executed.

3. The method according to claim 2, characterized in that, After executing the subtask corresponding to the server in the second execution cycle of the task to be executed based on the information of the task to be executed, the method further includes: Determine the number of events that the subtask corresponding to the server receives in the second execution cycle; Based on the number of events accessed during the second execution cycle, update the historical number of events accessed for each task in the list of tasks to be executed.

4. The method according to claim 1, characterized in that, The event access request includes the data source of the new event, the scheduling period of the new event, and the conversion method of the data format of the new event.

5. The method according to any one of claims 1-4, characterized in that, Each subtask corresponds to a remote data pointer, which is used to mark the data point currently being retrieved by the subtask.

6. A task scheduling device, characterized in that, The device includes: The lock-grabbing module is used to perform a resource preemption operation on the task to be executed during the first execution cycle of the task to be executed. The resource preemption operation is used to preempt the operation permission of the resource of the task to be executed, which is used to access event data from different data sources. The acquisition module is used to acquire information about the task to be executed if the task scheduling device successfully preempts resources. The information about the task to be executed includes a list of subtasks of the task to be executed. The subtasks in the list are generated by splitting the task to be executed based on the historical access event volume of the task to be executed, and servers for executing each subtask are pre-allocated. The module also determines the historical access event volume of the task to be executed. If the data volume of the historical access event volume exceeds a first data volume threshold, the task to be executed is split so that the data volume allocated to the split subtasks is less than the first data volume threshold. An execution module is configured to execute the subtask corresponding to the server in the second execution cycle of the task to be executed, based on the information of the task to be executed, wherein the second execution cycle is the next cycle after the first execution cycle; The execution module is further configured to receive an event access request from the terminal device for the subtask corresponding to the task scheduling device; and to access a new event in the subtask corresponding to the task scheduling device according to the event access request.

7. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Distributed task running method, system and equipment

    CN110609749A

  • Task scheduling method, device, electronic equipment and medium

    CN111641678A

  • Task running method and device, computer equipment and storage medium

    CN114237870A