CN111338775B - Method and equipment for executing timing task - Google Patents
Method and equipment for executing timing task Download PDFInfo
- Publication number
- CN111338775B CN111338775B CN202010108740.2A CN202010108740A CN111338775B CN 111338775 B CN111338775 B CN 111338775B CN 202010108740 A CN202010108740 A CN 202010108740A CN 111338775 B CN111338775 B CN 111338775B
- Authority
- CN
- China
- Prior art keywords
- application
- timing task
- interface
- information
- api
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The application provides a method and equipment for executing a timing task, which are used for simplifying operation and saving system resources when the timing task is processed. In the application, target equipment reads a currently executable timing task; the target equipment preprocesses the current executable timing task to obtain preprocessing information, wherein the preprocessing information comprises an application IP and an API (application program interface); and the target equipment initiates an Http request to call an API (application program interface) of the application IP so as to trigger an application callback Http interface corresponding to the application IP and execute the logic of the current executable timing task encapsulated by the application in the Http interface. And initiating an Http request to call an API (application programming interface) of the application IP to trigger an application callback Http interface corresponding to the application IP, and executing a timing task logic of application encapsulation corresponding to the application IP in the Http interface, so that the condition that a large number of threads are occupied by delayed input and output operations is avoided, resources of a system are saved, the concept of a client is eliminated, and the operation is simplified.
Description
Technical Field
The application relates to computer technology and provides a method and equipment for executing a timing task.
Background
With the development of technology, applications have not been made by simple addition, deletion, modification, and spelling, but have been programs with high complexity, and although the complexity of programs is higher and higher, the scheduling and execution of timing tasks, which are one of the basic functions of applications, are always maintained in various forms in the applications.
At present, many business requirements are implemented without timing tasks, for example, one monthly task, a flow which is not used up in the last month is cleared, a package flow is reset, and functions of memorandum reminding, alarm clock and the like are realized.
Currently, the scheduling and execution of the timed task for each application program is to embed the client of the timed task framework into the server of the application. At the moment, the timing task is actually distributed in the server of each application, the management of the timing task, the statistics of execution history, the authority control of the timing task and other functions need to be realized by referring to the condition of each application, and the realization process is relatively complex;
and the client of each timing task frame can create a separate thread for processing each timing task, so that system resources are consumed.
Disclosure of Invention
The embodiment of the application provides a method and equipment for executing a timing task, which are used for simplifying operation and saving system resources when the timing task is processed.
In a first aspect, an embodiment of the present application provides a method for timing a task, where the method includes:
the target equipment reads a currently executable timing task;
the target device preprocesses the current executable timing task to obtain preprocessing information, wherein the preprocessing information comprises an Application protocol (IP) and Application Programming Interface (API) Interface;
and the target equipment initiates an Http (Hyper Text Transfer Protocol) request to call the API of the application IP according to the application IP and the API in the preprocessed information so as to trigger an application callback Http interface corresponding to the application IP and execute the logic of the current executable timing task of the application package corresponding to the application IP in the Http interface.
According to the method, the Http interface of the application is called back, so that the application executes the logic of the currently executable timing task encapsulated by the Http interface, the concept of the client is removed, the timing task framework client is not required to be embedded into each application, the functions of management, statistics, authority control and the like of the timing task of the application can be realized, and the operation is simplified; and when the timing task is executed, the Http interface of the application is called, and the current executable timing task is put into the thread pool for processing, so that the condition of creating a large number of threads caused by delayed input and output operations is avoided, and system resources are saved.
In one possible implementation, the target device reads a currently executable timing task, including:
the target equipment reads a current executable timing task from the database in real time; or
The target device periodically reads the executable timing tasks in the set time length from the database, caches the executable timing tasks in the memory, and reads the current executable timing tasks from the memory.
According to the method, a specific scheme that the target device reads the currently executable timing task is given, the target device directly reads the currently executable timing task from the database, and the read task amount is reduced; or reading the executable timing task in the set time length, caching the executable timing task in the set time length in a memory, and reading the current executable timing task from the memory, thereby accelerating the reading speed and saving the reading time.
In one possible implementation, the method further includes:
the target equipment receives an application registration request and acquires basic information of a timing task in the registration request;
the target equipment stores the basic information of the timing task in the registration request into a database;
wherein the basic information comprises one or a combination of the following: application IP, interface information.
According to the method, the basic information of the executable timed task stored in the database is carried when the application registers the timed task, so that when the current executable task is acquired from the database, the basic information of the timed task can be acquired, namely the application IP and the interface information corresponding to the timed task can be acquired, and an Http request can be initiated to call the interface of the application IP.
In a possible implementation manner, the target device initiates an Http request to call an API interface of the application IP according to the application IP and the API interface in the preprocessed information, including:
if the target equipment comprises the scheduler, the scheduler directly initiates an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information; or
If the target equipment comprises a scheduler and an executor, the scheduler sends the preprocessing information to the executor so that the executor initiates an Http request to call an API (application protocol) interface of the application IP according to the application IP and the API interface in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user or selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
The method provides two specific ways for the target device to initiate the Http request to call the API interface of the application IP in the embodiment of the present application, and one way is that the scheduler directly initiates the Http request to call the API interface of the application IP when the target device includes the scheduler; and the other is that in the case that the target device comprises a scheduler and an executor, the scheduler sends the application IP and the API interface to the executor, and the executor initiates an Http request to call the API interface of the application IP. The two modes are that an Http request is initiated to call an API (application program interface) of the application IP to trigger an application callback Http interface corresponding to the application IP, and a timing task logic of application encapsulation corresponding to the application IP in the Http interface is executed, so that the condition that a large number of threads are occupied by delayed input and output operations is avoided, not only is system resources saved, but also the concept of a client is avoided, and the operation is simplified.
In one possible implementation, the method further includes:
if a scheduler in the target equipment receives the timing task execution failure information returned by the application corresponding to the application IP, executing callback service to trigger the timing task corresponding to the application execution failure information corresponding to the application IP; or
And if the scheduler in the target equipment receives the scheduling failure information of the actuator, executing callback service to trigger the timing task corresponding to the application execution failure information corresponding to the application IP.
The method provides the condition that the execution of the timing task fails, wherein the condition is that the application corresponding to the application IP fails to execute the timing task, and the condition is that the executor fails to schedule, wherein the failure information of the execution scheduling can be the failure of the application corresponding to the application IP to execute the timing task, and can also be the failure of the executor to initiate an Http request to call an API (application programming interface) of the application IP, and no matter which failure condition, the failure information needs to be returned to the scheduler so as to execute the callback service and trigger the application corresponding to the application IP to execute the timing task corresponding to the failure information.
In a second aspect, an embodiment of the present application provides an apparatus for performing a timing task, where the apparatus includes: a processor, a memory, and a transceiver;
the processor is used for reading the program in the memory and executing the following processes:
reading a currently executable timing task;
preprocessing a current executable timing task to acquire preprocessing information, wherein the preprocessing information comprises an application IP and an API (application program interface);
and initiating an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information so as to trigger an application callback Http interface corresponding to the application IP, and executing logic of a current executable timing task encapsulated by an application corresponding to the application IP in the Http interface.
In a third aspect, an embodiment of the present application provides an apparatus for performing a timing task, where the apparatus includes: the device comprises a reading unit, an obtaining unit and a calling unit; wherein:
a reading unit for reading a currently executable timing task;
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for preprocessing a current executable timing task and acquiring preprocessing information, and the preprocessing information comprises an application IP and an API;
and the calling unit is used for initiating an Http request to call the API interface of the application IP according to the application IP and the API interface in the preprocessed information so as to trigger the application corresponding to the application IP to call back the Http interface and execute the logic of the currently executable timing task in the application package corresponding to the application IP in the Http interface.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer instructions are stored, and when executed by a processor, the computer instructions implement the method for executing a timing task provided in an embodiment of the present application.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a diagram illustrating a system for executing a timing task according to an embodiment of the present disclosure;
fig. 2 is a diagram illustrating an overall system architecture for executing a timing task according to an embodiment of the present application;
fig. 3 is a structural diagram of an apparatus for performing a timing task according to an embodiment of the present application;
FIG. 4 is a block diagram of an apparatus for performing timing tasks according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a method for executing a timing task according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solution and advantages of the present application more clearly and clearly understood, the technical solution in the embodiments of the present application will be described below in detail and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Currently, an application program embeds a timing task framework client in a server of the application program, and implements a corresponding interface in the client to execute a timing task of the application program. Because the timing task framework client is embedded in the server of the application program, the functions of timing task management, historical execution statistics, timing task authority control and the like are more complicated;
in the implementation of the client of the framework of the timing task, each timing task is created but processed by a separate thread, and a large amount of system resources are consumed for services with more timing tasks.
The following problems may also exist:
if the timing task frame needs to be upgraded and the modification of the client is involved, the application programs embedded into the timing task frame client need to be upgraded and restarted; after the application program is embedded into the client of the timed task framework, the functions of the client need to be known, a corresponding interface is realized, and the development cost is increased.
Therefore, based on the above technical problem, the present application provides a method for executing a timing task. In the application, an Http interface is developed in the application, and the logic of the timing task currently executable by the application is realized in the Http interface. The application provides target equipment, and the target equipment is used for initiating an Http request to the application so that the application executes logic of the current executable timing task of the application package in an Http interface developed by the target equipment; specifically, the target device reads a current executable timing task, preprocesses the current executable task, obtains an application IP and an API interface corresponding to the current executable task, initiates an Http request to call the API interface of the application IP, so as to trigger an application callback Http interface corresponding to the application IP, and executes the current executable timing task encapsulated by the application at the Http interface developed by the target device.
In the application, the application packages the executable timing task in the Http interface in advance, and calls back the Http interface of the application through the Http request of the target device, executes the logic of the current executable timing task, removes the concept of the client, and can realize the functions of management, statistics, authority control and the like of the application timing task without embedding the timing task framework client into each application, thereby simplifying the operation; and when the timing task is executed, the Http interface of the application is mainly called, and the current executable timing task is put into the thread pool to be processed, so that the condition of creating a large number of threads caused by delayed input and output operations is avoided, and system resources are saved.
The method for executing the timing task provided by the embodiment of the application is described in detail below with reference to the accompanying drawings and the detailed description. It should be noted that the steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flow charts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
As shown in fig. 1, a system structure diagram for executing a timing task according to an embodiment of the present application is provided, where the system for executing the timing task includes a target device 10 and an application 20; wherein:
a target device 10 for reading a currently executable timed task; preprocessing a current executable timing task to acquire preprocessing information, wherein the preprocessing information comprises an application IP and an API (application program interface); and initiating an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information so as to trigger an application callback Http interface corresponding to the application IP, and executing logic of a current executable timing task encapsulated by an application corresponding to the application IP in the Http interface.
And the application 20 is configured to receive an Http request sent by the target device, call back an Http interface pre-developed in the target device, and execute a logic of a currently executable timing task in the Http interface, where the Http interface is encapsulated with a logic of applying the currently executable timing task.
In the application, target equipment calls an API (application programming interface) of an application by sending an Http request so that the application recalls the Http interface and executes a logic of a current executable timing task in the Http interface, wherein the Http interface of the application is developed in advance and is pre-packaged with the logic of the current executable timing task corresponding to the application; the method and the device have the advantages that the logical process of the current executable timing task is realized by sending the Http request and calling the Http interface, the concept of the client is removed, the cost is reduced, the Http interface is called, the condition of creating a large number of threads caused by delayed input and output operations is avoided, and system resources are saved.
In a possible implementation manner, the target device 10 includes a plurality of schedulers 101, a plurality of executors 102, a management interface 103, a database 104, and a registry 105; fig. 2 is a diagram illustrating an overall system structure for executing a timing task according to an embodiment of the present application.
The scheduler 101 further includes a scheduling processing unit 1010, a scheduling policy unit 1011, a registration service unit 1012, a callback service unit 1013, and a detail management unit 1014;
a scheduling processing unit 1010 for scheduling a timing task;
a scheduling policy unit 1011 for selecting a scheduling policy;
a registration service unit 1012 for registering a timing task;
a callback service unit 1013 for calling back the Http request sent by the API interface;
a detail management unit 1014 for performing management of detailed information.
The executor 102 includes a common task execution service unit 1020, a sliced task execution service unit 1021, an executor registration service unit 1022, and an execution result callback unit 1023;
a general task execution service unit 1020 for executing a general timing task;
a slicing task execution service unit 1021, configured to distribute and execute the timing task;
the executor registration service unit 1022 is configured to receive information sent by the scheduler;
the execution result callback unit 1023 is used for returning the execution result to the scheduler.
The management interface 103 comprises a user management unit 1030, an executor management unit 1031, a task management unit 1031, and a task execution condition analysis unit 1032;
the user management unit 1030 is configured to display an interface for a user, so that the user can manage the interface conveniently;
an executor management unit 1031, configured to receive a user selection of an executor for a timed task;
a task management unit 1031 for adding, modifying, starting, stopping, deleting tasks, and the like;
the task execution condition analysis unit 1032 is configured to display an execution condition, so that a user can analyze the execution condition conveniently.
And the database 104 is used for storing the basic information of the timing task, storing the basic information of the timing task in the database every time the timing task registration is received, and reading the timing task from the database when the timing task in the database reaches the time and an executor executes the timing task.
And the registration center 105 is used for being responsible for service discovery of the schedulers, automatically selecting the schedulers which do not fail and have small resource occupation amount when the schedulers have faults or the schedulers have overlarge loads, and distributing the timing tasks to the selected schedulers.
In the present application, when the target device reads the currently executable timed task, the target device reads the currently executable timed task from the database.
The timing task stored in the database is that after the target device receives a registration request of an application, basic information of the timing task carried in the registration request is stored in the database, and the basic information includes but is not limited to: application IP, interface information.
When the current executable timing task is read from the database, the current executable timing task can be read from the database in real time or periodically.
Specifically, the target device reads a currently executable timing task from a database in real time; or
The target device periodically reads the executable timing tasks in the set time length from the database, caches the executable timing tasks in the memory, and reads the current executable timing tasks from the memory.
After reading the currently executable timed task, the application executing the currently executable timed task needs to execute the logic of the read currently executable timed task, so that a request needs to be sent to the application executing the currently executable timed task to trigger the application to execute the logic of the currently executable timed task.
Because the logic of the read currently executable timed task needs to be executed by the application of the currently executable timed task, the target device needs to determine the application corresponding to the currently executable timed task.
Therefore, the target device needs to preprocess the read current executable timing task, obtain the application IP and API interface corresponding to the timing task, and determine the application for executing the current executable timing task according to the application IP and API interface.
After the application IP and the API corresponding to the timing task are obtained, an Http request is initiated to the API of the application IP, namely, the Http request is initiated to call the API of the application IP, so that the application corresponding to the application IP triggers the logic of the currently executable timing task.
If the target equipment comprises the scheduler, the scheduler directly initiates an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information; or
If the target equipment comprises a scheduler and an executor, the scheduler sends the preprocessing information to the executor so that the executor initiates an Http request to call an API (application protocol) interface of the application IP according to the application IP and the API interface in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user or selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
After the Http request is initiated through the above situation, when the application executes the logic of the current executable timing task in the Http interface, if the execution fails, returning failure information of executing the timing task to the scheduler, and if the scheduler in the target device receives the failure information of executing the timing task returned by the application corresponding to the application IP, executing a callback service to trigger the timing task corresponding to the failure information of executing the application corresponding to the application IP; or
When the actuator initiates the Http request, scheduling failure occurs, and the actuator returns scheduling failure information to the scheduler. And when the scheduler in the target equipment receives the scheduling failure information of the actuator, executing callback service to trigger the timing task corresponding to the application execution failure information corresponding to the application IP.
As shown in fig. 3, a structure diagram of an apparatus for executing a timing task provided in an embodiment of the present application includes: a processor 300, a memory 301, and a transceiver 302;
the processor 300 is configured to read a program in the memory 301 and execute the following processes:
reading a currently executable timing task;
preprocessing a current executable timing task to acquire preprocessing information, wherein the preprocessing information comprises an application IP and an API (application program interface);
and initiating an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information so as to trigger an application callback Http interface corresponding to the application IP, and executing logic of a current executable timing task encapsulated by an application corresponding to the application IP in the Http interface.
In one possible implementation, the processor 300 is specifically configured to:
reading a currently executable timing task from a database in real time; or
Periodically reading the executable timing tasks in the set time length from the database, caching the executable timing tasks in a memory, and reading the current executable timing tasks from the memory.
In one possible implementation, the processor 300 is configured to:
receiving an application registration request, and acquiring basic information of a timing task in the registration request;
storing the basic information of the timing task in the registration request into a database;
wherein, the basic information comprises one or a combination of the following: application IP, interface information.
In one possible implementation, if the apparatus includes a scheduler, the processor 300 is further configured to:
directly initiating an Http request to call an API (application program interface) of the application IP through a scheduler according to the application IP and the API in the preprocessed information;
if the apparatus comprises a scheduler and an executor, the processor 300 is further configured to:
sending the preprocessing information to an actuator through a scheduler, so that the actuator initiates an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user or selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
In one possible implementation, the processor 300 is further configured to:
if receiving the failure information of executing the timing task returned by the application corresponding to the application IP through the scheduler, executing callback service to trigger the timing task corresponding to the failure information of executing the application corresponding to the application IP; or
And if the executor scheduling failure information is received through the scheduler, executing callback service to trigger the timing task corresponding to the application execution failure information corresponding to the application IP.
As shown in fig. 4, for the apparatus for performing a timing task according to an embodiment of the present application, the apparatus 400 includes: a reading unit 401, an obtaining unit 402 and a calling unit 403, wherein;
a reading unit 401, configured to read a currently executable timing task;
an obtaining unit 402, configured to pre-process a currently executable timing task, and obtain pre-processing information, where the pre-processing information includes an application IP and an API interface;
a calling unit 403, configured to initiate an Http request to call an API interface of the application IP according to the application IP and the API interface in the pre-processing information, so as to trigger an application callback Http interface corresponding to the application IP, and execute a logic of a currently executable timing task encapsulated by an application corresponding to the application IP in the Http interface.
In one possible implementation, the reading unit 402 is specifically configured to:
reading a currently executable timing task from a database in real time; or
Periodically reading the executable timing tasks in the set time length from the database, caching the executable timing tasks in a memory, and reading the current executable timing tasks from the memory.
In a possible implementation manner, the apparatus for performing timing task further includes a receiving unit 404 and a storing unit 405, where:
a receiving unit 404, configured to receive an application registration request, and obtain basic information of a timing task in the registration request;
a storage unit 405, configured to store basic information of the timing task in the registration request in a database;
wherein the basic information comprises one or a combination of the following: application IP, interface information.
In a possible implementation manner, if the apparatus includes a scheduler, the invoking unit 403 is further configured to:
directly initiating an Http request to call an API (application program interface) of the application IP through a scheduler according to the application IP and the API in the preprocessed information;
if the apparatus includes a scheduler and an executor, the invoking unit 403 is further configured to:
sending the preprocessing information to an actuator through a scheduler, so that the actuator initiates an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user or selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
In a possible implementation manner, the apparatus further includes a callback unit 406, where the callback unit 406 is configured to:
if receiving the failure information of executing the timing task returned by the application corresponding to the application IP through the scheduler, executing callback service to trigger the timing task corresponding to the failure information of executing the application corresponding to the application IP; or
And if the executor scheduling failure information is received through the scheduler, executing callback service to trigger the timing task corresponding to the application execution failure information corresponding to the application IP.
Based on the same inventive concept, the embodiment of the present invention further provides a method for executing a timing task, and since a device corresponding to the method is a target device in the system for executing a timing task according to the embodiment of the present invention, and a principle of solving a problem of the method is similar to that of the device, the method can be implemented by referring to the implementation of the device, and repeated details are not described again.
As shown in fig. 5, a flowchart of a method for executing a timing task provided in an embodiment of the present application includes the following steps:
In one possible implementation, the target device reads a currently executable timing task, including:
the target equipment reads a current executable timing task from the database in real time; or
The target device periodically reads the executable timing tasks in the set time length from the database, caches the executable timing tasks in the memory, and reads the current executable timing tasks from the memory.
In one possible implementation, the method further includes:
the target equipment receives an application registration request and acquires basic information of a timing task in the registration request;
the target equipment stores the basic information of the timing task in the registration request into a database;
wherein, the basic information comprises one or a combination of the following: application IP, interface information.
In a possible implementation manner, the target device initiates an Http request to call an API interface of the application IP according to the application IP and the API interface in the preprocessed information, including:
if the target equipment comprises the scheduler, the scheduler directly initiates an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information; or
If the target equipment comprises a scheduler and an executor, the scheduler sends the preprocessing information to the executor so that the executor initiates an Http request to call an API (application protocol) interface of the application IP according to the application IP and the API interface in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user or selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
In one possible implementation, the method further includes:
if a scheduler in the target equipment receives the failure information of the execution timing task returned by the application corresponding to the application IP, the callback service is executed so as to trigger the timing task corresponding to the failure information of the application execution corresponding to the application IP; or
And if the scheduler in the target equipment receives the scheduling failure information of the actuator, executing callback service to trigger the timing task corresponding to the application execution failure information corresponding to the application IP.
In some possible embodiments, the aspects of the method for performing a timing task provided by the present application may also be implemented in the form of a program product including program code for causing a computer device to perform the steps in the information search method according to various exemplary embodiments of the present application described above in this specification when the program product is run on the computer device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product generated by the information search of the embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with a command execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with a command execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on the user equipment, as a stand-alone software package, partly on the user computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (10)
1. A method of performing timed tasks, the method comprising:
the target equipment reads a currently executable timing task;
the target equipment preprocesses the current executable timing task to obtain preprocessing information, wherein the preprocessing information comprises an application IP and an Application Programming Interface (API) interface;
and the target equipment initiates a hypertext transfer protocol Http request to call the API interface of the application IP according to the application IP and the API interface in the preprocessed information so as to trigger an application callback Http interface corresponding to the application IP and execute the logic of the current executable timing task of the application package corresponding to the application IP in the Http interface.
2. The method of claim 1, wherein the target device reading a currently executable timed task comprises:
the target equipment reads a current executable timing task from a database in real time; or
The target device periodically reads the executable timing tasks in the set time length from the database, caches the executable timing tasks in the memory, and reads the current executable timing tasks from the memory.
3. The method of claim 2, further comprising:
the target equipment receives an application registration request and acquires basic information of a timing task in the registration request;
the target equipment stores the basic information of the timing task in the registration request into a database;
wherein the basic information comprises one or a combination of the following: application IP, interface information.
4. The method of claim 1, wherein the target device initiates an Http request to call an API interface of the application IP according to the application IP and the API interface in the preprocessed information, comprising:
if the target equipment comprises a scheduler, the scheduler directly initiates an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information; or
If the target equipment comprises a scheduler and an executor, the scheduler sends the preprocessing information to the executor so that the executor initiates an Http request to call an API (application Internet protocol) interface of the application IP according to the application IP and the API interface in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user, or is selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
5. The method of claim 4, further comprising:
if the scheduler in the target device receives failure information of executing the timing task returned by the application corresponding to the application IP, executing callback service to trigger the application corresponding to the application IP to execute the timing task corresponding to the failure information; or
And if the scheduler in the target equipment receives the executor scheduling failure information, executing callback service to trigger the application corresponding to the application IP to execute the timing task corresponding to the failure information.
6. An apparatus for performing timed tasks, the apparatus comprising: a processor, a memory, and a transceiver;
the processor is used for reading the program in the memory and executing the following processes:
reading a currently executable timing task;
preprocessing a current executable timing task to acquire preprocessing information, wherein the preprocessing information comprises an application IP and an API (application program interface);
and initiating an Http request to call an API (application program interface) of the application IP according to the application IP and the API in the preprocessing information so as to trigger an application callback Http interface corresponding to the application IP, and executing logic of a current executable timing task encapsulated by an application corresponding to the application IP in the Http interface.
7. The device of claim 6, wherein the processor is specifically configured to:
reading a currently executable timing task from a database in real time; or
Periodically reading the executable timing tasks in the set duration from the database, caching the executable timing tasks in the memory, and reading the current executable timing tasks from the memory.
8. The device of claim 7, wherein the processor is to:
receiving an application registration request, and acquiring basic information of a timing task in the registration request;
storing basic information of the timing task in the registration request into a database;
wherein the basic information comprises one or a combination of the following: application IP, interface information.
9. The apparatus of claim 6, wherein if a scheduler is included, the processor is further configured to:
directly initiating an Http request to call an API (application program interface) of the application IP through a scheduler according to the application IP and the API in the preprocessed information;
if a scheduler and an executor are included, the processor is further configured to:
sending the preprocessing information to the executor through the scheduler, so that the executor initiates an Http request to call an API (application protocol) interface of the application IP according to the application IP and the API interface in the preprocessing information; the executor is determined by the scheduler according to executor management information set by a user, or is selected from a plurality of executors according to result information of executing tasks corresponding to the executor.
10. The device of claim 9, wherein the processor is further configured to:
if receiving failure information of executing the timing task returned by the application corresponding to the application IP through the scheduler, executing callback service to trigger the application corresponding to the application IP to execute the timing task corresponding to the failure information; or
And if the executor scheduling failure information is received through the scheduler, executing callback service to trigger the application corresponding to the application IP to execute the timing task corresponding to the failure information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010108740.2A CN111338775B (en) | 2020-02-21 | 2020-02-21 | Method and equipment for executing timing task |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010108740.2A CN111338775B (en) | 2020-02-21 | 2020-02-21 | Method and equipment for executing timing task |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111338775A CN111338775A (en) | 2020-06-26 |
CN111338775B true CN111338775B (en) | 2022-06-07 |
Family
ID=71181900
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010108740.2A Active CN111338775B (en) | 2020-02-21 | 2020-02-21 | Method and equipment for executing timing task |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111338775B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113779467A (en) * | 2021-01-05 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Method and device for visualizing functional component management |
CN113806651B (en) * | 2021-09-18 | 2024-05-24 | 深圳市酷开网络科技股份有限公司 | Data caching method, device, server and storage medium |
CN114696888B (en) * | 2022-04-25 | 2022-10-21 | 北京航天驭星科技有限公司 | Port task processing method, device, equipment and medium of satellite measurement, operation and control system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108733461A (en) * | 2017-04-18 | 2018-11-02 | 北京京东尚科信息技术有限公司 | Distributed task dispatching method and apparatus |
CN109656706A (en) * | 2018-12-25 | 2019-04-19 | 江苏满运软件科技有限公司 | Distributed task dispatching method, system, equipment and medium |
CN110290180A (en) * | 2019-05-31 | 2019-09-27 | 北京大米科技有限公司 | Distributed task dispatching method, apparatus, computer equipment and storage medium |
CN110673918A (en) * | 2019-09-27 | 2020-01-10 | 北京猎户星空科技有限公司 | Control method and device of intelligent equipment, intelligent equipment and storage medium |
CN110764881A (en) * | 2019-10-23 | 2020-02-07 | 中国工商银行股份有限公司 | Distributed system background retry method and device |
-
2020
- 2020-02-21 CN CN202010108740.2A patent/CN111338775B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108733461A (en) * | 2017-04-18 | 2018-11-02 | 北京京东尚科信息技术有限公司 | Distributed task dispatching method and apparatus |
CN109656706A (en) * | 2018-12-25 | 2019-04-19 | 江苏满运软件科技有限公司 | Distributed task dispatching method, system, equipment and medium |
CN110290180A (en) * | 2019-05-31 | 2019-09-27 | 北京大米科技有限公司 | Distributed task dispatching method, apparatus, computer equipment and storage medium |
CN110673918A (en) * | 2019-09-27 | 2020-01-10 | 北京猎户星空科技有限公司 | Control method and device of intelligent equipment, intelligent equipment and storage medium |
CN110764881A (en) * | 2019-10-23 | 2020-02-07 | 中国工商银行股份有限公司 | Distributed system background retry method and device |
Also Published As
Publication number | Publication date |
---|---|
CN111338775A (en) | 2020-06-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3357006B1 (en) | Workflow service using state transfer | |
CN107943577B (en) | Method and device for scheduling tasks | |
US9904585B1 (en) | Error handling in executing workflow state machines | |
US20200410031A1 (en) | Systems and methods for cloud computing | |
CN111338775B (en) | Method and equipment for executing timing task | |
CN107463434B (en) | Distributed task processing method and device | |
US10318273B2 (en) | Updating software components through online stores | |
US10185558B2 (en) | Language-independent program composition using containers | |
US9231995B2 (en) | System and method for providing asynchrony in web services | |
CN107479990A (en) | Distributed software service system | |
CN107766101A (en) | App starts processing method, device and the equipment of event | |
EP3901773A1 (en) | Dynamically allocated cloud worker management system and method therefor | |
CN112051993A (en) | State machine template generation and task processing method, device, medium and equipment | |
CN109885624A (en) | Data processing method, device, computer equipment and storage medium | |
CN109873863B (en) | Asynchronous calling method and device of service | |
CN107045475B (en) | Test method and device | |
CN113127225A (en) | Method, device and system for scheduling data processing tasks | |
CN111130900A (en) | Data acquisition method and device based on distributed interconnection of coordination services | |
CN110457132B (en) | Method and device for creating functional object and terminal equipment | |
CN109271238A (en) | Support the task scheduling apparatus and method of a variety of programming languages | |
CN112817706A (en) | Distributed task scheduling system and method | |
CN115576782A (en) | Transaction processing method and device based on monitoring mechanism | |
CN115455325A (en) | Page rendering method, device, equipment, medium and program product | |
CN111190725B (en) | Task processing method, device, storage medium and server | |
CN112799797B (en) | Task management method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |