CN115292021A - Task scheduling method, system, electronic device and readable storage medium - Google Patents

Task scheduling method, system, electronic device and readable storage medium Download PDF

Info

Publication number
CN115292021A
CN115292021A CN202211187098.7A CN202211187098A CN115292021A CN 115292021 A CN115292021 A CN 115292021A CN 202211187098 A CN202211187098 A CN 202211187098A CN 115292021 A CN115292021 A CN 115292021A
Authority
CN
China
Prior art keywords
scheduling
task
scheduled
tasks
servers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211187098.7A
Other languages
Chinese (zh)
Inventor
田丰
黄伟
祝华锋
徐晓明
丁建中
万姜涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Firefly Microelectronics Technology Co ltd
Original Assignee
Jiangxi Firefly Microelectronics Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangxi Firefly Microelectronics Technology Co ltd filed Critical Jiangxi Firefly Microelectronics Technology Co ltd
Priority to CN202211187098.7A priority Critical patent/CN115292021A/en
Publication of CN115292021A publication Critical patent/CN115292021A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a task scheduling method, a task scheduling system, electronic equipment and a readable storage medium, and belongs to the technical field of multitask data processing; the method comprises the steps of collecting and screening batch tasks required to be scheduled in a current session to form a task set to be scheduled; performing sequence ordering on tasks to be scheduled according to a preset scheduling sequence table to obtain a sequence scheduling task set; confirming a plurality of callable servers from the current slave servers according to the running state of the current slave servers; grouping the ordered scheduling tasks in the sequential scheduling task set based on the number of the callable servers and the available space capacity of the callable servers; and respectively sending the grouped sequenced scheduling tasks to corresponding target callable servers so as to enable the callable servers to execute the scheduling of the batch tasks required to be scheduled in the current field. By the method and the device, efficient operation of task scheduling can be realized, and the defects of the task priority and the scheduling scheme of distributed processing in the prior art are overcome.

Description

