CN111767128A - Method and device for executing timing task - Google Patents

Method and device for executing timing task Download PDF

Info

Publication number
CN111767128A
CN111767128A CN202010580275.2A CN202010580275A CN111767128A CN 111767128 A CN111767128 A CN 111767128A CN 202010580275 A CN202010580275 A CN 202010580275A CN 111767128 A CN111767128 A CN 111767128A
Authority
CN
China
Prior art keywords
task
timing task
executed
timing
information
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
CN202010580275.2A
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010580275.2A priority Critical patent/CN111767128A/en
Publication of CN111767128A publication Critical patent/CN111767128A/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
    • 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
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present disclosure provides a method and a device for executing a timing task, wherein the method comprises the following steps: periodically acquiring stored information of each timing task from a database; determining a timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task; when the scheduling time corresponding to each timing task to be executed is reached, generating a task execution request corresponding to the timing task to be executed, and sending the task execution request to a resource manager of a cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.

Description

Method and device for executing timing task
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for executing a timing task.
Background
The service side has a large number of timing tasks, each timing task corresponds to an execution period, for example, the execution period corresponding to the timing task may be executed once in 1 hour, and the corresponding server side may execute the timing task at time points such as 8 hours, 9 hours, 10 hours, and the like.
In general, each timed task may be stored on a corresponding downstream server, such that the downstream server may execute the timed task at an execution time corresponding to the timed task. However, in the manner of storing the timing task on the downstream server, when the information of the timing task is modified, the timing task after information update needs to be redeployed on the downstream server, so that the task modification process is complicated and takes a long time.
Meanwhile, in consideration of the situation that the downstream servers may have faults, a timing task needs to be deployed on the downstream servers, a target downstream server in the downstream servers is used for executing the timing task, other downstream servers are in a dormant state, and after the target downstream server fails, a downstream server is selected from the other downstream servers to execute the timing task.
Disclosure of Invention
The embodiment of the disclosure at least provides a method and a device for executing a timing task.
In a first aspect, an embodiment of the present disclosure provides a method for executing a timing task, where the method is applied to a scheduling server, and includes:
periodically acquiring stored information of each timing task from a database;
determining a timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task;
when the scheduling time corresponding to each timing task to be executed is reached, generating a task execution request corresponding to the timing task to be executed, and sending the task execution request to a resource manager of a cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
In an optional implementation manner, the determining, based on the information of each timing task, a timing task to be executed corresponding to the period from at least one timing task includes:
and determining the timing task to be executed corresponding to the period from at least one timing task based on the scheduling time indicated in the information of each timing task and the time range corresponding to the period.
In an optional implementation manner, the determining, based on the scheduling time indicated by the information of each timing task and the time range corresponding to the period, a timing task to be executed corresponding to the period from at least one timing task includes:
based on the scheduling time corresponding to each timing task and the time range corresponding to the period, determining the historical to-be-executed timing task corresponding to the previous period and determining the timing task of which the corresponding scheduling time is in the period;
determining whether information of the historical to-be-executed timing task corresponding to the previous period comprises second feedback information indicating that the task is executed;
and determining the historical to-be-executed timed task which does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period and the corresponding timed task with the scheduling time in the period as the to-be-executed timed task corresponding to the period.
In an optional implementation manner, before determining, based on information of each timing task, a timing task to be executed corresponding to the period from at least one timing task, the method further includes:
selecting a target timed task from the at least one timed task based on a task state indicated in the information of each timed task;
determining a target timing task with scheduling time to be updated from at least one target timing task based on at least one of a modification mark, current scheduling time and task feedback information included in the information of each timing task;
and determining the updated scheduling time corresponding to the target timing task based on the scheduling period corresponding to the target timing task to be updated in the scheduling time and the current scheduling time.
In an optional embodiment, the method further comprises:
if a task execution request triggered by a user aiming at any timing task is received, generating a task execution request corresponding to any timing task;
and sending a task execution request corresponding to any timing task to a resource manager of a cluster corresponding to any timing task, so that the resource manager selects a target server from at least one downstream server in the cluster to execute any timing task.
In a second aspect, an embodiment of the present disclosure provides a method for executing a timing task, where the method is applied to a management server, and includes:
receiving task feedback information sent by a downstream server aiming at a timing task, wherein the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed;
updating the information of the timing task based on the task feedback information, and storing the updated information of the timing task in a database;
the first feedback information is generated after the downstream server receives a task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server completes execution of the timing task.
In an optional embodiment, the method further comprises:
responding to a task registration request triggered by a user, and receiving information of a timing task to be registered;
determining a task identifier and a service identifier corresponding to the task registration request from the information of the timing task to be registered;
acquiring a task list corresponding to the downstream server from the downstream server corresponding to the service identifier;
and when the task identifier is detected to exist in the task list, storing the information of the timing task to be registered in a database, and setting the task state indicated in the information of the timing task as normal.
In an optional embodiment, the method further comprises:
and responding to a task modification request triggered by a user, and modifying the information to be modified of the timing task corresponding to the task modification request.
In an optional embodiment, the method further comprises:
and responding to a task query request triggered by a user, and querying information of at least one timing task corresponding to the task query request.
In a third aspect, an embodiment of the present disclosure provides a method for executing a timing task, where the method is applied to a downstream server, and includes:
receiving a task execution request corresponding to a timing task to be executed, and generating a first feedback message indicating that the task execution request is received;
and sending the first feedback message to a management server, executing the timing task to be executed, generating second feedback information indicating that the timing task to be executed is executed, and sending the second feedback information to the management server.
In a fourth aspect, an embodiment of the present disclosure further provides an apparatus for performing a timing task, including:
the acquisition module is used for periodically acquiring the stored information of each timing task from the database;
the first determining module is used for determining a timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task;
the system comprises a first generation module and a second generation module, wherein the first generation module is used for generating a task execution request corresponding to each timing task to be executed when the scheduling time corresponding to each timing task to be executed is reached, and sending the task execution request to a resource manager of a cluster corresponding to the timing task to be executed, so that the resource manager can select a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
In an optional implementation manner, when determining, based on information of each timing task, a timing task to be executed corresponding to the period from at least one timing task, the first determining module is configured to:
and determining the timing task to be executed corresponding to the period from at least one timing task based on the scheduling time indicated in the information of each timing task and the time range corresponding to the period.
In an optional embodiment, the first determining module, when determining, from at least one timing task, a to-be-executed timing task corresponding to the period based on the scheduling time indicated by the information of each timing task and the time range corresponding to the period, is configured to:
based on the scheduling time corresponding to each timing task and the time range corresponding to the period, determining the historical to-be-executed timing task corresponding to the previous period and determining the timing task of which the corresponding scheduling time is in the period;
determining whether information of the historical to-be-executed timing task corresponding to the previous period comprises second feedback information indicating that the task is executed;
and determining the historical to-be-executed timed task which does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period and the corresponding timed task with the scheduling time in the period as the to-be-executed timed task corresponding to the period.
In an optional implementation manner, before determining, based on information of each timing task, a timing task to be executed corresponding to the period from at least one timing task, the apparatus further includes:
a selection module for selecting a target timed task from the at least one timed task based on a task state indicated in the information of each timed task;
a second determining module, configured to determine, based on at least one of a modification flag, current scheduling time, and a task feedback message included in information of each timing task, a target timing task whose scheduling time is to be updated from among the at least one target timing task;
and the third determining module is used for determining the updated scheduling time corresponding to the target timing task based on the scheduling period corresponding to the target timing task to be updated in the scheduling time and the current scheduling time.
In an alternative embodiment, the apparatus further comprises:
the second generation module is used for generating a task execution request corresponding to any timing task if a task execution request triggered by a user aiming at the timing task is received;
a sending module, configured to send a task execution request corresponding to any timing task to a resource manager of a cluster corresponding to the timing task, so that the resource manager selects a target server from at least one downstream server in the cluster to execute the timing task.
In a fifth aspect, an embodiment of the present disclosure further provides an apparatus for executing a timing task, including:
the system comprises a first receiving module, a second receiving module and a timing task processing module, wherein the first receiving module is used for receiving task feedback information sent by a downstream server aiming at a timing task, and the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed;
the updating module is used for updating the information of the timing task based on the task feedback information and storing the updated information of the timing task in a database;
the first feedback information is generated after the downstream server receives a task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server completes execution of the timing task.
In an alternative embodiment, the apparatus further comprises:
the information receiving module is used for responding to a task registration request triggered by a user and receiving the information of the timing task to be registered;
an identifier determining module, configured to determine a task identifier and a service identifier corresponding to the task registration request from the information of the to-be-registered timing task;
a task list obtaining module, configured to obtain a task list corresponding to the downstream server from the downstream server corresponding to the service identifier;
and the registration module is used for storing the information of the timing task to be registered in a database and setting the task state indicated in the information of the timing task to be normal when the task identifier is detected to exist in the task list.
In an alternative embodiment, the apparatus further comprises:
and the modification module is used for responding to a task modification request triggered by a user and modifying the information to be modified of the timing task corresponding to the task modification request.
In an alternative embodiment, the apparatus further comprises:
and the query module is used for responding to a task query request triggered by a user and querying information of at least one timing task corresponding to the task query request.
In a sixth aspect, an embodiment of the present disclosure further provides an apparatus for performing a timing task, including:
the second receiving module is used for receiving a task execution request corresponding to a timing task to be executed and generating a first feedback message indicating that the task execution request is received;
and the execution module is used for sending the first feedback message to a management server, executing the timing task to be executed, generating second feedback information indicating that the timing task to be executed is executed, and sending the second feedback information to the management server.
In a seventh aspect, an embodiment of the present disclosure further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect; or performing the steps of the second aspect as described above, or any one of the possible embodiments of the second aspect; or performing the steps of the third aspect described above.
In an eighth aspect, this disclosed embodiment also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program, when executed by a processor, performs the steps in the first aspect or any possible implementation manner of the first aspect; or performing the steps of the second aspect as described above, or any one of the possible embodiments of the second aspect; or performing the steps of the third aspect described above.
According to the method and the device for executing the timing tasks, the timing task to be executed corresponding to the period is determined from at least one timing task based on the information of each timing task periodically acquired from the database; when the scheduling time corresponding to each timing task to be executed is reached, a task execution request corresponding to the timing task to be executed is generated, and the task execution request is sent to the resource manager of the cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed, and the target downstream server is selected from the at least one downstream server to execute the timing task, so that the timing task is not required to be sent to each downstream server in the cluster, namely, the resources of other servers except the target downstream server in the cluster are not occupied, the waste of server resources is avoided, and the utilization rate of the resources is improved.
Meanwhile, in the embodiment of the disclosure, the information of each timing task is stored in the database, and the information of the timing tasks stored in the database can be flexibly configured.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
FIG. 1 is a flow chart illustrating a method of performing timed tasks provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating another method of performing timed tasks provided by embodiments of the present disclosure;
FIG. 3 illustrates a flow chart of another method of performing timed tasks provided by embodiments of the present disclosure;
FIG. 4 illustrates a flow chart of another method of performing timed tasks provided by embodiments of the present disclosure;
FIG. 5 is a schematic diagram illustrating an apparatus for performing timed tasks according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of another apparatus for performing timed tasks provided by embodiments of the present disclosure;
FIG. 7 is a schematic diagram of another apparatus for performing timed tasks provided by embodiments of the present disclosure;
fig. 8 illustrates a schematic diagram of an electronic device 800 provided by an embodiment of the disclosure;
fig. 9 illustrates a schematic diagram of an electronic device 900 provided by an embodiment of the disclosure;
fig. 10 shows a schematic diagram of an electronic device 1000 provided by an embodiment of the disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
Research shows that the timing task is stored on the downstream server, and when the information of the timing task is modified, the timing task after information updating needs to be redeployed on the downstream server, so that the task modification process is complicated and takes long time, and the timing task is directly deployed on a plurality of downstream servers, so that the resource of the downstream servers is wasted, and the utilization rate of the resource is reduced.
Therefore, in order to solve the above problems, the present disclosure provides a method and an apparatus for performing a timing task.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
For the purpose of understanding the embodiments of the present disclosure, a method for performing a timing task disclosed in the embodiments of the present disclosure will be described in detail first.
Example one
Referring to fig. 1, a flowchart of a method for executing a timed task provided in an embodiment of the present disclosure is shown, where the method is applied to a scheduling server, and the method includes steps S101 to S103, where:
and S101, periodically acquiring the stored information of each timing task from the database.
S102, based on the information of each timing task, determining a to-be-executed timing task corresponding to the period from at least one timing task.
S103, when the scheduling time corresponding to each timing task to be executed is reached, generating a task execution request corresponding to the timing task to be executed, and sending the task execution request to the resource manager of the cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
In the method, a to-be-executed timing task corresponding to a period is determined from at least one timing task based on information of each timing task periodically acquired from a database; when the scheduling time corresponding to each timing task to be executed is reached, a task execution request corresponding to the timing task to be executed is generated, and the task execution request is sent to the resource manager of the cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed, and the target downstream server is selected from the at least one downstream server to execute the timing task, so that the timing task is not required to be sent to each downstream server in the cluster, namely, the resources of other servers except the target downstream server in the cluster are not occupied, the waste of server resources is avoided, and the utilization rate of the resources is improved. Meanwhile, the information of each timing task is stored in the database, the information of the timing tasks stored in the database can be flexibly configured, compared with a mode that each timing task is deployed on a downstream server, the configuration process of the timing tasks is simple, the consumed time is short, and the configuration efficiency of the timing tasks is improved.
For S101:
the scheduling server may periodically retrieve the stored information of each timing task from the database. The period of the scheduling server for acquiring the information of the timing task can be set according to actual needs. For example, the period may be 3 seconds, 5 seconds, and the like, that is, the scheduling server may obtain the stored information of each timing task from the database every 3 seconds; alternatively, the scheduling server may retrieve the stored information for each timed task from the database every 5 seconds.
Here, the information of the timing task may include at least one of: an Identity Document (ID), a service identifier, a cluster identifier, a scheduling period, a modification flag, a task state, scheduling time, description information, feedback information, and the like.
For S102:
after the information of each timing task is acquired, the to-be-executed timing task corresponding to the period may be determined from at least one timing task based on the information of each timing task. For example, the information of the timing task may be updated (that is, the scheduling time indicated in the information of the timing task may be updated), and then the timing task to be executed corresponding to the period may be determined from at least one timing task based on the updated information of the timing task.
In an optional implementation manner, before determining, based on information of each timing task, a timing task to be executed corresponding to the period from at least one timing task, the method may further include:
step one, selecting a target timing task from at least one timing task based on the task state indicated in the information of each timing task.
And secondly, determining a target timing task with the scheduling time to be updated from at least one target timing task based on at least one of a modification mark, the current scheduling time and a task feedback message included in the information of each timing task.
And step three, determining the updated scheduling time corresponding to the target timing task based on the scheduling period corresponding to the target timing task to be updated and the current scheduling time.
For the description of the first step, the task state may include normal, stop, and delete. Therefore, the timing task with the normal task state can be selected from at least one timing task as the target timing task according to the task state corresponding to each timing task; and screening out the timing tasks of which the task states are stop and deletion in at least one timing task.
Describing the step two, the target timing task whose scheduling time is to be updated may be determined from at least one target timing task based on at least one of the modification flag, the current scheduling time, and the task feedback message included in the information of each timing task.
For example, the modification may be marked as a modified target timing task, determined as a target timing task whose scheduled time is to be updated. Wherein the timing task marked as modified can be a timing task whose information is modified after the last period. For example, the period corresponds to a time range from 10:10:11 (including a time point of 10:10: 11) to 10:10:15 (including a time point of 10:10: 15), the period duration is 5 seconds, the time range corresponding to the previous period is 10:10:06 to 10:10:10, and the timing task with the modified information of the timing task in the time period from 10:10:06 to 10:10:10 is determined as the target timing task whose scheduling time is to be updated.
And determining the timing task with the current scheduling time in the time range corresponding to the previous period as a target timing task with the scheduling time to be updated. Continuing to explain with the example, if the scheduling time corresponding to the target timing task a is 10:10:08, so that it is known that the target timing task a is located within the time range corresponding to the previous period, the scheduling time of the target timing task a is to be updated, that is, the target timing task a is the target timing task whose scheduling time is to be updated; if the scheduling time corresponding to the target timing task B is 10:10:00, so that the target timing task B is known not to be located in the time range corresponding to the previous period, the scheduling time of the target timing task B does not need to be updated, namely the target timing task B is not a target timing task of which the scheduling time is to be updated; if the scheduling time corresponding to the target timing task C is 10:10:20, it can be known that the target timing task C is also not located within the time range corresponding to the previous period, the scheduling time of the target timing task C does not need to be updated, that is, the target timing task C is not a target timing task whose scheduling time is to be updated.
And then, determining a target timing task with scheduling time to be updated based on the task feedback message and the current scheduling time, wherein the task feedback information may be second feedback information indicating that the task has been executed. In specific implementation, the current scheduling time can be located in a time range corresponding to the previous period, and the target timing task with the second feedback information is determined as the target timing task whose scheduling time is to be updated; and the current scheduling time is not located in the time range corresponding to the previous period, or the target timing task without the second feedback information is not the target timing task whose scheduling time is to be updated.
Finally, a target timed task whose scheduled time is to be updated may be determined based on the modification flag, the current scheduled time, and a second feedback message indicating that the task has been executed. In specific implementation, the modification flag may be a modified target timing task, or the target timing task whose current scheduling time is within a time range corresponding to the previous period and in which the second feedback information exists may be determined as the target timing task whose scheduling time is to be updated.
Explaining the step three, after the target timing task whose scheduling time is to be updated is determined, the scheduling time of the target timing task whose scheduling time is to be updated can be updated. In specific implementation, the updated scheduling time corresponding to the target timing task may be determined according to the scheduling period corresponding to the target timing task to be updated at each scheduling time and the current scheduling time. For example, if the scheduling period corresponding to the target timing task is 1 hour and the current scheduling time is 10:00:00, it may be determined that the updated scheduling time corresponding to the target timing task is 11:00: 00.
In an optional implementation manner, determining, from at least one timing task, a timing task to be executed corresponding to the period based on information of each timing task may include: and determining the timing task to be executed corresponding to the period from at least one timing task based on the scheduling time indicated in the information of each timing task and the time range corresponding to the period.
Here, based on the scheduling time corresponding to each timing task, a timing task whose scheduling time is within the time range corresponding to the period may be selected from at least one timing task, and the selected timing task may be determined as the to-be-executed timing task corresponding to the period. Or, based on the updated scheduling time indicated in the timing task information and the time range corresponding to the period, the to-be-executed timing task corresponding to the period may be determined from at least one timing task, and the selected timing task may be determined as the to-be-executed timing task corresponding to the period.
For example, if the time range corresponding to the period is 10:10:11 (including the time point of 10:10: 11) to 10:10:15 (including the time point of 10:10: 15), according to the scheduling time corresponding to each timing task, the timing task whose scheduling time is in the time range is determined as the to-be-executed timing task corresponding to the period. For example, if the scheduling time corresponding to the timing task a is 10:10:12, the timing task a is a to-be-executed timing task corresponding to the period; and if the scheduling time corresponding to the timing task B is 10:10:20, the timing task B is not the to-be-executed timing task corresponding to the period.
Here, when determining a to-be-executed timing task corresponding to the period from at least one timing task based on the scheduling time indicated by the information of each timing task and the time range corresponding to the period, the method may include:
firstly, based on the scheduling time corresponding to each timing task and the time range corresponding to the period, determining the historical to-be-executed timing task corresponding to the previous period, and determining the timing task of which the corresponding scheduling time is located in the period.
And secondly, determining whether the information of the historical to-be-executed timed task corresponding to the previous period comprises second feedback information indicating that the task is executed.
And thirdly, determining the historical to-be-executed timed task which does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period and the timed task corresponding to the scheduling time in the period as the to-be-executed timed task corresponding to the period.
In the embodiment of the disclosure, the time range corresponding to the previous period can be determined according to the period of the information of the timing task acquired by the scheduling server and the time range corresponding to the period; and determining the historical to-be-executed timed task with the scheduling time in the previous period based on the scheduling time corresponding to each timed task. Meanwhile, the scheduled time or the timing task whose updated scheduled time is within the time range corresponding to the period may be determined as the timing task that needs to be executed in the period, that is, the timing task whose corresponding scheduled time is within the period is determined.
Further, whether second feedback information indicating that the task has been executed is included in the information of the historical to-be-executed timed task corresponding to the previous period can be detected, and if yes, the historical to-be-executed timed task is represented to be successfully scheduled in the previous period; if not, the historical to-be-executed timing task fails to be scheduled in the last period. Therefore, the historical to-be-executed timed task that failed to be scheduled in the previous period needs to be determined as the to-be-executed timed task corresponding to the period, and is scheduled and executed again in the period. If the scheduled execution of the timed task fails in multiple consecutive periods (for example, the scheduled execution fails in 3 consecutive periods), it may be a problem to characterize the service cluster executing the timed task, so that a notification message of the scheduled failure of the timed task may be sent to the resource manager, and meanwhile, an updated scheduling time may be determined for the timed task based on the scheduling period and the scheduling time of the timed task, so as to continue to schedule the timed task at the updated scheduling time point.
Here, the historical to-be-executed timed task (i.e., the historical to-be-executed timed task that failed to be scheduled in the previous cycle) that does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous cycle and the timed task whose corresponding scheduling time is within the cycle may be determined as the to-be-executed timed task corresponding to the cycle.
For S103:
in specific implementation, the to-be-executed timed tasks corresponding to the period may be sequenced, and when the scheduling time corresponding to each to-be-executed timed task is reached according to the sequence, the task execution request corresponding to the to-be-executed timed task is generated, where the to-be-executed timed task corresponding to the period may include a historical to-be-executed timed task that does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period, and a timed task whose corresponding scheduling time is within the period.
For example, the historical to-be-executed timed task may be set before the timed task in the period at the corresponding scheduling time (i.e. preferentially generating the corresponding task execution request for the historical to-be-executed timed task), and if there are multiple historical to-be-executed timed tasks, the multiple historical to-be-executed timed tasks may be randomly ordered, where a time interval between two adjacent historical to-be-executed timed tasks at which the task execution request is generated may be less than or equal to a set interval value (e.g. the set interval value may be 1 millisecond). And then, according to the scheduling time, sequencing the timing tasks whose corresponding scheduling time is in the period, for example, placing the timing task before the scheduling time in front of the timing task after the scheduling time.
For example, if the to-be-executed timing task corresponding to the period includes: a timing task A to be executed, a timing task B to be executed, a timing task C to be executed, a timing task D to be executed and a timing task E to be executed; the timing task C to be executed and the timing task D to be executed are historical timing tasks to be executed, which do not include second feedback information, in the historical timing tasks to be executed corresponding to the previous period; the timing task A to be executed, the timing task B to be executed and the timing task E to be executed are timing tasks with corresponding scheduling time in the period, the scheduling time corresponding to the timing task A to be executed is 10:10:01, the scheduling time corresponding to the timing task B to be executed is 10:10:03, and the scheduling time corresponding to the timing task E to be executed is 10:10: 02. Therefore, it can be seen that the scheduling order of each timing task to be executed may be: the method comprises the steps of a to-be-executed timing task C, a to-be-executed timing task D, a to-be-executed timing task A, a to-be-executed timing task E and a to-be-executed timing task B.
Then, according to the ranking sequence, a task execution request is generated for the timing task C to be executed, and then a task execution request is generated for the timing task D to be executed, where a time interval for generating the task execution request between the timing task C to be executed and the timing task D to be executed may be less than or equal to a set interval value (for example, the set interval value may be 1 millisecond); and further, according to the scheduling time corresponding to the to-be-executed timed task a, the to-be-executed timed task E and the to-be-executed timed task B, when the scheduling time corresponding to each to-be-executed timed task is reached, a task execution request corresponding to the to-be-executed timed task is generated.
In another embodiment, the corresponding scheduling time may also be generated for the historical to-be-executed timed task that does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period, and in specific implementation, the scheduling time corresponding to each historical to-be-executed timed task may be generated based on a time range corresponding to the period. For example, if the period corresponds to a time range of 10:10:11 to 10:10:15, the scheduling time corresponding to the historical to-be-executed timing task may be 10:10:11.05 (to the precision of milliseconds).
After the corresponding scheduling time is determined for each historical to-be-executed timing task, the timing task whose corresponding scheduling time is within the period and the historical to-be-executed timing task which does not include the second feedback information in the historical to-be-executed timing task corresponding to the previous period may be sequenced according to the scheduling time, and according to the generated sequence, after the scheduling time corresponding to each to-be-executed timing task is reached, the task execution request corresponding to the to-be-executed timing task is generated.
After generating a task execution request corresponding to a timing task to be executed, the task execution request may be sent to a resource manager of a cluster corresponding to the timing task to be executed, and the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
In the embodiment of the disclosure, the scheduling server may perform a working state at the scheduling time corresponding to each to-be-executed timing task, that is, generate a task execution request corresponding to the to-be-executed timing task at the scheduling time corresponding to each to-be-executed timing task; the scheduling server can enter a dormant state at other times except the non-scheduling time, so that the excessive use of the scheduling server is avoided, and the waste of resources is avoided.
In an alternative embodiment, the method may further comprise:
firstly, if a task execution request triggered by a user aiming at any timing task is received, a task execution request corresponding to any timing task is generated.
And secondly, sending a task execution request corresponding to any timing task to a resource manager of a cluster corresponding to any timing task, so that the resource manager selects a target server from at least one downstream server in the cluster to execute any timing task.
In the embodiment of the present disclosure, the timing task may also be triggered manually, so that the downstream server executes the triggered timing task. In specific implementation, when receiving a task execution request triggered by a user for any timing task, a scheduling server may generate a corresponding task execution request for the triggered timing task, and may send the task execution request to a resource manager of a cluster corresponding to the triggered timing task in real time, so that the resource manager selects a target server from at least one downstream server in the cluster to execute any timing task.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides a device for executing a timing task corresponding to the method for executing a timing task, and since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to that of the method for executing a timing task in the embodiment of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are not described again.
Example two
Based on the same inventive concept, the embodiment of the present disclosure further provides a method for executing a timing task, which is applied to a management server, and is shown in fig. 2, where the method includes steps S201 to S202, where:
s201, receiving task feedback information sent by a downstream server aiming at a timing task, wherein the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed.
And S202, updating the information of the timing task based on the task feedback information, and storing the updated information of the timing task in a database.
The first feedback information is generated after the downstream server receives the task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server executes the timing task.
In the embodiment of the disclosure, after receiving the task execution request sent by the scheduling server, the downstream server may send first feedback information indicating that the task execution request has been received to the management server. And the downstream server may transmit second feedback information indicating that the task has been executed to the management server when executing the corresponding timed task in response to the received task execution request. The management server can receive task feedback information sent by a downstream server for the timed task, wherein the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed.
The management server may store the task feedback information in the information of the corresponding timed task, update the information of the corresponding timed task, and store the updated information of the timed task in the database.
In an alternative embodiment, the method may further comprise:
step one, responding to a task registration request triggered by a user, and receiving information of a timing task to be registered.
And step two, determining a task identifier and a service identifier corresponding to the task registration request from the information of the timing task to be registered.
And step three, acquiring a task list corresponding to the downstream server from the downstream server corresponding to the service identifier.
And step four, when detecting that the task identifier exists in the task list, storing the information of the timing task to be registered in a database, and setting the task state indicated in the information of the timing task as normal.
Here, the user can register the timing task through the management server. In specific implementation, a user can trigger a task registration request and send information of a timing task to be registered to a management server. And the management server determines a task identifier and a service identifier corresponding to the task registration request from the information of the timing task to be registered. Further, a task list corresponding to the downstream server may be obtained from the downstream server corresponding to the service identifier, where the task list may include task identifiers of timing tasks corresponding to the downstream server. Then, whether a task identifier corresponding to a request to be registered exists in the received task list can be judged, if yes, information of the timed task to be registered is stored in a database, and a task state indicated in the information of the timed task is set to be normal; if the timing task to be registered does not exist, the timing task to be registered is not allowed to be registered, namely, the information of the timing task to be registered is not stored.
In an alternative embodiment, the method may further comprise: and responding to a task modification request triggered by a user, and modifying the information to be modified of the timing task corresponding to the task modification request.
Here, the information of any one of the timing tasks stored in the database may be modified by the management server. In specific implementation, the management server may respond to a task modification request triggered by a user, and modify information to be modified of a timing task corresponding to the task modification request. For example, information such as the scheduling time, the scheduling period, and the task status of the timed task a may be modified. And if the task state of the timing task is modified to be deleted, the timing task is characterized to be deleted.
In an alternative embodiment, the method may further comprise: and responding to a task query request triggered by a user, and querying information of at least one timing task corresponding to the task query request.
Here, the information of any one of the timed tasks stored in the database may be queried by the management server. In specific implementation, the management server may respond to a task query request triggered by a user to query information of the corresponding at least one timing task.
For example, when querying the timing task, the timing task to be queried may be determined based on at least one of the task status, the scheduling period, the task identifier, the service identifier, and the like of the timing task. Further, the information of the determined timed task to be queried may be queried.
The method for executing the timing task provided by the embodiment of the disclosure has the same technical characteristics as the method for executing the timing task provided by the first embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides a device for executing a timing task corresponding to the method for executing a timing task, and since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to that of the method for executing a timing task in the embodiment of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are omitted.
EXAMPLE III
Based on the same inventive concept, another method for executing a timing task is provided in the embodiments of the present disclosure, and the method is applied to a downstream server, as shown in fig. 3, and includes steps S301 to S302, where:
s301, receiving a task execution request corresponding to a timing task to be executed, and generating a first feedback message indicating that the task execution request is received.
S302, the first feedback message is sent to the management server, the timing task to be executed is executed, second feedback information indicating that the timing task to be executed is generated, and the second feedback information is sent to the management server.
Here, the downstream server, after receiving the task execution request, may generate a first feedback message indicating that the task execution request has been received, and transmit the first feedback message to the management server. Meanwhile, the corresponding to-be-executed timing task can be executed in response to the received task execution request, second feedback information indicating that the to-be-executed timing task is executed is generated, and the second feedback information is sent to the management server.
Here, referring to fig. 4, the interactive process between the scheduling server, the downstream server, and the management server will be described. In particular, a method for executing a timing task may include:
s401, the scheduling server acquires the information of each timing task from the database.
S402, the scheduling server determines to-be-executed timing tasks based on the acquired information of each timing task; and generating a task execution request corresponding to the timing task to be executed at the scheduling time corresponding to the timing task to be executed.
And S403, the scheduling server sends a task execution request corresponding to the timing task to be executed to a downstream server.
S404, after receiving the task execution request, the downstream server generates a first feedback message indicating that the task execution request is received.
S405, the downstream server sends the generated first feedback message indicating that the task execution request is received to the management server.
S406, the downstream server executes the to-be-executed timing task corresponding to the task execution request, and generates second feedback information indicating that the to-be-executed timing task is executed.
And S407, the downstream server sends the second feedback information to the management server.
S408, the management server stores the received first feedback information and the second feedback information in the corresponding information of the timing task to be executed, updates the timing task to be executed, and stores the updated information of the timing task to be executed in a database.
The method for executing the timing task provided by the embodiment of the disclosure has the same technical characteristics as the method for executing the timing task provided by the first embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides a device for executing a timing task corresponding to the method for executing a timing task, and since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to that of the method for executing a timing task in the embodiment of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated details are omitted.
Example four
Referring to fig. 5, a schematic diagram of an apparatus for performing a timing task according to an embodiment of the present disclosure is shown, where the apparatus includes: an acquisition module 501, a first determination module 502, a first generation module 503, a selection module 504, a second determination module 505, a third determination module 506, a second generation module 507, and a transmission module 508; wherein the content of the first and second substances,
an obtaining module 501, configured to periodically obtain, from a database, stored information of each timing task;
a first determining module 502, configured to determine, based on information of each timing task, a to-be-executed timing task corresponding to the period from at least one timing task;
a first generating module 503, configured to generate a task execution request corresponding to each to-be-executed timed task when a scheduling time corresponding to each to-be-executed timed task is reached, and send the task execution request to a resource manager of a cluster corresponding to the to-be-executed timed task, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the to-be-executed timed task.
In an optional implementation manner, when determining, based on information of each timing task, a timing task to be executed corresponding to the period from at least one timing task, the first determining module 502 is configured to:
and determining the timing task to be executed corresponding to the period from at least one timing task based on the scheduling time indicated in the information of each timing task and the time range corresponding to the period.
In an optional implementation manner, when determining, based on the scheduling time indicated by the information of each timing task and the time range corresponding to the period, a timing task to be executed corresponding to the period from at least one timing task, the first determining module 502 is configured to:
based on the scheduling time corresponding to each timing task and the time range corresponding to the period, determining the historical to-be-executed timing task corresponding to the previous period and determining the timing task of which the corresponding scheduling time is in the period;
determining whether information of the historical to-be-executed timing task corresponding to the previous period comprises second feedback information indicating that the task is executed;
and determining the historical to-be-executed timed task which does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period and the corresponding timed task with the scheduling time in the period as the to-be-executed timed task corresponding to the period.
In an optional implementation manner, before determining, based on information of each timing task, a timing task to be executed corresponding to the period from at least one timing task, the apparatus further includes:
a selecting module 504, configured to select a target timed task from the at least one timed task based on a task state indicated in the information of each timed task;
a second determining module 505, configured to determine, based on at least one of a modification flag, a current scheduling time, and a task feedback message included in information of each timing task, a target timing task whose scheduling time is to be updated from among the at least one target timing task;
a third determining module 506, configured to determine, based on the scheduling period corresponding to the target timing task whose scheduling time is to be updated and the current scheduling time, an updated scheduling time corresponding to the target timing task.
In an alternative embodiment, the apparatus further comprises:
a second generating module 507, configured to generate a task execution request corresponding to any timing task if a task execution request triggered by a user for the timing task is received;
a sending module 508, configured to send a task execution request corresponding to any timing task to a resource manager of a cluster corresponding to the timing task, so that the resource manager selects a target server from at least one downstream server in the cluster to execute the timing task.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
EXAMPLE five
Referring to fig. 6, a schematic diagram of an apparatus for performing a timing task according to an embodiment of the present disclosure is shown, where the apparatus includes: a first receiving module 601, an updating module 602, an information receiving module 603, an identification determining module 604, a task list obtaining module 605, a registering module 606, a modifying module 607 and a querying module 608; wherein the content of the first and second substances,
a first receiving module 601, configured to receive task feedback information sent by a downstream server for a timed task, where the task feedback information includes first feedback information indicating that a task execution request has been received or second feedback information indicating that a task has been executed;
an updating module 602, configured to update the information of the timing task based on the task feedback information, and store the updated information of the timing task in a database;
the first feedback information is generated after the downstream server receives a task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server completes execution of the timing task.
In an alternative embodiment, the apparatus further comprises:
an information receiving module 603, configured to respond to a task registration request triggered by a user, and receive information of a timing task to be registered;
an identifier determining module 604, configured to determine a task identifier and a service identifier corresponding to the task registration request from the information of the to-be-registered timing task;
a task list obtaining module 605, configured to obtain a task list corresponding to the downstream server from the downstream server corresponding to the service identifier;
a registering module 606, configured to store the information of the to-be-registered timed task in a database when detecting that the task identifier exists in the task list, and set a task state indicated in the information of the timed task to be normal.
In an alternative embodiment, the apparatus further comprises:
the modifying module 607 is configured to respond to a task modifying request triggered by a user, and modify information to be modified of a timing task corresponding to the task modifying request.
In an alternative embodiment, the apparatus further comprises:
the query module 608 is configured to respond to a task query request triggered by a user, and query information of at least one timing task corresponding to the task query request.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
EXAMPLE six
Referring to fig. 7, a schematic diagram of an apparatus for performing a timing task according to an embodiment of the present disclosure is shown, where the apparatus includes: a second receiving module 701 and an executing module 702; wherein the content of the first and second substances,
a second receiving module 701, configured to receive a task execution request corresponding to a timing task to be executed, and generate a first feedback message indicating that the task execution request has been received;
an executing module 702, configured to send the first feedback message to a management server, execute the to-be-executed timing task, generate second feedback information indicating that the to-be-executed timing task is executed, and send the second feedback information to the management server.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Based on the same technical concept, the embodiment of the application also provides the electronic equipment. Referring to fig. 8, a schematic structural diagram of an electronic device 800 provided in the embodiment of the present application includes a processor 801, a memory 802, and a bus 803. The memory 802 is used for storing execution instructions and includes a memory 8021 and an external memory 8022; the memory 8021 is also referred to as an internal memory, and is used for temporarily storing operation data in the processor 801 and data exchanged with an external memory 8022 such as a hard disk, the processor 801 exchanges data with the external memory 8022 through the memory 8021, and when the electronic device 800 operates, the processor 801 communicates with the memory 802 through the bus 803, so that the processor 801 executes the following instructions:
periodically acquiring stored information of each timing task from a database;
determining a timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task;
when the scheduling time corresponding to each timing task to be executed is reached, generating a task execution request corresponding to the timing task to be executed, and sending the task execution request to a resource manager of a cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
Based on the same technical concept, the embodiment of the application also provides the electronic equipment. Referring to fig. 9, a schematic structural diagram of an electronic device 900 provided in the embodiment of the present application includes a processor 901, a memory 902, and a bus 903. The memory 902 is used for storing execution instructions, and includes a memory 9021 and an external memory 9022; the memory 9021 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 901 and data exchanged with an external memory 9022 such as a hard disk, the processor 901 exchanges data with the external memory 9022 through the memory 9021, and when the electronic device 900 is operated, the processor 901 communicates with the memory 902 through the bus 903, so that the processor 901 executes the following instructions:
receiving task feedback information sent by a downstream server aiming at a timing task, wherein the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed;
updating the information of the timing task based on the task feedback information, and storing the updated information of the timing task in a database;
the first feedback information is generated after the downstream server receives a task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server completes execution of the timing task.
Based on the same technical concept, the embodiment of the application also provides the electronic equipment. Referring to fig. 10, a schematic structural diagram of an electronic device 1000 provided in the embodiment of the present application includes a processor 1001, a memory 1002, and a bus 1003. The memory 1002 is used for storing execution instructions, and includes a memory 10021 and an external memory 10022; the memory 10021 is also referred to as a memory, and is used for temporarily storing operation data in the processor 1001 and data exchanged with the external memory 10022 such as a hard disk, the processor 1001 exchanges data with the external memory 10022 through the memory 10021, and when the electronic device 1000 operates, the processor 1001 and the memory 1002 communicate with each other through the bus 1003, so that the processor 1001 executes the following instructions:
receiving a task execution request corresponding to a timing task to be executed, and generating a first feedback message indicating that the task execution request is received;
and sending the first feedback message to a management server, executing the timing task to be executed, generating second feedback information indicating that the timing task to be executed is executed, and sending the second feedback information to the management server.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, executes the steps of the method for executing the timing task in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The computer program product of the method for executing the timing task provided in the embodiment of the present disclosure includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute steps of the method for executing the timing task described in the above method embodiment, which may be referred to in the above method embodiment specifically, and are not described herein again.
The embodiments of the present disclosure also provide a computer program, which when executed by a processor implements any one of the methods of the foregoing embodiments. The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (15)

