[go: up one dir, main page]

CN119065803A - Scheduled task scheduling method and system - Google Patents

Scheduled task scheduling method and system Download PDF

Info

Publication number
CN119065803A
CN119065803A CN202410862467.0A CN202410862467A CN119065803A CN 119065803 A CN119065803 A CN 119065803A CN 202410862467 A CN202410862467 A CN 202410862467A CN 119065803 A CN119065803 A CN 119065803A
Authority
CN
China
Prior art keywords
target
service
scheduling
executor
target service
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
CN202410862467.0A
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 Urban Construction Intelligent Control Technology Co ltd
Original Assignee
Beijing Urban Construction Intelligent Control 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 Urban Construction Intelligent Control Technology Co ltd filed Critical Beijing Urban Construction Intelligent Control Technology Co ltd
Priority to CN202410862467.0A priority Critical patent/CN119065803A/en
Publication of CN119065803A publication Critical patent/CN119065803A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明提供一种定时任务调度方法和系统,应用于定时任务调度系统,所述定时任务调度系统包括定时任务管理平台和执行器,所述方法包括:通过定时任务管理平台获取用户输入的调度配置;根据所述调度配置确定对应的目标服务,并向所述目标服务对应的执行器发送调度请求;所述调度请求中包括目标定时任务的标识,用于指示所述目标服务对应的执行器通过所述目标服务去执行所述目标定时任务;其中,所述目标服务对应的执行器预先整合至所述目标服务中,且所述目标服务启动时相应启动所述目标服务对应的执行器。通过该定时任务调度方法和系统,可以减少执行定时任务时的开销。

The present invention provides a timed task scheduling method and system, which are applied to a timed task scheduling system, wherein the timed task scheduling system includes a timed task management platform and an executor, and the method includes: obtaining a scheduling configuration input by a user through the timed task management platform; determining a corresponding target service according to the scheduling configuration, and sending a scheduling request to the executor corresponding to the target service; the scheduling request includes an identifier of a target timed task, which is used to instruct the executor corresponding to the target service to execute the target timed task through the target service; wherein the executor corresponding to the target service is pre-integrated into the target service, and the executor corresponding to the target service is started accordingly when the target service is started. Through the timed task scheduling method and system, the overhead when executing timed tasks can be reduced.

Description

Timing task scheduling method and system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and a system for scheduling a timing task.
Background
The distributed task scheduling is to manage and execute timing tasks in a distributed environment. Timed tasks refer to tasks that are performed at a certain time or at regular intervals. Task scheduling generally involves task state management, transmission and reception of task scheduling requests, specific task allocation, specific execution of tasks, and the like.
In the related art of distributed task scheduling, there are numerous open source projects and schemes, such as the quartz distributed scheduling scheme, whose scheduling logic mainly involves task management, task scheduling, and task execution. The quatertz core component has three components, namely Job (task) which is specifically to be executed, trigger which is used for defining the triggering condition, triggering time, triggering interval, ending time and the like of Job, and Scheduler which starts Trigger to execute Job.
However, the above-mentioned quatertz distributed task scheduling scheme has a problem of high overhead in executing tasks.
Disclosure of Invention
The invention provides a timing task scheduling method and a timing task scheduling system, which are used for solving the defect that the expenditure is large in the task executing process of a quartz distributed task scheduling scheme in the prior art, and realizing the technical effect of reducing the expenditure in the timing task executing process.
The invention provides a timing task scheduling method, which is applied to a timing task scheduling system, wherein the timing task scheduling system comprises a timing task management platform and an executor, and the method comprises the following steps:
acquiring scheduling configuration input by a user through a timing task management platform;
Determining a corresponding target service according to the scheduling configuration, and sending a scheduling request to an actuator corresponding to the target service, wherein the scheduling request comprises an identifier of a target timing task and is used for indicating the actuator corresponding to the target service to execute the target timing task through the target service;
The executors corresponding to the target service are integrated into the target service in advance, and the executors corresponding to the target service are started correspondingly when the target service is started.
According to the timing task scheduling method provided by the invention, the method further comprises the following steps:
integrating the executor and the service managed by the executor to obtain an integrated service, wherein the integrated service comprises sub-services corresponding to the executor.
According to the method for scheduling timing tasks provided by the invention, the integrating of the executor and the service managed by the executor to obtain the integrated service comprises the following steps:
acquiring a core data packet corresponding to an actuator and a preset project public data packet;
Adding the core data packet into the project public data packet to obtain a configured target public data packet;
And adding the target public data packet into a configuration file corresponding to the service to obtain the integrated service.
According to the method for scheduling timing tasks provided by the invention, the core data packet is added into the project public data packet to obtain the configured target public data packet, and the method comprises the following steps:
acquiring related information of the timing task management platform, wherein the related information comprises at least one of a platform address, a log storage path and log storage time of the timing task management platform;
And adding the core data packet into the project public data packet, and configuring related information in the project public data packet to obtain the target public data packet.
According to the timing task scheduling method provided by the invention, the scheduling configuration comprises the names and port information of the services and the identification of the target timing task;
the determining the corresponding target service according to the scheduling configuration includes:
Determining a target IP address corresponding to the identification in a database according to the identification of the target timing task, wherein the database stores the corresponding relation between the identification of the timing task and the IP address of the executor;
And determining the target service according to the target IP address, the name of the service and the port information.
According to the method for scheduling timing tasks provided by the invention, the method for determining the target service according to the target IP address, the name of the service and the port information comprises the following steps:
Determining target annotation content corresponding to the mark in a database according to the mark of the target timing task;
and determining the target service according to the target annotation content, the target IP address, the name of the service and the port information.
According to the timing task scheduling method provided by the invention, the method further comprises the following steps:
Acquiring heartbeat information between an actuator corresponding to the target service and a timing task management platform;
and determining the state of the actuator corresponding to the target service according to the heartbeat information, and displaying the state in the timing task management platform, wherein the state comprises the online state or the offline state of the actuator.
The invention also provides a timing task scheduling system, which comprises a timing task management platform and an executor;
The timing task management platform is used for acquiring the scheduling configuration input by a user, determining corresponding target service according to the scheduling configuration, and sending a scheduling request to an executor corresponding to the target service, wherein the scheduling request comprises the identification of the target timing task;
And the executor is used for executing the target timing task through the target service, wherein the executor corresponding to the target service is integrated into the target service in advance, and the executor corresponding to the target service is started correspondingly when the target service is started.
According to the timed task scheduling system provided by the invention, the timed task management platform comprises a control for operating the timed task, and the operation comprises at least one of adding, deleting, modifying and searching.
According to the timed task scheduling system provided by the invention, the timed task management platform is connected with the database, and the database is used for storing data generated in the timed task management platform.
The timing task scheduling system comprises a timing task management platform and an executor, wherein the timing task management platform is used for acquiring scheduling configuration input by a user, and sending a scheduling request to the executor corresponding to a target service after determining the corresponding target service according to the scheduling configuration, wherein the scheduling request comprises an identification of the target timing task and is used for indicating the executor corresponding to the target service to execute the target timing task through the target service, and the executor corresponding to the target service is pre-integrated into the target service and correspondingly started up the executor corresponding to the target service when the target service is started. In the method, the executor and the service can be integrated, so that the executor does not need to be independently started to serve when the executor executes the timing task, and the expenditure when the executor executes the timing task can be reduced.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a system block diagram of a prior art quatertz task scheduling scheme;
FIG. 2 is a schematic flow chart of a method for scheduling timed tasks according to the present invention;
FIG. 3 is a second flow chart of the method for scheduling timed tasks according to the present invention;
FIG. 4 is a third flow chart of the timing task scheduling method according to the present invention;
FIG. 5 is a schematic diagram of a timing task scheduling system provided by the present invention;
fig. 6 is a detailed schematic diagram of a timing task scheduling system provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the field of distributed task scheduling, a plurality of open source projects and schemes, such as quartz, saturn, elastic-job and the like, exist, and the task scheduling service concept is flying and the service is complex. The quatertz scheme supports clustering and distribution, but does not have a good management console, has single function and is difficult to manage and dispatch tasks. The scheme uses a database lock, uses a pessimistic lock mode to lock the trigger, ensures the accuracy of task synchronization, runs a task here once a certain node acquires the lock, and waits only when another node wants to use the trigger task. The method is not distributed, cannot be high in availability, does not solve the problem of task slicing, and has the limit of single machine processing. The elastic-job is also a distributed scheduling solution, the core comprises 2 sub-items, the solution is positioned as a centerless solution, and distributed coordination service is provided in the form of a package, so that the service requirements of most enterprises can be met. But this solution is cumbersome to deploy.
The quatertz scheduling scheme and the elastic-job scheduling scheme are specifically described below, respectively.
1. The distributed scheduling logic of the quatz mainly relates to task management, task scheduling and task execution.
1. Task management
Referring to the system block shown in fig. 1, quatertz uses Job (Job item) and Trigger to manage tasks. Job defines the task logic to be executed specifically, and Trigger is used to define the Trigger condition and execution frequency of the task. In a distributed environment, task management is typically centralized on a Scheduler master node (i.e., scheduler in the figure, available from Scheduler Factory Scheduler factories), which is responsible for managing all tasks. Other scheduler nodes can synchronize task information with the master node in a cluster communication mode to realize unified scheduling of tasks
2. Task scheduling
Quartz provides various flexible scheduling strategies that can be configured according to specific needs. Including simple scheduling, cron scheduling, calendar scheduling, round robin scheduling, etc. These scheduling policies may be configured according to the trigger conditions, execution frequency, priority, etc. of the tasks. In a distributed environment, quatertz may use various cluster communication techniques to implement scheduling of tasks. For example, JDBCStore is used for storing task information, the task is synchronized and scheduled through a database, terracotta is used for memory sharing, and the distributed scheduling of the tasks is realized.
3. Task execution
Quartz uses JobDetail and JobExecutionContext to perform tasks. JobDetail define the specific task logic to be performed, while JobExecutionContext provides the context information needed to perform the task. In a distributed environment, execution of tasks may occur on different nodes. quartz provides a load balancing and fault recovery mechanism for tasks, ensures that tasks can be accurately distributed to available nodes for execution, and automatically switches to other available nodes for execution in the event of a node failure.
However, the above-mentioned quartz task scheduling scheme has several problems of 1. The configuration is relatively complex and requires a certain learning cost, 2. Because the implementation of the core library depends on jdbc (Java DataBase Connectivity (Java language connection database)), overhead is generated, 3. The technology is distributed to solve only the problem of high availability and does not solve the problem of task fragmentation, 4. The technology is distributed to have poor scheduling performance, especially when the task amount is increased and the task with second level is particularly obvious, 5. No self-contained management interface is provided, scheduling logic and execution task are coupled together, and maintenance needs restarting service.
2. The elastic-Job adopts a decentralization design and is mainly divided into a registry, a data slicing module, a distributed coordination module, a timing task processing module, a customized flow task module and the like.
Wherein, the decentralization refers to the concept that the elastic-Job has no dispatch center. Each job server running in the cluster is peer-to-peer, and distributed coordination is performed between nodes through the registry. But the elastic-job has the concept of a master node, and the master node is used for processing some centralized tasks, such as slicing, cleaning up runtime information and the like, and has no scheduling function, and the timing scheduling is triggered by the job server.
Registry-registry module currently uses zookeeper (distributed application coordination service) directly for recording configuration of job, server information and job running state. zookeeper is mature, but the principle is complex, the zookeeper is difficult to use, and the zookeeper has performance and network problems under the condition of mass data support.
Data slicing, namely, data slicing is an important concept for realizing distribution in elastic-job, and real data and logic slicing are corresponding to be used for decoupling the relation between a work framework and data. The job framework is only responsible for reasonably distributing the fragments to the relevant job servers, and the job servers need to process according to the distributed fragment matching data. Server fragments are currently stored in the registry, with each server pulling fragments according to its own IP (Internet Protocol ) address.
And the distributed coordination module is used for processing the dynamic capacity expansion and contraction of the job server. Once there are servers in the cluster that change, the distributed coordination will automatically monitor and notify the surviving job servers of the change. The coordination involves operations such as master node election, repartitioning, etc. The temporary node and listener of the currently used zookeeper implement active checking and notification functions.
And (3) timing task processing, namely timing task triggering according to the cron expression, wherein the functions of preventing simultaneous triggering of the tasks, missing the task, restarting and the like are provided at present. Mainly also using the timing scheduling function of the quatertz itself, each task uses a separate thread pool for ease of control.
The customized flow type task divides the timing task into a plurality of flows, has simple tasks without any modification, has data flow tasks of FETCHDATA/processData for processing data, and is added with message flow tasks, file tasks, workflow tasks and the like. The user can expand and contribute code in the form of plug-ins.
However, the above-mentioned elastic-job task scheduling scheme has several problems that 1. The functions provided by the elastic-job are less, a persistence mechanism and clusters are not supported (if corresponding functions are to be implemented, additional implementation is needed), 2. The central scheduling needs to introduce a Zookeeper, which increases additional complexity and maintenance cost, 3. The use and configuration are complex, and task control is inflexible.
Based on the above problems, the embodiment of the invention provides a timing task scheduling method and a timing task scheduling system, which have simple logic, easy-to-use architecture, capability of supporting task scheduling in all directions, capability of elastically expanding capacity and distributing broadcast tasks, dynamic fragmentation and good consistency, and can solve the problems.
The timed task scheduling method of the present invention is described below in conjunction with fig. 2-4.
First, the method for scheduling timed tasks according to the present embodiment may be applied to a timed task scheduling system, where the timed task scheduling system includes a timed task management platform and an executor, where the timed task management platform may provide a visual interface for a user to perform operations on the visual interface, such as modifying the timed task. And the timing task management platform can also display information related to the timing task, an executor and the like for a user to view and modify, and of course, the timing task management platform can also provide more other functions, and the subsequent embodiments can be further described. The executor is mainly used for executing timing tasks or services corresponding to the timing tasks and the like so as to realize corresponding timing functions.
The execution subject of the following embodiment may be a timed task scheduling system or a timed task management platform, and the following embodiment describes a timed task scheduling method using the timed task scheduling system as the execution subject.
A timed task scheduling method applied to the timed task scheduling system will be described below.
Fig. 2 is a schematic flow chart of a method for scheduling a timed task according to the present invention, and referring to fig. 2, the method may include the following steps:
S202, the scheduling configuration input by the user is acquired through the timing task management platform.
The timed task management platform can be a xxl-job-based distributed timed task management platform or a distributed timed display platform, the timed task management platform can provide a visual interface, and in the step, a user can input scheduling configuration on the visual interface, so that the timed task management platform can obtain the scheduling configuration. The scheduling configuration may include an identification ID (Identity) of a target timed task, which is a timed task that the user needs to execute, and remark content, etc. Wherein the ID is used for distinguishing different timing tasks, remarking content is description of the timing tasks, and mainly remarking what timing function is realized by the timing tasks. The input mode of the scheduling configuration can be a mode of voice input, manual keyboard input and the like.
A general timing task may be to implement a certain positioning function in the services, and in this embodiment, the services may be one or more services, and then the timing task may also be one or more, and in addition, the timing task in each service may also be one or more. The service here may be, for example, an alarm service, a service for acquiring data at regular time, a timing service, or the like.
The embodiment adopts the xxl-job-based timing task management platform, and has the advantages that 1, a user can easily edit the timing task on the timing task management platform, the technical threshold is reduced, 2, the development process can be simplified, the timing execution and management are simplified, 3, the architecture is light, good expansibility is provided, the application scenes of different scales can be adapted, 4, the management and monitoring of the task by the page are provided, the container deployment is supported, and the cross-platform task scheduling service is provided through HTTP (Hypertext Transfer Protocol ).
S204, determining the corresponding target service according to the scheduling configuration, and sending a scheduling request to an executor corresponding to the target service, wherein the scheduling request comprises an identifier of a target timing task and is used for indicating the executor corresponding to the target service to execute the target timing task through the target service.
The executors corresponding to the target service are integrated into the target service in advance, and the executors corresponding to the target service are started correspondingly when the target service is started. In general, an actuator may also correspond to a service, that is, the actuator itself may also be a service, and typically, when the service is started, the corresponding actuator needs to be additionally started, which has a relatively high cost. In this embodiment, the service corresponding to the actuator may be integrated into the corresponding service in advance, that is, the service includes the actuator, so that when the service is started, the corresponding actuator is started synchronously, and no additional starter is needed, so that the overhead may be reduced or reduced, and meanwhile, the execution time of the timing task may be saved, and the execution efficiency of the timing task may be improved.
In addition, for the above-mentioned service and the executor, the general service and the corresponding executor may be registered in advance in the timed task management platform, specifically, an address of the timed task management platform may be configured in the executor, then the executor may access to the timed task management platform through the address, and register the executor and the corresponding service in the timed task management platform, so that the timed task management platform may manage the executor and the service subsequently. The specific management can be, for example, to display the states of each actuator and service in detail, so that the user can conveniently and timely check the corresponding problems of the service and the actuators, and meanwhile, to display the execution results of each actuator and service in detail, so that the user can conveniently and timely adjust the problems between the timing task management platform and the actuators and between the timing task management platform and the service.
Specifically, after the timing task management platform obtains the scheduling configuration, an executor and a service corresponding to the ID of the timing task can be found in the database according to the ID of the target timing task in the scheduling configuration, and the corresponding service is marked as the target service. And then, the scheduling request can be determined based on the target service and the information related to the executor, and the scheduling request is sent to the executor corresponding to the target service, so that the executor can execute the corresponding target timing task through the target service to realize the corresponding timing function, such as acquiring the alarm data in the alarm service at fixed time.
In addition, the database may store in advance the correspondence between the identifiers of the different timing tasks and the related information of the executor or the service, and of course, other correspondence may also be stored.
The timing task scheduling method is applied to a timing task scheduling system, and comprises a timing task management platform and an executor, wherein the timing task scheduling system acquires scheduling configuration input by a user through the timing task management platform, and sends a scheduling request to the executor corresponding to the target service after determining the corresponding target service according to the scheduling configuration, the scheduling request comprises an identification of the target timing task and is used for indicating the executor corresponding to the target service to execute the target timing task through the target service, and the executor corresponding to the target service is pre-integrated into the target service and correspondingly starts the executor corresponding to the target service when the target service is started. In the method, the executor and the service can be integrated, so that the executor does not need to be independently started to serve when the executor executes the timing task, and the expenditure when the executor executes the timing task can be reduced.
The following examples illustrate the above-mentioned process of service and actuator integration.
In an exemplary embodiment, the above method further comprises the steps of:
and step A, integrating the executor and the service managed by the executor to obtain an integrated service, wherein the integrated service comprises sub-services corresponding to the executor.
In this step, each service may have a corresponding actuator, or multiple services may correspond to one actuator, where the actuator is also usually a service, denoted as a sub-service, where the sub-service corresponding to the actuator may be integrated into the actual service, to obtain an integrated service.
After integrating the actuator into the actual service, the actuator is part of the actual service, so that the integrated service has the function of the actuator, and the integrated service can directly execute the corresponding function.
In this embodiment, the sub-services corresponding to the executor are integrated into the actual service, so that the actual service itself has the function of the executor, and thus, the light coupling mode enables the service to directly execute the corresponding timing function without additionally restarting the executor to execute, thereby greatly reducing the cost of timing task execution and improving the efficiency of timing task execution.
The following example illustrates one possible implementation of integrating an actuator specifically into an actual service.
Fig. 3 is a second flow chart of the timing task scheduling method provided by the present invention, referring to fig. 3, the step a may include the following steps:
s302, obtaining a core data packet corresponding to an actuator and a preset project public data packet.
The item may be, for example, a cloud operation and maintenance item, and the specific item is not limited herein. The data packet corresponding to the project is generally obtained after the project is constructed, wherein there are public data packets and private data packets of the project. Wherein the public data packet is a general data packet, namely, a data packet which can be used by other projects, and can also be called a public parent packet. The private data packet is unique to the item, and other items are generally not available.
In addition, the core data packet of the actuator refers to a data packet for realizing the core function of the actuator, and the corresponding core data packet can be obtained when the actuator is designed.
S304, adding the core data packet into the project public data packet to obtain the configured target public data packet.
In this step, after the core packet of the actuator and the public packet of the item are obtained, the core packet of the actuator may be added to the public packet, specifically, may be added to a specific location in the public packet, and a new packet may be formed with the public packet, and may be denoted as a target public packet. The specific position may be set according to the actual situation, and may be, for example, the end position of the public data packet.
In order to integrate the information of the timed task management platform into the project, the data of the timed task management platform may be configured in the common data packet of the project when the common data packet of the project is configured, and this process will be described below. The method comprises the steps of obtaining related information of a timing task management platform, wherein the related information comprises at least one of a platform address, a log storage path and a log storage time of the timing task management platform, adding a core data packet into a project public data packet, and configuring the related information in the project public data packet to obtain a target public data packet.
The address of the timing task management platform can be an IP address, the log storage path can be a log path of data generated in the timing task management platform and stored in a database, and the log storage time can be the storage time of the data generated in the timing task management platform and stored in the database in a log. After the core data packet of the executor is added to the public data packet of the project, relevant information of the timing task management platform can be continuously configured in the public data packet, and after the configuration is finished, the configured public data packet can be obtained and marked as a target public data packet, so that the information of the executor and the information of the timing task management platform are configured in the target public data packet, and the executor and the timing task management platform can be used for task scheduling during the whole project operation.
In addition, the information of the executor and the information of the timing task management platform are configured in the public data packet of the project, so that other projects can multiplex the configured public data packet conveniently without repeated configuration, and the project operation efficiency can be improved.
S306, adding the target public data packet into a configuration file corresponding to the service to obtain the integrated service.
In this step, a configuration file may be generally set for each service, where the configuration file may include configuration information set for the service, and after the configured target public data packet is obtained, the target public data packet may be added to the configuration file of the service, so that relevant information of the corresponding executor and the timing task management platform is integrated in the service, and then a scheduling request sent by the timing task management platform in the service execution project may be directly passed through.
It should be noted that, after integrating the executor into the service, the port information monitored by the executor integrated with each service may be different, so that different services may be distinguished.
In this embodiment, the core data packet of the executor is added to the public data packet of the project, and then the configured public data packet is added to the configuration file of the service, so as to integrate the project, the executor and the service, so that other projects can multiplex the data packets of the integrated executor and the service without repeated configuration, and the project operation efficiency can be improved. In addition, related information of the timing task management platform can be configured when the project public data packet is configured, so that a scheduling request sent by the timing task management platform in a service execution project can be conveniently and directly used for the follow-up, the project operation complexity is simplified, and the project operation efficiency is further improved.
In the above embodiment, it is mentioned that the timing task scheduling system may determine the corresponding target service according to the scheduling configuration input by the user, and in the case that the scheduling configuration input by the user includes information such as the name and port information of the service, the identification of the target timing task, and the like, how to determine the target service specifically, the following embodiment describes the procedure.
Fig. 4 is a third flow chart of the method for scheduling a timed task according to the present invention, and referring to fig. 4, the step of including S204 in the scheduling configuration may include the following steps:
And S402, determining a target IP address corresponding to the identification in a database according to the identification of the target timing task, wherein the database stores the corresponding relation between the identification of the timing task and the IP address of the executor.
In this step, the correspondence between the identification of the timing task and the IP address of the actuator, which refers to the IP address of the accessing actuator, may be stored in the database in advance. Since the executor is integrated with the service, the corresponding service can be obtained through the IP address of the executor.
After the identification of the target timing task is obtained through the scheduling configuration, the corresponding IP address of the executor can be found in the database through the corresponding relation and recorded as the target IP address.
Of course, other information, such as annotation content corresponding to the timing task, where the annotation content of the timing task is mainly used to distinguish different timing tasks or services, and the annotation content may be different suffixes, for example, suffixes of.1, 2, etc., or suffixes of.com, cn, etc.
S404, determining the target service according to the target IP address, the name of the service and the port information.
In this step, after the access IP address of the executor corresponding to the target timing task is obtained, as an alternative embodiment, the target annotation content corresponding to the identifier may also be determined in the database according to the identifier of the target timing task, that is, the annotation content corresponding to the target timing task may also be found in the database, and recorded as the target annotation content, and then the name and the port information of the service configured by the user are combined, and the target service is determined according to the target annotation content, the target IP address, the name and the port information of the service. The method includes that the target IP address, the target annotation content, the name of the service, the port information and the like are spliced according to a certain sequence to obtain a unique spliced address, and the corresponding service or the actuator can be accessed through the spliced address, so that the target service can be determined.
The port information may be information such as a port number and a port name of a service.
When the timing function of a certain service is needed to be used later, the configuration of the service name and the port is carried out in the introduced service, and the use process is that the certain function needs to be executed at fixed time, timing annotation is added, a timing method is added, and the function needing to be executed at fixed time is put into the method.
In this embodiment, the target IP address of the actuator is determined in the database by the identifier of the target timing task, and the target service is determined by combining the port information, the name and other information of the service, so that the target service can be accurately and rapidly found and executed, and the execution efficiency of the timing task is improved. Further, annotation content corresponding to the target timing task can be combined when the target service is determined, so that different services can be better distinguished, and the accuracy of the found target service is improved.
As mentioned above, the information about the executor may also be displayed in the timed task management platform, and the following embodiments describe a process of displaying the information about the state of the executor in the timed task management platform.
In an exemplary embodiment, the above method further comprises the steps of:
The method comprises the steps of obtaining heartbeat information between an actuator corresponding to a target service and a timing task management platform, determining the state of the actuator corresponding to the target service according to the heartbeat information, and displaying the state in the timing task management platform, wherein the state comprises the online state or the offline state of the actuator.
In this step, the timing task scheduling system may periodically or periodically monitor heartbeat information between the executor corresponding to the target service and the timing task management platform, and determine a current state of the executor according to the monitored heartbeat information. If the monitored heartbeat information is abnormal, determining that the problem of disconnection or the like possibly exists between the executor corresponding to the target service and the timing task management platform, determining that the state of the executor is off-line at the moment, and if the monitored heartbeat information is normal, determining that normal communication is performed between the executor corresponding to the target service and the timing task management platform, and determining that the state of the executor is on-line at the moment.
The state of the executor can be displayed on the timing task management platform in real time, so that a user can check and process the state in time, for example, when the executor is offline, whether a communication link between the executor and the timing task management platform fails or not is checked and repair is carried out.
In this embodiment, the state of the actuator is obtained by monitoring the heartbeat information between the actuator corresponding to the target service and the timing task management platform, so that a user can conveniently and timely adjust the problem between the actuator and the timing task management platform.
The timing task scheduling system of the invention is described next, referring to the system structure block diagram shown in fig. 5 and the detailed structure diagram shown in fig. 6, the timing task scheduling system comprises a timing task management platform and an executor;
The timing task management platform is used for acquiring the scheduling configuration input by a user, determining corresponding target service according to the scheduling configuration, and sending a scheduling request to an executor corresponding to the target service, wherein the scheduling request comprises the identification of the target timing task;
And the executor is used for executing the target timing task through the target service, wherein the executor corresponding to the target service is integrated into the target service in advance, and the executor corresponding to the target service is started correspondingly when the target service is started.
In this embodiment, the timed task management platform is a xxl-job-based timed task management platform, and is responsible for managing scheduling information, sending a scheduling request (specifically, sending a task to a service execution monitored by an executor in a timed manner) according to scheduling configuration, and not bearing a service code. In this way, the scheduling system can be decoupled from the timed task, thereby improving the availability and stability of the scheduling system, and the performance of the scheduling system is not limited by the task module any more.
In addition, the timing task management platform supports visual, simple and dynamic management scheduling information, including task creation, updating, deleting, GLUE development (namely java extension package), task alarming and the like, all of which can be effective in real time, and simultaneously supports monitoring scheduling results and execution logs and supports executor Failover.
The executor can automatically register the monitoring ports of a plurality of services managed by the executor (for example, service 1-service n, where n is an integer greater than or equal to 1) to the timed task management platform, and is responsible for receiving the scheduling request of the timed task management platform and executing task logic, and specifically, the monitoring ports in the service. The task module is focused on operations such as task execution, and development and maintenance are simpler and more efficient. In addition, the executor may also receive execution requests, termination requests, log requests, etc. of the "dispatch center".
For other explanation of the timing task management platform and the executor, reference may be made to the explanation of the timing task scheduling method embodiment, which is not described herein.
In this embodiment, the timing task scheduling system includes a timing task management platform and an executor, where the timing task management platform obtains a scheduling configuration input by a user, and after determining a corresponding target service according to the scheduling configuration, sends a scheduling request to the executor corresponding to the target service, where the scheduling request includes an identifier of the target timing task and is used to instruct the executor corresponding to the target service to execute the target timing task through the target service, and the executor corresponding to the target service is pre-integrated into the target service and starts the executor corresponding to the target service when the target service starts. In the method, the executor and the service can be integrated, so that the executor does not need to be independently started to serve when the executor executes the timing task, and the expenditure when the executor executes the timing task can be reduced.
In an exemplary embodiment, the timed task management platform includes a control for operating the timed task, where the operation includes at least one of adding, deleting, modifying, and searching.
In this embodiment, controls for operating the timed task may be provided on a visual interface (or referred to as a user page) of the timed task management platform, and the controls may be buttons, for example. The user can perform operations such as adding, deleting, modifying and searching on the timing task through different controls, for example, the adding operation can be that the user writes the timing task on the visual interface.
In addition, controls for operating the timed tasks in batches can be provided on the visual interface of the timed task management platform, so that the operating efficiency can be improved.
Meanwhile, all configuration information of the timing tasks can be displayed on the timing task management platform, and a user can modify and pause the configured timing tasks at any time.
In this embodiment, the timed task management platform includes a control for operating the timed task, so that a user can conveniently operate the timed task.
In one exemplary embodiment, the timed task management platform is coupled to a database for storing data generated in the timed task management platform.
In this embodiment, the database may be integrated with or connected to the timed task management platform in advance, and then when the user configures or operates the timed task on the timed task management platform, the generated configuration and data may be stored in the database (i.e., the database may store the corresponding configuration and data of the timed task), so as to facilitate subsequent searching and use.
In an exemplary embodiment, the execution amount of the timing tasks in each date and time period can be shown in detail in the timing task management platform, and the frequency of each timing task can be properly adjusted according to the execution amount, so that the problem that the operation efficiency of the equipment is affected due to too dense timing tasks can be avoided.
In one exemplary embodiment, the timed task management platform supports the viewing of the status of the executors and the monitoring of the execution tasks, i.e., provides real-time monitoring and analysis of the task execution data, which may facilitate the monitoring and management of timed tasks and executors.
In an exemplary embodiment, the multiple timing tasks in the timing task management platform can adopt a multi-line Cheng Xiancheng pool technology to realize the isolated scheduling of the fast task and the slow task, so that the performance and the stability of the system are improved. Meanwhile, the task scheduling process can be completely asynchronous, so that the method is beneficial to coping with dense traffic.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.