Task scheduling method, system, electronic device and readable storage medium
Technical Field
The invention belongs to the technical field of multitask data processing, and particularly relates to a task scheduling method and system, electronic equipment and a readable storage medium.
Background
With the development of computer technology, there is a situation of scheduling multi-task execution in the running process of a computer, and the execution sequence of the multi-task is reasonably arranged, which is beneficial to reducing the time of overall task execution and improving the efficiency of task execution. Currently, a scheduling scheme based on task priority is used in many fields, such as thread scheduling in an operating system, scheduling of workshop workpieces in a production line, and the like. And distributing the accumulated batch operation tasks to different sub-servers for processing based on a distributed processing scheduling scheme, wherein the scheme realizes synchronous processing of different operation tasks through distributed scheduling to improve the execution efficiency of task data.
The task priority and the task scheduling scheme of distributed processing in the prior art can achieve the purpose of improving the task scheduling efficiency. However, in some service scenarios, the task priority scheduling scheme has the disadvantages that the task attributes to be scheduled are rich, and the priority is only partially implemented, so that the efficiency of task scheduling cannot be influenced due to the fact that better scheduling operation cannot be guaranteed; and the dispatching scheme of distributed processing has a fixed dispatching and distributing mode for the batch tasks, and the processing efficiency of the slave server for the batch tasks is not high due to the fact that the dispatching scheme cannot be adaptively adjusted.
Therefore, how to design an efficient task scheduling method is important.
Disclosure of Invention
In order to solve the technical problems, the invention provides a task scheduling method, a task scheduling system, an electronic device and a readable storage medium, wherein after a batch task to be scheduled is screened, the screened batch task is optimally sequenced in a priority mode, the optimally sequenced batch tasks are grouped according to the number of determined callable servers and the available space capacity of the callable servers, and the grouped tasks are mapped in a correlated manner, so that the callable servers synchronously execute the scheduling of the batch task to be scheduled, and the efficient operation of task scheduling is realized.
In a first aspect, the present application provides a task scheduling method, including:
collecting and screening batch tasks required to be scheduled in the current session to form a task set to be scheduled;
generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled;
sequencing the tasks to be scheduled in the task set to be scheduled in a sequence mode according to the preset scheduling sequence table to obtain a sequence scheduling task set;
confirming a plurality of callable servers from the current slave server according to the running state of the current slave server;
grouping the ordered scheduling tasks in the ordered scheduling task set based on the number of callable servers and the available space capacity thereof;
and respectively sending the grouped sequenced scheduling tasks to corresponding target callable servers so as to enable the callable servers to execute scheduling of batch tasks required to be scheduled in the current session.
Preferably, the step of collecting and screening the batch tasks required to be scheduled in the current session to form the task set to be scheduled specifically includes:
receiving task scheduling requests every other preset time length, and collecting batch tasks needing to be scheduled existing in the current field when the task scheduling requests are obtained;
judging whether the batch tasks carry the matched keys one by one so as to screen out the matched target tasks from the batch tasks;
if yes, collecting the adaptive target tasks to form a task set to be scheduled;
and if not, deleting the non-adaptive target tasks in the batch tasks.
Preferably, the step of generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled specifically includes:
sequencing the adaptive target tasks according to the priority and the scheduling starting time of each adaptive target task in the to-be-scheduled task set to obtain a pre-processed to-be-scheduled task set;
scheduling and distributing the tasks in the task set to be scheduled based on the preprocessing in sequence to obtain a prefabricated task scheduling table and an unscheduled task set;
and scheduling all tasks in the unscheduled task set according to the prefabricated scheduling task table according to a preset rule to generate a preset scheduling order table.
Preferably, the preset rule refers to adopting a traversal method and an interpolation method based on task scheduling starting time so that the unscheduled tasks in the unscheduled task set are inserted into the pre-made task scheduling table.
Preferably, the step of confirming a plurality of callable servers from the current slave server according to the running state of the current slave server specifically includes:
when the task scheduling request is obtained, confirming a port number required by the current slave server to execute the task set to be scheduled, and obtaining state information of the port number;
calculating the adjustable rate of the corresponding port according to the state information, and judging whether the adjustable rate exceeds a preset threshold value or not;
if so, determining the current slave server corresponding to the port with the adjustable rate exceeding the preset threshold value as an invokable server;
if not, determining the current slave server corresponding to the port with the adjustable rate not exceeding the preset threshold value as the non-invokable server.
Preferably, the step of grouping the ordered scheduling tasks in the in-order scheduling task set based on the number of the callable servers and the available space capacity thereof specifically includes:
sequencing the callable servers according to the sequence of the usable space capacity of the callable servers from large to small, and labeling each callable server from small to large;
sequentially grouping the sequenced scheduling tasks in the sequential scheduling task set by taking the number of the callable servers as a basic unit to obtain a grouped sequenced scheduling task group;
and performing pre-established association mapping on the sorted scheduling task group according to the sorting number and the label of the calling server so as to enable the sorted scheduling task group and the calling server to be arranged in a one-to-one correspondence manner.
Preferably, the pre-established association mapping means that the number of the callable server and the group number of the ordered scheduling task group are mapped to each other from small to large.
In a second aspect, the present application provides a task scheduling system, comprising:
the screening module is used for collecting and screening the batch tasks required to be scheduled in the current session to form a task set to be scheduled;
the generating module is used for generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled;
the sequencing module is used for sequencing the tasks to be scheduled in the task set to be scheduled in a sequence mode according to the preset scheduling sequence table to obtain a sequence scheduling task set;
the confirming module is used for confirming a plurality of callable servers from the current slave servers according to the running state of the current slave servers;
a grouping module for grouping the ordered scheduling tasks in the in-order scheduling task set based on the number of the callable servers and the available space capacity thereof;
and the execution module is used for respectively sending the grouped sequenced scheduling tasks to the corresponding target callable servers so as to enable the callable servers to execute the scheduling of the batch tasks required to be scheduled in the current field.
Preferably, the screening module comprises:
the system comprises a collecting unit, a scheduling unit and a scheduling unit, wherein the collecting unit is used for receiving task scheduling requests every other preset time length and collecting batch tasks needing to be scheduled in the current field when the task scheduling requests are obtained;
the screening unit is used for judging whether the batch tasks carry the matched keys one by one so as to screen the matched target tasks from the batch tasks;
and the collecting unit is used for collecting the adaptive target tasks to form a task set to be scheduled if the batch tasks are judged to carry the adaptive keys.
Preferably, the screening module further comprises:
and the deleting unit is used for deleting the non-adaptive target tasks in the batch tasks if the batch tasks do not carry the adaptive key.
Preferably, the generating module includes:
the ordering unit is used for ordering the adaptive target tasks according to the priority and the scheduling starting time of each adaptive target task in the task set to be scheduled to obtain a preprocessed task set to be scheduled;
the distribution unit is used for sequentially scheduling and distributing the tasks in the task set to be scheduled based on the preprocessing to obtain a pre-scheduled task scheduling table and an unscheduled task set;
and the scheduling unit is used for scheduling all the tasks in the unscheduled task set according to the prefabricated scheduling task table according to a preset rule to generate a preset scheduling order table.
Preferably, the confirmation module comprises:
the acquiring unit is used for confirming the port number required by the current slave server to execute the task set to be scheduled and acquiring the state information of the port number while acquiring the task scheduling request;
the calculating unit is used for calculating the adjustable rate of the corresponding port according to the state information and judging whether the adjustable rate exceeds a preset threshold value or not;
and the confirming unit is used for confirming the current slave server corresponding to the port with the adjustable rate exceeding the preset threshold value as the callable server if the adjustable rate is judged to exceed the preset threshold value.
Preferably, the confirmation module further comprises:
and the determining unit is used for determining the current slave server corresponding to the port with the adjustable rate not exceeding the preset threshold value as the non-callable server if the adjustable rate is judged not to exceed the preset threshold value.
Preferably, the grouping module comprises:
the ordering unit is used for ordering the callable servers according to the sequence of the usable space capacity of the callable servers from large to small and labeling each callable server from small to large;
the grouping unit is used for sequentially grouping the sequenced scheduling tasks in the sequence scheduling task set by taking the number of the callable servers as a basic unit to obtain a grouped sequenced scheduling task group;
and the mapping unit is used for performing pre-established association mapping on the sorted scheduling task group and the reference number of the callable server according to the sorting number so as to enable the sorted scheduling task group and the callable server to be arranged in a one-to-one correspondence manner.
In a third aspect, the present application provides an electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the method of task scheduling according to the first aspect.
In a fourth aspect, the present application provides a readable storage medium storing a computer program, which when executed by a processor, implements the task scheduling method according to the first aspect.
Compared with the prior art, according to the task scheduling method, the task scheduling system, the electronic device and the readable storage medium, when the task scheduling request is obtained, the batch tasks required to be scheduled in the current session are collected, and the batch tasks required to be scheduled in the current session are screened through the secret key to form a task set to be scheduled, so that the tasks which are not adapted are screened to reduce the subsequent scheduling amount; a preset scheduling order table is generated based on the information of the tasks to be scheduled in the task set to be scheduled, so that the tasks to be scheduled are ordered in order to obtain an order scheduling task set, the situation that the order scheduling task set is locally and optimally scheduled is avoided, and the scheduling efficiency of batch tasks is improved; the optimal ordered batch tasks are grouped according to the number of the confirmed callable servers and the available space capacity of the callable servers, and are mapped in a correlated mode, so that the callable servers synchronously execute the scheduling of the batch tasks to be scheduled, and the batch tasks further adopt a synchronous distributed scheduling mode on the basis of the scheduling priority in the universe range, thereby further improving the scheduling efficiency of the batch tasks and realizing the efficient operation of task scheduling.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a task scheduling method according to embodiment 1 of the present invention;
fig. 2 is a detailed flowchart of step S101 of a task scheduling method according to embodiment 1 of the present invention;
fig. 3 is a detailed flowchart of step S102 of the task scheduling method according to embodiment 1 of the present invention;
fig. 4 is a detailed flowchart of step S104 of the task scheduling method according to embodiment 1 of the present invention;
fig. 5 is a detailed flowchart of step S105 of the task scheduling method according to embodiment 1 of the present invention;
fig. 6 is a block diagram of a task scheduling system corresponding to the method in embodiment 1 according to embodiment 2 of the present invention;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to embodiment 3 of the present invention.
Description of reference numerals:
10-screening module, 11-collecting unit, 12-screening unit, 13-compiling unit;
20-generation module, 21-ordering unit, 22-allocation unit and 23-scheduling unit;
30-a sorting module;
40-confirmation module, 41-acquisition unit, 42-calculation unit and 43-confirmation unit;
50-grouping module, 51-marking unit, 52-grouping unit and 53-mapping unit;
60-an execution module;
70-bus, 71-processor, 72-memory, 73-communication interface.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The embodiment of the application is particularly applied to large data server products, such as various links of data disclosure and entry processing for banks. The following example is presented by way of example of a banking scheduling process for data entered at various counters.
Example 1
Specifically, fig. 1 is a schematic flow chart of a task scheduling method provided in this embodiment.
As shown in fig. 1, the task scheduling method of this embodiment includes the following steps:
s101, collecting and screening batch tasks required to be scheduled in the current session to form a task set to be scheduled.
Specifically, in the operation process of the banking industry, daily counter tellers need to undertake a plurality of services, a plurality of data diffracted by the services generally need to be recorded and cached, and tasks to be scheduled are formed to wait for the scheduling processing of the total server. In the actual operation process, the general server needs to receive a request instruction for task scheduling before scheduling, correspondingly collects tasks to be scheduled after receiving related instructions, and examines the collected related tasks to be scheduled so as to prevent task items derived from null instructions or unrelated instructions.
Further, as shown in fig. 2, the specific steps of step S101 include:
s1011, receiving task scheduling requests every other preset time, and collecting batch tasks needing to be scheduled in the current field when the task scheduling requests are obtained.
Specifically, the total server in this embodiment generates a search instruction every 10 minutes, and queries whether there is an instruction of a task scheduling request in each counter in the area; the task scheduling request is generated by different tellers or the same teller according to a service submitted by the main server for a period of time before the main server generates a search instruction, and when the service is input and submitted, a task scheduling request instruction is generated and sent to the main server; when the main server receives the task scheduling request, the tasks required to be scheduled corresponding to the task scheduling request instruction are collected, so that the main server collects the batch tasks existing in the current field.
And S1012, judging whether the batch tasks carry the matched keys one by one so as to screen the matched target tasks from the batch tasks.
Specifically, the main server is in a signal open state, so that signals can be received in time; however, in consideration of the security and accuracy of the data stored in the bank, it is necessary to set a key for the task to be scheduled generated by each counter teller, perform relevant scheduling processing only for the business data within the business scope, and eliminate other signals and wrong tasks received by the main server.
And S1013, if so, collecting the adaptation target tasks to form a task set to be scheduled.
Specifically, different services simultaneously held by a plurality of counters can be received at the same time period, different tasks to be scheduled are generated by the different services held, and due to the fact that human data entry errors and other interference signals exist, in order to avoid the adverse situation, the adverse situation enters a main server for subsequent processing, batch tasks need to be screened to screen adaptive target tasks; in order to facilitate the uniform processing of the screened different adaptation target tasks, the screened different adaptation target tasks need to be collected to form a corresponding task set to be scheduled. It should be noted that, in other embodiments, if it is determined that the batch tasks do not carry the adapted key, the non-adapted target task in the batch tasks is deleted.
And S102, generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled.
Specifically, in order to facilitate subsequent distributed processing on the task set to be scheduled, the tasks to be scheduled in the task set to be scheduled need to be subjected to position sequencing according with the current processing mode, so as to improve the scheduling efficiency of subsequent distributed processing.
Further, as shown in fig. 3, the specific steps of step S102 include:
and S1021, sequencing the adaptive target tasks according to the priority and the scheduling starting time of each adaptive target task in the task set to be scheduled to obtain a task set to be preprocessed and scheduled.
Specifically, each adaptation target task corresponds to information such as task start time, task deadline, task execution time, and task priority of the adaptation target task. In this embodiment, the related sorting manner is as follows: and sequencing the adaptive target tasks according to the priority, and sequencing the adaptive target tasks with the same priority according to the front and back of the scheduling starting time to obtain a pre-processing task set to be scheduled.
S1022, based on the task in the preprocessing task set to be scheduled, the tasks are scheduled and distributed in sequence, and a pre-scheduled task scheduling table and an unscheduled task set are obtained.
Specifically, in the actual operation process, since one adaptation target task may completely or partially coincide with another adaptation target task at the same time period, in the specific sorting process, an unsorted adaptation target task may occur, which becomes an unscheduled task, and such unscheduled tasks are collected to form an unscheduled task set. In addition, it should be noted that if there is no task in the unscheduled task set, it indicates that all tasks in the pre-processed to-be-scheduled task set have been scheduled, and determines the pre-scheduled task schedule table as the preset scheduling order table.
And S1023, scheduling all tasks in the unscheduled task set according to a preset rule according to the preset scheduling task table to generate a preset scheduling order table.
And the preset rule is that a traversal method and an interpolation method are adopted based on task scheduling starting time so that unscheduled tasks in the unscheduled task set are inserted into the prefabricated task scheduling table. Specifically, for example, two tasks in the pre-scheduled task table are A, B, the scheduling time of task a is 10.
S103, sequencing the tasks to be scheduled in the task set to be scheduled in a sequence according to the preset scheduling sequence table to obtain a sequence scheduling task set.
Specifically, due to the fact that the scheduling time is overlapped or partially overlapped, relevant changes are carried out on the tasks according to the specific scheduling time so that the tasks can be inserted into the pre-scheduling task table, therefore, the correct sequence of all the adaptive target tasks is obtained, the correct, heavy, slow and urgent scheduling sequence of the adaptive target tasks is reflected, and the corresponding sequence scheduling task set is generated based on the sequence.
And S104, confirming a plurality of callable servers from the current slave servers according to the running state of the current slave servers.
In particular, the master server in the distributed system has a plurality of ports on which the slave servers can perform processing of different tasks. The port number is information uniquely representing one type of port, for example, a plurality of slave servers each have an evaluation port, and at this time, the evaluation ports in the slave servers have the same port number, and the operation state thereof is evaluated through the ports.
Further, as shown in fig. 4, the specific steps of step S104 include:
s1041, when the task scheduling request is obtained, confirming a port number required by the current slave server to execute the task set to be scheduled, and obtaining state information of the port number.
Specifically, after the master server determines the task type of each subtask in the batch task, the master server determines the port number required for processing the batch task according to the corresponding relationship between the subtask type and the port number, and the slave server reports the state information of the port corresponding to the port number according to the state query request. Status information as referred to herein refers to related information that can directly or indirectly reflect port capabilities.
S1042, calculating the adjustable rate of the corresponding port according to the state information, and judging whether the adjustable rate exceeds a preset threshold value.
Specifically, the main server calculates the spatial idle rate of the corresponding port according to the state information of the port, and determines the adjustable rate of the response port according to the spatial idle rate. It should be noted that the main server may pre-establish a corresponding relationship between the space idle rate and the adjustable rate, and then determine the adjustable rate corresponding to the port according to the corresponding relationship.
And S1043, if yes, determining the current slave server corresponding to the port with the adjustable rate exceeding the preset threshold value as an invokable server.
Specifically, it should be noted that when a status query request is received from a server, a port in the slave server only counts current status information, and does not count status information that is older than the current expiration, so that the master server can perform statistical analysis on the latest status information, so as to improve the accuracy of the tunable rate. It should be noted that in other implementations, if it is determined that the adjustable rate does not exceed the preset threshold, the current slave server corresponding to the port whose adjustable rate does not exceed the preset threshold is determined as the non-callable server.
S105, grouping the ordered scheduling tasks in the sequential scheduling task set based on the number of the callable servers and the available space capacity of the callable servers.
Specifically, the purpose of grouping based on the number of the callable servers and the available space capacity thereof in the present embodiment is to enable the task scheduling order to always make the priority order of the adaptation target tasks consistent, and ensure that the most urgent adaptation target tasks are preferentially scheduled and processed.
Further, as shown in fig. 5, the specific steps of step S105 include:
s1051, sorting the callable servers according to the sequence of the usable space capacity from large to small, and labeling each callable server from small to large.
Specifically, the callable servers are sorted from large to small according to the available space capacity, and the callable servers with large available space capacity are used for explaining that the built-in task quantity is minimum, and the callable servers can start the scheduling of the current adaptation target task in the shortest time, so that the urgent adaptation target task can be processed in time.
And S1052, sequentially grouping the sequenced scheduling tasks in the sequence scheduling task set by taking the number of the callable servers as a basic unit to obtain a grouped sequenced scheduling task group.
Specifically, for example, the number of callable servers is 10, the number of the scheduled tasks in the sorted order is 100, and the 100 tasks are grouped into a group of 10 according to the sorted order of the scheduled tasks, that is, the top ten of the 100 sorted scheduled tasks in the sorted order is the first group, the top eleven to the top twenty are the second groups, and so on, so as to form a group of 10 sorted scheduled tasks.
And S1053, performing pre-fabricated associated mapping on the sorted scheduling task group and the reference number of the calling server according to the sorting number, so that the sorted scheduling task group and the calling server are arranged in a one-to-one correspondence manner.
The preset association mapping refers to the mutual mapping from small to large between the label of the callable server and the group number of the ordered scheduling task group. Specifically, for example, if the reference number of the callable server is 1, the group number of the corresponding ordered scheduling task group is the first group; the number of the callable server is 2, and the group number of the corresponding sequenced scheduling task group is a second group; and so on.
S106, the grouped ordered scheduling tasks are respectively sent to corresponding target callable servers, so that the callable servers execute scheduling of batch tasks required to be scheduled in the current field.
Specifically, targets corresponding to the starting values of the sorted scheduling tasks can be called in the server through the corresponding sorted scheduling task group and the calling server, so that the most urgent adaptive target task is guaranteed to be scheduled and processed preferentially.
In summary, when the task scheduling request is obtained, collecting the batch tasks required to be scheduled in the current session, and screening the batch tasks required to be scheduled in the current session through the secret key to form a task set to be scheduled, so as to screen the tasks which are not adapted to reduce the amount of subsequent scheduling; a preset scheduling order table is generated based on information of the tasks to be scheduled in the task set to be scheduled, so that the tasks to be scheduled are ordered in order to obtain an order scheduling task set, the situation that the order scheduling task set is locally and optimally scheduled is avoided, and the scheduling efficiency of batch tasks is improved; the batch tasks which are optimally sequenced are grouped according to the number of the determined callable servers and the available space capacity of the callable servers, and are mapped in a correlated manner, so that the callable servers synchronously execute the scheduling of the batch tasks which need to be scheduled, and the batch tasks further adopt a synchronous distributed scheduling mode on the basis of the scheduling priority in the global range, thereby further improving the scheduling efficiency of the batch tasks and realizing the efficient operation of task scheduling.
Example 2
This embodiment provides a block diagram of a system corresponding to the method described in embodiment 1. Fig. 6 is a block diagram of a task scheduling system according to an embodiment of the present application, and as shown in fig. 6, the system includes:
the screening module 10 is used for collecting and screening batch tasks required to be scheduled in a current session to form a task set to be scheduled;
a generating module 20, configured to generate a preset scheduling order table based on information of the to-be-scheduled tasks in the to-be-scheduled task set;
the sequencing module 30 is configured to sequence the tasks to be scheduled in the task set to be scheduled according to the preset scheduling order table to obtain a sequence scheduling task set;
the confirming module 40 is used for confirming a plurality of callable servers from the current slave server according to the running state of the current slave server;
a grouping module 50, configured to group the ordered scheduling tasks in the in-order scheduling task set based on the number of the callable servers and the available space capacity thereof;
and an executing module 60, configured to send the grouped sorted scheduling tasks to corresponding target callable servers respectively, so that the callable servers execute scheduling of batch tasks required to be scheduled in the current session.
Further, the screening module 10 includes:
the system comprises a collecting unit 11, a scheduling unit and a scheduling unit, wherein the collecting unit 11 is used for receiving task scheduling requests every other preset time length and collecting batch tasks needing to be scheduled in the current field when the task scheduling requests are obtained;
the screening unit 12 is configured to determine whether the batch tasks carry the adapted keys one by one, so as to screen the adapted target tasks from the batch tasks;
and the collecting unit 13 is configured to collect the adaptation target tasks to form a task set to be scheduled if it is determined that the batch tasks carry the adapted keys.
Preferably, the screening module 10 further comprises:
and the deleting unit is used for deleting the non-adaptive target tasks in the batch tasks if the batch tasks do not carry the adaptive key.
Further, the generating module 20 includes:
the sorting unit 21 is configured to sort the adaptation target tasks according to the priority and the scheduling start time of each adaptation target task in the to-be-scheduled task set, so as to obtain a pre-processed to-be-scheduled task set;
the allocation unit 22 is configured to sequentially schedule and allocate tasks in the pre-processed task set to be scheduled to obtain a pre-scheduled task scheduling table and an unscheduled task set;
and the scheduling unit 23 is configured to schedule all tasks in the unscheduled task set according to the prefabricated scheduling task table according to a preset rule, and generate a preset scheduling order table.
Further, the confirmation module 40 includes:
an obtaining unit 41, configured to, while obtaining the task scheduling request, confirm a port number required for executing the task set to be scheduled from the current slave server, and obtain state information of the port number;
the calculating unit 42 is configured to calculate an adjustable rate of the corresponding port according to the state information, and determine whether the adjustable rate exceeds a preset threshold;
a confirming unit 43, configured to confirm, if it is determined that the adjustable rate exceeds the preset threshold, the current slave server corresponding to the port whose adjustable rate exceeds the preset threshold as an invokable server.
Preferably, the confirmation module 40 further comprises:
and the determining unit is used for determining the current slave server corresponding to the port with the adjustable rate not exceeding the preset threshold value as the non-callable server if the adjustable rate is judged not to exceed the preset threshold value.
Further, the grouping module 50 includes:
a labeling unit 51, configured to sort the callable servers according to a descending order of the available space capacity of the callable servers, and label each callable server from a descending order to a ascending order;
a grouping unit 52, configured to group the sorted scheduling tasks in the order scheduling task set in sequence based on the number of servers that can be called, to obtain a grouped sorted scheduling task group;
and the mapping unit 53 is configured to perform pre-association mapping on the sorted scheduling task groups and the labels of the callable servers according to the sorting numbers, so that the sorted scheduling task groups and the callable servers are arranged in a one-to-one correspondence manner.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
Example 3
The task scheduling method described in connection with fig. 1 may be implemented by an electronic device. Fig. 7 is a schematic diagram of a hardware configuration of the apparatus according to the present embodiment.
The apparatus may comprise a processor 71 and a memory 72 in which computer program instructions are stored.
In particular, the processor 71 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 72 may include, among other things, mass storage for data or instructions. By way of example, and not limitation, memory 72 may include a Hard Disk Drive (Hard Disk Drive, abbreviated to HDD), a floppy Disk Drive, a Solid State Drive (SSD), flash memory, an optical Disk, a magneto-optical Disk, tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 72 may include removable or non-removable (or fixed) media, where appropriate. The memory 72 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 72 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, memory 72 includes Read-Only Memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or FLASH Memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), where the DRAM may be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended Data Out Dynamic Random Access Memory (EDODRAM), a Synchronous Dynamic Random Access Memory (SDRAM), and the like.
The memory 72 may be used to store or cache various data files that need to be processed and/or used for communication, as well as possible computer program instructions executed by the processor 71.
The processor 71 realizes the task scheduling method of embodiment 1 described above by reading and executing the computer program instructions stored in the memory 72.
In some of these embodiments, the device may also include a communication interface 73 and a bus 70. As shown in fig. 7, the processor 71, the memory 72, and the communication interface 73 are connected via the bus 70 to complete mutual communication.
The communication interface 73 is used for realizing communication among modules, devices, units and/or equipment in the embodiment of the present application. The communication interface 73 may also enable communication with other components such as: the data communication is carried out among external equipment, image/data acquisition equipment, a database, external storage, an image/data processing workstation and the like.
The bus 70 comprises hardware, software, or both that couple the components of the device to one another. Bus 70 includes, but is not limited to, at least one of the following: data Bus (Data Bus), address Bus (Address Bus), control Bus (Control Bus), expansion Bus (Expansion Bus), and Local Bus (Local Bus). By way of example and not limitation, bus 70 may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (FSB), a Hyper Transport (HT) Interconnect, an ISA (ISA) Bus, an InfiniBand (InfiniBand) Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a microchannel Architecture (MCA) Bus, a PCI (Peripheral Component Interconnect) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a vlslave Bus, a Video Bus, or a combination of two or more of these suitable electronic buses. Bus 70 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the present application, any suitable buses or interconnects are contemplated by the present application.
The device may execute the task scheduling method according to embodiment 1 of the present application based on the acquired task scheduling system.
In addition, in combination with the task scheduling method in embodiment 1, the embodiment of the present application may provide a storage medium to implement. The storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement the task scheduling method of embodiment 1 described above.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method for task scheduling, comprising:
collecting and screening batch tasks required to be scheduled in the current session to form a task set to be scheduled;
generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled;
sequencing the tasks to be scheduled in the task set to be scheduled in a sequence according to the preset scheduling sequence table to obtain a sequence scheduling task set;
confirming a plurality of callable servers from the current slave server according to the running state of the current slave server;
grouping the ordered scheduling tasks in the ordered scheduling task set based on the number of callable servers and the available space capacity thereof;
and respectively sending the grouped sequenced scheduling tasks to corresponding target callable servers so as to enable the callable servers to execute scheduling of batch tasks required to be scheduled in the current session.
2. The task scheduling method according to claim 1, wherein the step of collecting and screening the batch tasks required to be scheduled in the current session to form the task set to be scheduled specifically comprises:
receiving a task scheduling request every other preset time length, and collecting batch tasks needing to be scheduled existing in the current field when the task scheduling request is obtained;
judging whether the batch tasks carry the matched keys one by one so as to screen out the matched target tasks from the batch tasks;
if yes, collecting the adaptive target tasks to form a task set to be scheduled;
and if not, deleting the non-adaptive target tasks in the batch tasks.
3. The task scheduling method according to claim 1, wherein the step of generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled specifically comprises:
sequencing the adaptive target tasks according to the priority and scheduling starting time of each adaptive target task in the task set to be scheduled to obtain a preprocessed task set to be scheduled;
scheduling and distributing the tasks in the task set to be scheduled based on the preprocessing in sequence to obtain a prefabricated task scheduling table and an unscheduled task set;
and scheduling all tasks in the unscheduled task set according to the prefabricated scheduling task table according to a preset rule to generate a preset scheduling order table.
4. The method according to claim 3, wherein the predetermined rule is based on a task scheduling start time by taking a traversal and interpolation to insert the set of unscheduled tasks into the pre-made task schedule.
5. The task scheduling method according to claim 1, wherein the step of determining a plurality of callable servers from the current slave server according to the operating status of the current slave server specifically comprises:
when the task scheduling request is obtained, confirming a port number required by the current slave server to execute the task set to be scheduled, and obtaining state information of the port number;
calculating the adjustable rate of the corresponding port according to the state information, and judging whether the adjustable rate exceeds a preset threshold value or not;
if so, confirming the current slave server corresponding to the port with the adjustable rate exceeding the preset threshold value as an adjustable server;
if not, determining the current slave server corresponding to the port with the adjustable rate not exceeding the preset threshold value as the non-invokable server.
6. The task scheduling method according to claim 1, wherein the step of grouping the ordered scheduled tasks in the ordered set of scheduled tasks based on the number of callable servers and the available space capacity thereof specifically comprises:
sequencing the callable servers according to the sequence of the usable space capacity of the callable servers from large to small, and labeling each callable server from small to large;
sequentially grouping the sequenced scheduling tasks in the sequential scheduling task set by taking the number of the callable servers as a basic unit to obtain a grouped sequenced scheduling task group;
and performing pre-established association mapping on the sorted scheduling task group according to the sorting number and the label of the calling server so as to enable the sorted scheduling task group and the calling server to be arranged in a one-to-one correspondence manner.
7. The task scheduling method according to claim 6, wherein the pre-established association mapping is a mutual mapping between the number of the callable server and the group number of the ordered scheduling task group from small to large.
8. A task scheduling system, comprising:
the screening module is used for collecting and screening the batch tasks required to be scheduled in the current session to form a task set to be scheduled;
the generating module is used for generating a preset scheduling order table based on the information of the tasks to be scheduled in the task set to be scheduled;
the sequencing module is used for sequencing the tasks to be scheduled in the task set to be scheduled in a sequence according to the preset scheduling sequence table to obtain a sequence scheduling task set;
the confirming module is used for confirming a plurality of callable servers from the current slave servers according to the running state of the current slave servers;
a grouping module for grouping the ordered scheduling tasks in the in-order scheduling task set based on the number of the callable servers and the available space capacity thereof;
and the execution module is used for respectively sending the grouped sequenced scheduling tasks to the corresponding target callable servers so as to enable the callable servers to execute the scheduling of the batch tasks required to be scheduled in the current field.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor;
wherein the memory stores computer program instructions executable by the at least one processor to enable the at least one processor to perform the method of task scheduling according to any one of claims 1 to 7.
10. A readable storage medium storing a computer program which, when executed by a processor, implements the task scheduling method according to any one of claims 1 to 7.
CN202211187098.7A 2022-09-28 2022-09-28 Task scheduling method, system, electronic device and readable storage medium Pending CN115292021A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211187098.7A CN115292021A (en) 2022-09-28 2022-09-28 Task scheduling method, system, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211187098.7A CN115292021A (en) 2022-09-28 2022-09-28 Task scheduling method, system, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN115292021A true CN115292021A (en) 2022-11-04