1. A method for executing a timing task, wherein the method is applied to a scheduling server, and comprises the following steps:
periodically acquiring stored information of each timing task from a database;
determining a timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task;
when the scheduling time corresponding to each timing task to be executed is reached, generating a task execution request corresponding to the timing task to be executed, and sending the task execution request to a resource manager of a cluster corresponding to the timing task to be executed, so that the resource manager selects a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
2. The method according to claim 1, wherein the determining, based on the information of each timing task, a timing task to be executed corresponding to the period from at least one timing task comprises:
and determining the timing task to be executed corresponding to the period from at least one timing task based on the scheduling time indicated in the information of each timing task and the time range corresponding to the period.
3. The method according to claim 2, wherein the determining, from at least one timing task, a timing task to be executed corresponding to the period based on the scheduling time indicated by the information of each timing task and the time range corresponding to the period, comprises:
based on the scheduling time corresponding to each timing task and the time range corresponding to the period, determining the historical to-be-executed timing task corresponding to the previous period and determining the timing task of which the corresponding scheduling time is in the period;
determining whether information of the historical to-be-executed timing task corresponding to the previous period comprises second feedback information indicating that the task is executed;
and determining the historical to-be-executed timed task which does not include the second feedback information in the historical to-be-executed timed task corresponding to the previous period and the corresponding timed task with the scheduling time in the period as the to-be-executed timed task corresponding to the period.
4. The method according to claim 2 or 3, wherein before determining the timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task, the method further comprises:
selecting a target timed task from the at least one timed task based on a task state indicated in the information of each timed task;
determining a target timing task with scheduling time to be updated from at least one target timing task based on at least one of a modification mark, current scheduling time and task feedback information included in the information of each timing task;
and determining the updated scheduling time corresponding to the target timing task based on the scheduling period corresponding to the target timing task to be updated in the scheduling time and the current scheduling time.
5. The method of claim 1, further comprising:
if a task execution request triggered by a user aiming at any timing task is received, generating a task execution request corresponding to any timing task;
and sending a task execution request corresponding to any timing task to a resource manager of a cluster corresponding to any timing task, so that the resource manager selects a target server from at least one downstream server in the cluster to execute any timing task.
6. A method for executing timing tasks, which is applied to a management server and comprises the following steps:
receiving task feedback information sent by a downstream server aiming at a timing task, wherein the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed;
updating the information of the timing task based on the task feedback information, and storing the updated information of the timing task in a database;
the first feedback information is generated after the downstream server receives a task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server completes execution of the timing task.
7. The method of claim 6, further comprising:
responding to a task registration request triggered by a user, and receiving information of a timing task to be registered;
determining a task identifier and a service identifier corresponding to the task registration request from the information of the timing task to be registered;
acquiring a task list corresponding to the downstream server from the downstream server corresponding to the service identifier;
and when the task identifier is detected to exist in the task list, storing the information of the timing task to be registered in a database, and setting the task state indicated in the information of the timing task as normal.
8. The method of claim 6, further comprising:
and responding to a task modification request triggered by a user, and modifying the information to be modified of the timing task corresponding to the task modification request.
9. The method of claim 6, further comprising:
and responding to a task query request triggered by a user, and querying information of at least one timing task corresponding to the task query request.
10. A method for performing timed tasks, the method being applied to a downstream server, comprising:
receiving a task execution request corresponding to a timing task to be executed, and generating a first feedback message indicating that the task execution request is received;
and sending the first feedback message to a management server, executing the timing task to be executed, generating second feedback information indicating that the timing task to be executed is executed, and sending the second feedback information to the management server.
11. An apparatus for performing timed tasks, comprising:
the acquisition module is used for periodically acquiring the stored information of each timing task from the database;
the first determining module is used for determining a timing task to be executed corresponding to the period from at least one timing task based on the information of each timing task;
the system comprises a first generation module and a second generation module, wherein the first generation module is used for generating a task execution request corresponding to each timing task to be executed when the scheduling time corresponding to each timing task to be executed is reached, and sending the task execution request to a resource manager of a cluster corresponding to the timing task to be executed, so that the resource manager can select a target downstream server from at least one downstream server in the cluster to execute the timing task to be executed.
12. An apparatus for performing timed tasks, comprising:
the system comprises a first receiving module, a second receiving module and a timing task processing module, wherein the first receiving module is used for receiving task feedback information sent by a downstream server aiming at a timing task, and the task feedback information comprises first feedback information indicating that a task execution request is received or second feedback information indicating that the task is executed;
the updating module is used for updating the information of the timing task based on the task feedback information and storing the updated information of the timing task in a database;
the first feedback information is generated after the downstream server receives a task execution request corresponding to the timing task, and the second feedback information is generated after the downstream server completes execution of the timing task.
13. An apparatus for performing timed tasks, comprising:
the second receiving module is used for receiving a task execution request corresponding to a timing task to be executed and generating a first feedback message indicating that the task execution request is received;
and the execution module is used for sending the first feedback message to a management server, executing the timing task to be executed, generating second feedback information indicating that the timing task to be executed is executed, and sending the second feedback information to the management server.
14. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the method of performing timed tasks according to any of claims 1 to 5; or to perform the steps of a method of performing timed tasks according to any of claims 6 to 9; or to perform the steps of a method of performing timed tasks according to claim 10.
15. A computer-readable storage medium, having stored thereon a computer program for performing, when executed by a processor, the steps of a method of performing timed tasks according to any one of claims 1 to 5; or to perform the steps of a method of performing timed tasks according to any of claims 6 to 9; or to perform the steps of a method of performing timed tasks according to claim 10.
CN202010580275.2A 2020-06-23 2020-06-23 Method and device for executing timing task Pending CN111767128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010580275.2A CN111767128A (en) 2020-06-23 2020-06-23 Method and device for executing timing task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010580275.2A CN111767128A (en) 2020-06-23 2020-06-23 Method and device for executing timing task