Claims (10)

1. A timed task scheduling method, characterized by being applied to a timed task scheduling system, the timed task scheduling system comprising a timed task management platform and an executor, the method comprising:
acquiring scheduling configuration input by a user through a timing task management platform;
Determining a corresponding target service according to the scheduling configuration, and sending a scheduling request to an executor corresponding to the target service, wherein the scheduling request comprises an identifier of a target timing task and is used for indicating the executor corresponding to the target service to execute the target timing task through the target service;
The executors corresponding to the target service are integrated into the target service in advance, and the executors corresponding to the target service are started correspondingly when the target service is started.
2. The timed task scheduling method according to claim 1, characterized in that it further comprises:
integrating the executor and the service managed by the executor to obtain an integrated service, wherein the integrated service comprises sub-services corresponding to the executor.
3. The method for scheduling timed tasks according to claim 2, characterized in that said integrating the services managed by the actuator and the actuator, obtaining the integrated services, comprises:
Acquiring a core data packet corresponding to the actuator and a preset project public data packet;
Adding the core data packet into the project public data packet to obtain a configured target public data packet;
and adding the target public data packet into a configuration file corresponding to the service to obtain the integrated service.
4. A method for scheduling a timed task according to claim 3, wherein said adding the core packet to the project common packet to obtain a configured target common packet comprises:
Acquiring related information of the timing task management platform, wherein the related information comprises at least one of a platform address, a log storage path and log storage time of the timing task management platform;
And adding the core data packet into the project public data packet, and configuring the related information in the project public data packet to obtain the target public data packet.
5. The method for scheduling timed tasks according to any one of claims 1-4, characterized in that the scheduling configuration comprises service name and port information, identification of the target timed task;
the determining the corresponding target service according to the scheduling configuration comprises the following steps:
determining a target Internet Protocol (IP) address corresponding to the identification in a database according to the identification of the target timing task, wherein the database stores the corresponding relation between the identification of the timing task and the IP address of an actuator;
and determining the target service according to the target IP address, the name of the service and the port information.
6. The timed task scheduling method according to claim 5, wherein the determining the target service according to the target IP address, the service name and port information comprises:
determining target annotation content corresponding to the identification in the database according to the identification of the target timing task;
and determining the target service according to the target annotation content, the target IP address, the name of the service and the port information.
7. A timed task scheduling method according to any one of claims 1-4 characterized in that the method further comprises:
acquiring heartbeat information between an executor corresponding to the target service and the timing task management platform;
And determining the state of the actuator corresponding to the target service according to the heartbeat information, and displaying the state in the timing task management platform, wherein the state comprises the online state or the offline state of the actuator.
8. The timing task scheduling system is characterized by comprising a timing task management platform and an executor;
The timing task management platform is used for acquiring scheduling configuration input by a user, determining corresponding target service according to the scheduling configuration, and sending a scheduling request to an executor corresponding to the target service, wherein the scheduling request comprises an identification of a target timing task;
the executor is used for executing the target timing task through the target service, wherein the executor corresponding to the target service is integrated into the target service in advance, and the executor corresponding to the target service is started correspondingly when the target service is started.
9. A timed task scheduling system according to claim 8 in which the timed task management platform includes controls for operating on timed tasks, the operations including at least one of adding, deleting, modifying and looking up.
10. A timed task scheduling system according to claim 8 in which the timed task management platform is connected to a database for storing data generated in the timed task management platform.
CN202410862467.0A 2024-06-28 2024-06-28 Scheduled task scheduling method and system Pending CN119065803A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410862467.0A CN119065803A (en) 2024-06-28 2024-06-28 Scheduled task scheduling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410862467.0A CN119065803A (en) 2024-06-28 2024-06-28 Scheduled task scheduling method and system