Family

ID=83833150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211187098.7A Pending CN115292021A (en) 2022-09-28 2022-09-28 Task scheduling method, system, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN115292021A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147413A1 (en) * 2015-11-24 2017-05-25 Microsoft Technology Licensing, Llc Precondition exclusivity mapping of tasks to computational locations
CN110955516A (en) * 2019-10-30 2020-04-03 深圳供电局有限公司 Batch task processing method and device, computer equipment and storage medium
CN111813845A (en) * 2020-06-29 2020-10-23 平安国际智慧城市科技股份有限公司 ETL task-based incremental data extraction method, device, equipment and medium
CN112306661A (en) * 2020-11-06 2021-02-02 平安科技(深圳)有限公司 Task scheduling method and device, electronic equipment and readable storage medium
CN112559143A (en) * 2020-12-04 2021-03-26 海南车智易通信息技术有限公司 Task scheduling method and system and computing device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147413A1 (en) * 2015-11-24 2017-05-25 Microsoft Technology Licensing, Llc Precondition exclusivity mapping of tasks to computational locations
CN110955516A (en) * 2019-10-30 2020-04-03 深圳供电局有限公司 Batch task processing method and device, computer equipment and storage medium
CN111813845A (en) * 2020-06-29 2020-10-23 平安国际智慧城市科技股份有限公司 ETL task-based incremental data extraction method, device, equipment and medium
CN112306661A (en) * 2020-11-06 2021-02-02 平安科技(深圳)有限公司 Task scheduling method and device, electronic equipment and readable storage medium
CN112559143A (en) * 2020-12-04 2021-03-26 海南车智易通信息技术有限公司 Task scheduling method and system and computing device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
XINPENG LI等: "A parallel evaluation method of health degree based on MapReduce for smart grid dispatching and control system", 《 2017 9TH INTERNATIONAL CONFERENCE ON ADVANCED INFOCOMM TECHNOLOGY (ICAIT)》 *
李欣等: "基于Linux的嵌入式实时操作系统任务调度算法优化", 《自动化与仪器仪表》 *
王强等: "实时系统中的非定期任务调度算法综述", 《计算机研究与发展》 *