Publications (1)

Publication Number Publication Date
CN111767128A true CN111767128A (en) 2020-10-13

Family

ID=72722005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010580275.2A Pending CN111767128A (en) 2020-06-23 2020-06-23 Method and device for executing timing task

Country Status (1)

Country Link
CN (1) CN111767128A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112418615A (en) * 2020-11-04 2021-02-26 北京中电飞华通信有限公司 Timing strategy execution method and device
CN112463318A (en) * 2020-11-17 2021-03-09 深圳市优必选科技股份有限公司 Timed task processing method, device and system
CN113448699A (en) * 2020-12-30 2021-09-28 北京新氧科技有限公司 Distributed timed task processing system, method and related device
CN114679481A (en) * 2022-02-23 2022-06-28 达闼机器人股份有限公司 Robot control method and device, storage medium and robot cluster

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017107843A1 (en) * 2015-12-21 2017-06-29 北京奇虎科技有限公司 Periodic task processing method and apparatus, computer program, and readable medium
CN109144744A (en) * 2017-06-28 2019-01-04 北京京东尚科信息技术有限公司 Task processing system, method and apparatus
CN109634733A (en) * 2018-12-13 2019-04-16 成都四方伟业软件股份有限公司 Task scheduling and managing method, device and operation management server
CN109743390A (en) * 2019-01-04 2019-05-10 深圳壹账通智能科技有限公司 Method for scheduling task, device, computer equipment and storage medium
CN110046039A (en) * 2019-03-28 2019-07-23 厦门网宿有限公司 Method for scheduling task and system, control centre's server and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017107843A1 (en) * 2015-12-21 2017-06-29 北京奇虎科技有限公司 Periodic task processing method and apparatus, computer program, and readable medium
CN109144744A (en) * 2017-06-28 2019-01-04 北京京东尚科信息技术有限公司 Task processing system, method and apparatus
CN109634733A (en) * 2018-12-13 2019-04-16 成都四方伟业软件股份有限公司 Task scheduling and managing method, device and operation management server
CN109743390A (en) * 2019-01-04 2019-05-10 深圳壹账通智能科技有限公司 Method for scheduling task, device, computer equipment and storage medium
CN110046039A (en) * 2019-03-28 2019-07-23 厦门网宿有限公司 Method for scheduling task and system, control centre's server and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112418615A (en) * 2020-11-04 2021-02-26 北京中电飞华通信有限公司 Timing strategy execution method and device
CN112463318A (en) * 2020-11-17 2021-03-09 深圳市优必选科技股份有限公司 Timed task processing method, device and system
CN112463318B (en) * 2020-11-17 2024-05-17 深圳市优必选科技股份有限公司 Timing task processing method, device and system
CN113448699A (en) * 2020-12-30 2021-09-28 北京新氧科技有限公司 Distributed timed task processing system, method and related device
CN114679481A (en) * 2022-02-23 2022-06-28 达闼机器人股份有限公司 Robot control method and device, storage medium and robot cluster