Publications (1)

Publication Number Publication Date
CN119065803A true CN119065803A (en) 2024-12-03

Family

ID=93645704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410862467.0A Pending CN119065803A (en) 2024-06-28 2024-06-28 Scheduled task scheduling method and system

Country Status (1)

Country Link
CN (1) CN119065803A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119781872A (en) * 2025-03-11 2025-04-08 北京轻松怡康信息技术有限公司 Method and device for automatically configuring tasks based on task scheduling platform

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119781872A (en) * 2025-03-11 2025-04-08 北京轻松怡康信息技术有限公司 Method and device for automatically configuring tasks based on task scheduling platform

Similar Documents

Publication Publication Date Title
CN102640108B (en) The monitoring of replicated data
CN102656565B (en) Failover and recovery for replicated data instances
US8082344B2 (en) Transaction manager virtualization
CN106126346A (en) A kind of large-scale distributed data collecting system and method
JP2005512190A (en) Real composite objects that provide high availability of resources in networked systems
CN110138876B (en) Task deployment method, device, equipment and platform
CN106549829A (en) Big data calculating platform monitoring system and method
CN113742033A (en) Kubernetes cluster federal system and implementation method thereof
US9973569B2 (en) System, method and computing apparatus to manage process in cloud infrastructure
CN115115329A (en) Manufacturing middleware and cloud manufacturing framework for intelligent production line
CN100426751C (en) Method for ensuring accordant configuration information in cluster system
CN117354260A (en) An electromagnetic transient cross-domain distributed parallel computing scheduling method and device
WO2025124386A1 (en) Method and apparatus for executing timed task in multi-site active-active system
CN119065803A (en) Scheduled task scheduling method and system
CN106293911A (en) Dispatching System, method
CN113824801B (en) A unified access management component system for intelligent fusion terminals
US20040039816A1 (en) Monitoring method of the remotely accessible resources to provide the persistent and consistent resource states
CN116723077A (en) A distributed IT automated operation and maintenance system
CN112631727A (en) Method and device for monitoring pod
CN101207518B (en) An Asynchronous Maintenance System Oriented to Distributed Resource Nodes
CN118467217A (en) Information recording method, apparatus, electronic device, and computer-readable storage medium
CN112632033B (en) Cluster data migration method, device and electronic equipment
CN118192442A (en) Method, device, equipment and storage medium for monitoring semiconductor production machine
CN110266795A (en) One kind being based on Openstack platform courses method
CN116346834A (en) Session synchronization method, device, computing equipment and computer 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