Similar Documents

Publication Publication Date Title
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN108241539B (en) Interactive big data query method and device based on distributed system, storage medium and terminal equipment
CN103401698B (en) For the monitoring system that server health is reported to the police in server set group operatione
US11609911B2 (en) Selecting a normalized form for conversion of a query expression
CN103902646A (en) Distributed task managing system and method
CN112148468B (en) Resource scheduling method and device, electronic equipment and storage medium
WO2018166145A1 (en) Method and device for batch offering of repayment data
CN110795166B (en) Data processing method and device
CN110147470B (en) Cross-machine-room data comparison system and method
CN111611221A (en) Hybrid computing system, data processing method and device
CN116755891B (en) Event queue processing method and system based on multithreading
CN111124791A (en) System testing method and device
CN110221914B (en) File processing method and device
CN114338455B (en) Multi-mechanism distributed collision detection system and method
CN109241511B (en) Electronic report generation method and equipment
CN115292021A (en) Task scheduling method, system, electronic device and readable storage medium
CN111259045B (en) Data processing method, device, server and medium
CN112988383A (en) Resource allocation method, device, equipment and storage medium
CN107402939B (en) Policy processing method and device
CN115495498B (en) Data association method, system, electronic equipment and storage medium
CN116708219A (en) DPI platform-based data acquisition method and device
CN111045959A (en) Complex algorithm variable mapping method based on storage optimization
CN116029731A (en) Method and device for processing quotation data and electronic equipment
CN116452355A (en) Billing certificate generation method, billing certificate generation device, terminal and storage medium
CN109683995A (en) A method of it being packaged block, verifying block and intelligent contract and executes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20221104

RJ01 Rejection of invention patent application after publication