Similar Documents

Publication Publication Date Title
CN111767128A (en) Method and device for executing timing task
CN108132830B (en) Task scheduling method, device and system
CN108563502B (en) Task scheduling method and device
CN111522641B (en) Task scheduling method, device, computer equipment and storage medium
CN107733708B (en) Equipment parameter configuration method and device, computer equipment and storage medium
CN112416581B (en) Distributed calling system for timed tasks
US20180176289A1 (en) Information processing device, information processing system, computer-readable recording medium, and information processing method
CN110619226A (en) Platform-based data processing method, system, equipment and storage medium
CN111722928A (en) Resource scheduling method and device, electronic equipment and storage medium
CN111966762A (en) Index acquisition method and device
CN113778652A (en) Task scheduling method and device, electronic equipment and storage medium
CN113391901A (en) RPA robot management method, device, equipment and storage medium
CN114615340A (en) Request processing method and device, computer equipment and storage device
CN110213213B (en) Timing task processing method and system for application
CN110839061B (en) Data distribution method, device and storage medium
CN111126604B (en) Model training method, device, server and storage medium
CN111143053A (en) Scheduling method of timing task, server and storage device
CN113419836B (en) Task processing method and device, electronic equipment and computer readable storage medium
CN114615336A (en) Request scheduling method and device, computer equipment and storage medium
CN110351293B (en) Method, device and system for sending information
CN111726417B (en) Delay control method, device, server and storage medium
CN108667636A (en) Configuration information recovery method, apparatus, memory and computer equipment
CN115794321A (en) Timing task processing method, device, medium and equipment
EP3214549A1 (en) Information processing device, method, and program
CN112667255A (en) Updating method, updating device, electronic equipment and storage medium

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
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information