Automatic creation method and device of timed task, equipment and medium
By automatically scanning the service association information of the business service and generating the executor registration data, and generating timing task creation data with customized annotation data, the problem of cumbersome configuration of XXL-JOB timing task is solved, and the automatic creation and maintenance of timing tasks is realized.
Patent Information
- Application Number
- CN202411494060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-28
AI Technical Summary
The current XXL-JOB timing task configuration has problems such as high labor costs, cumbersome configuration processes, and difficult deployment and maintenance.
By scanning the service association information of the current business service, the executor registration association data is generated, and after the executor automatic registration is completed, the custom annotation data is obtained and scanned, and the timing task creation data is generated to automatically create the target timing task.
The automatic creation of XXL-JOB timing tasks is realized, reducing labor costs and deployment and maintenance difficulties, and simplifying the configuration process.
Smart Images

Figure CN119536934A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer data processing, and in particular to a method, device, equipment and medium for automatically creating a scheduled task. Background Art
[0002] Distributed scheduled tasks play a vital role in modern distributed systems. They ensure efficient execution of tasks on multiple nodes, achieve high availability and load balancing, and ensure accurate scheduling of tasks.
[0003] However, in actual applications, current open source solutions are often manually configured and created by developers based on XXL-JOB (a lightweight distributed task scheduling platform). Due to the large number of configuration parameters and the lack of unified standards for developers to configure, the current XXL-JOB scheduled task configuration has high labor costs and cumbersome configuration processes, which increases the complexity of initial deployment and also brings considerable challenges to subsequent maintenance. Summary of the invention
[0004] The present invention provides a method, device, equipment and medium for automatically creating a scheduled task, so as to solve the problems of high labor cost, complicated configuration process and difficult deployment and maintenance in the current XXL-JOB scheduled task configuration.
[0005] According to one aspect of the present invention, there is provided a method for automatically creating a scheduled task, comprising: self-scanning service association information of a current business service, and generating executor registration association data according to the service association information;
[0006] After confirming that XXL-JOB completes the automatic registration of the executor based on the executor registration associated data, obtain and scan the custom annotation data, generate the scheduled task creation data, and generate the target scheduled task based on the scheduled task creation data through XXL-JOB.
[0007] According to another aspect of the present invention, there is provided an automatic creation device for a scheduled task, comprising:
[0008] A first data generation module, used for self-scanning service association information of the current business service, and generating actuator registration association data according to the service association information;
[0009] The second data generation module is used to obtain and scan custom annotation data and generate scheduled task creation data after determining that XXL-JOB completes automatic registration of the executor based on the executor registration associated data, so as to generate a target scheduled task based on the scheduled task creation data through XXL-JOB.
[0010] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0011] at least one processor; and
[0012] a memory communicatively connected to the at least one processor; wherein,
[0013] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for automatically creating a scheduled task described in any embodiment of the present invention.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for automatically creating a scheduled task as described in any embodiment of the present invention when executed.
[0015] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for automatically creating a scheduled task according to any embodiment of the present invention is implemented.
[0016] The technical solution of the embodiment of the present invention, by self-scanning the service association information of the current business service, and generating the executor registration association data according to the service association information, so as to obtain and scan the custom annotation data and generate the scheduled task creation data after determining that XXL-JOB completes the automatic registration of the executor based on the executor registration association data, so as to generate the target scheduled task based on the scheduled task creation data through XXL-JOB. In this solution, the executor can be automatically registered in XXL-JOB without calling the management interface of XXL-JOB, and the user-defined scheduled tasks corresponding to the custom annotation data can also be automatically created to XXL-JOB, and the automatic execution of the custom scheduled tasks is supported, which solves the problems of high labor cost, cumbersome configuration process and difficult deployment and maintenance in the current XXL-JOB scheduled task configuration, and can realize the automatic creation of XXL-JOB scheduled tasks, greatly reducing labor costs and deployment and maintenance difficulties.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flowchart of a method for automatically creating a scheduled task provided in Example 1 of the present invention;
[0020] Figure 2 A flowchart of a method for automatically creating a scheduled task provided in Embodiment 2 of the present invention;
[0021] Figure 3 A schematic diagram of the structure of an automatic creation device for a scheduled task provided in Embodiment 3 of the present invention;
[0022] Figure 4 A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] Embodiment 1
[0026] Figure 1This is a flowchart of a method for automatically creating a scheduled task provided by the first embodiment of the present invention. This embodiment is applicable to the case of quick access to XXL-JOB timing. The method can be executed by an automatic creation device for a scheduled task. The automatic creation device for a scheduled task can be implemented in the form of hardware and / or software. The automatic creation device for a scheduled task can be configured in an electronic device. The electronic device can include but is not limited to a server or a computer. Figure 1 As shown, the method includes:
[0027] Step 110: self-scan the service association information of the current business service, and generate executor registration association data according to the service association information.
[0028] The current business service may be a business service that currently needs to add a scheduled task. For example, business services may include but are not limited to taxi services, award redemption services, and login authority management services. Optionally, assuming that the current business service is a login authority management service, adding a scheduled task to the current business service can realize the determination of whether the user authority has expired.
[0029] The service association information may be information related to the current business service. For example, the service association information may include but is not limited to the service name of the business service and the IP (Internet Protocol) of the business service. The service name may be the service name of the current business service. The executor registration association data may be the corresponding scheduled task of the current business service, and the data required for executor registration on XXL-JOB.
[0030] In an embodiment of the present invention, the current business service can be self-scanned to obtain service association information of the current business service, and then based on the parameters required for XXL-JOB executor registration, data of the service association information of the current business service can be extracted to obtain executor registration association data.
[0031] Step 120, after determining that XXL-JOB completes automatic registration of the executor based on the executor registration associated data, obtain and scan the custom annotation data, generate scheduled task creation data, and generate the target scheduled task based on the scheduled task creation data through XXL-JOB.
[0032] The custom annotation data can be the annotation data corresponding to the custom scheduled task, that is, the annotation data of the scheduled task required to be configured for the current business service. The scheduled task creation data can be used to create the scheduled task required to be configured for the current business service to XXL-JOB. The target scheduled task can be the task created by XXL-JOB based on the scheduled task creation data.
[0033] In an embodiment of the present invention, XXL-JOB can automatically register the executor based on the executor registration associated data, that is, register the executor corresponding to the current business service in XXL-JOB, avoiding the situation where the business service that exists in manual configuration corresponds to multiple executors. When it is detected that XXL-JOB has completed the automatic registration of the executor based on the executor registration associated data, it can further obtain and scan the custom annotation data, and parse the custom annotation data based on the parameters required for XXL-JOB to create a scheduled task, and obtain the scheduled task creation data, thereby transmitting the scheduled task creation data to XXL-JOB. After XXL-JOB obtains the scheduled task creation data, it can automatically create a scheduled task based on the scheduled task creation data.
[0034] The technical solution of the embodiment of the present invention, by self-scanning the service association information of the current business service, and generating the executor registration association data according to the service association information, thereby obtaining and scanning the custom annotation data, generating the scheduled task creation data after determining that XXL-JOB completes the automatic registration of the executor based on the executor registration association data, so as to generate the target scheduled task based on the scheduled task creation data through XXL-JOB. In this solution, the executor can be automatically registered in XXL-JOB without calling the management interface of XXL-JOB, supporting cross-platform operations, and automatically creating user-defined scheduled tasks corresponding to the custom annotation data to XXL-JOB, and supporting the automatic execution of custom scheduled tasks, solving the problems of high labor cost, cumbersome configuration process, and difficult deployment and maintenance in the current XXL-JOB scheduled task configuration, and realizing the automatic creation of XXL-JOB scheduled tasks, greatly reducing labor costs and deployment and maintenance difficulties.
[0035] Embodiment 2
[0036] Figure 2 The flowchart of a method for automatically creating a scheduled task provided in the second embodiment of the present invention is specific based on the above embodiment, wherein XXL-JOB uses a microservice architecture to encapsulate XXL-JOB related interfaces, which may specifically include at least one of an executor registration interface, a task creation interface, and a scheduled task change interface, and provides a specific optional implementation method for sending executor registration association data to XXL-JOB after self-scanning the service association information of the current business service and generating executor registration association data based on the service association information. Figure 2 As shown, the method includes:
[0037] Step 210: self-scan the service association information of the current business service, and generate executor registration association data according to the service association information.
[0038] The microservice architecture of the embodiment of the present invention encapsulates at least one of the following interfaces: executor registration interface, task creation interface, and scheduled task change interface. The above three interfaces are interfaces provided by XXL-JOB to other services for corresponding function calls.
[0039] Step 220: Call the real-time task scheduling service and send the executor registration associated data to XXL-JOB through the executor registration interface.
[0040] The real-time task scheduling service may be a service for real-time scheduling of scheduled tasks. The executor registration interface may be an interface for XXL-JOB to receive executor registration associated data.
[0041] In an embodiment of the present invention, the real-time task scheduling service complies with the interface protocol of the executor registration interface. The current business service can call the real-time task scheduling service and send the executor registration associated data to the real-time task scheduling service. The real-time task scheduling service further sends the executor registration associated data to XXL-JOB through the executor registration interface.
[0042] Step 230, after determining that XXL-JOB completes automatic registration of the executor based on the executor registration associated data, obtain and scan the custom annotation data, generate scheduled task creation data, and generate the target scheduled task based on the scheduled task creation data through XXL-JOB.
[0043] In an optional embodiment of the present invention, after generating the scheduled task creation data, the method may further include: calling a real-time task scheduling service, and sending the scheduled task creation data to XXL-JOB through a task creation interface.
[0044] The task creation interface may be an interface for XXL-JOB to receive scheduled task creation data.
[0045] In an embodiment of the present invention, the real-time task scheduling service complies with the interface protocol of the task creation interface. The current business service can call the real-time task scheduling service and send the scheduled task creation data to the real-time task scheduling service. The real-time task scheduling service further sends the scheduled task creation data to XXL-JOB through the task creation interface.
[0046] In an optional embodiment of the present invention, after generating a target scheduled task based on the scheduled task creation data through XXL-JOB, it may also include: calling a real-time task scheduling service, and sending the target scheduled task update data to XXL-JOB through the scheduled task change interface, so that XXL-JOB updates the target scheduled task based on the target scheduled task update data, and / or changes the status of the target scheduled task.
[0047] The target scheduled task update data may be the change data of the custom scheduled task corresponding to the current business service. The scheduled task change interface may be an interface for XXL-JOB to receive the target scheduled task update data.
[0048] In the embodiment of the present invention, the real-time task scheduling service complies with the interface protocol of the scheduled task change interface. The current business service can call the real-time task scheduling service and send the target scheduled task update data to the real-time task scheduling service. The real-time task scheduling service further sends the target scheduled task update data to XXL-JOB through the task change interface. XXL-JOB can update information and / or change the state of the target scheduled task according to the target scheduled task update data.
[0049] The information change of the target scheduled task can be understood as the change of the scheduled task logic, such as the modification and / or deletion of the task logic, etc. The state change of the target scheduled task can be understood as the change of the activation or deactivation state of the scheduled task.
[0050] In an optional embodiment of the present invention, the target scheduled task update data may include at least one of scheduled task modification data, scheduled task deletion data, and scheduled task start and stop data.
[0051] Among them, the scheduled task modification data can be the data used by the user to modify the scheduled task logic. The scheduled task deletion data can be used to indicate the deletion of the corresponding scheduled task in XXL-JOB. The scheduled task start and stop data can be used to control the start or stop of the scheduled task.
[0052] In the embodiment of the present invention, the user can update the target scheduled task data to modify, delete, enable and disable the custom scheduled task matching the custom annotation data.
[0053] In an optional embodiment of the present invention, XXL-JOB can be used to create data according to the target annotation method and the scheduled task, and start the target scheduled task.
[0054] The target annotation method may be a method for annotating a JobHandler in a newly added executor based on the executor registration associated data.
[0055] In an embodiment of the present invention, XXL-JOB can determine the method annotated under JobHandler in the executor registered based on the executor registration associated data, that is, obtain the target annotated method, and then check whether the target annotated method is consistent with the @Xxljob annotation in the scheduled task creation data. If the two are consistent, the target scheduled task is started.
[0056] Optionally, the automatic creation method of scheduled tasks can be implemented as a computer program and published as a client dependency package.
[0057] In a specific example, the current business service can introduce the client dependency package provided by the real-time task scheduling service. The current business service scans the service name and IP and other information of the current business service based on the client dependency package, and sends the scanned service name and IP and other information as the executor registration associated data to the real-time task scheduling service. The executor registration interface is called by the real-time task scheduling service, and the executor registration associated data is sent to XXL-JOB through the executor registration interface. XXL-JOB registers the executor corresponding to the current business service based on the executor registration associated data. Further, the current business service scans the custom annotation data and the method (target annotation method) annotated by XXL-JOB based on the client dependency package, generates the scheduled task creation data, and then sends the scheduled task creation data to the real-time task scheduling service. Through the real-time task scheduling service call, the scheduled task creation data is sent to XXL-JOB through the task creation interface. XXL-JOB creates and starts the scheduled task under the corresponding executor based on the scheduled task creation data. The current business service can also provide a scheduled task change page, which supports users to modify, delete, start and deactivate custom scheduled tasks, so as to manage custom scheduled tasks and finally change the task information or status of the scheduled tasks created on XXL-JOB. The current business service can also change the relevant parameters of the scheduled tasks based on the client dependency package.
[0058] The technical solution of the embodiment of the present invention is to call the real-time task scheduling service by self-scanning the service association information of the current business service and generating the executor registration association data according to the service association information, and then send the executor registration association data to XXL-JOB through the executor registration interface, and then obtain and scan the custom annotation data after determining that XXL-JOB completes the automatic registration of the executor based on the executor registration association data, and generate the scheduled task creation data, so as to generate the target scheduled task based on the scheduled task creation data through XXL-JOB. In this solution, the executor can be automatically registered in XXL-JOB without calling the management interface of XXL-JOB, and the user-defined scheduled tasks corresponding to the custom annotation data can also be automatically created to XXL-JOB, and the automatic execution of the customized scheduled tasks is supported, which solves the problems of high labor cost, cumbersome configuration process and difficult deployment and maintenance in the current XXL-JOB scheduled task configuration, and can realize the automatic creation of XXL-JOB scheduled tasks, greatly reducing labor costs and deployment and maintenance difficulties.
[0059] Embodiment 3
[0060] Figure 3 This is a schematic diagram of the structure of an automatic creation device for a scheduled task provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:
[0061] The first data generating module 310 is used to self-scan the service association information of the current business service and generate the executor registration association data according to the service association information.
[0062] The second data generation module 320 is used to obtain and scan custom annotation data and generate scheduled task creation data after determining that XXL-JOB completes automatic executor registration based on the executor registration associated data, so as to generate a target scheduled task based on the scheduled task creation data through XXL-JOB.
[0063] The technical solution of the embodiment of the present invention, by self-scanning the service association information of the current business service, and generating the executor registration association data according to the service association information, so as to obtain and scan the custom annotation data and generate the scheduled task creation data after determining that XXL-JOB completes the automatic registration of the executor based on the executor registration association data, so as to generate the target scheduled task based on the scheduled task creation data through XXL-JOB. In this solution, the executor can be automatically registered in XXL-JOB without calling the management interface of XXL-JOB, and the user-defined scheduled tasks corresponding to the custom annotation data can also be automatically created to XXL-JOB, and the automatic execution of the custom scheduled tasks is supported, which solves the problems of high labor cost, cumbersome configuration process and difficult deployment and maintenance in the current XXL-JOB scheduled task configuration, and can realize the automatic creation of XXL-JOB scheduled tasks, greatly reducing labor costs and deployment and maintenance difficulties.
[0064] Optionally, the microservice architecture is used to encapsulate the executor registration interface on XXL-JOB. The automatic creation device of the scheduled task also includes a first transmission module, which is used to call the real-time task scheduling service and send the executor registration associated data to the XXL-JOB through the executor registration interface.
[0065] Optionally, a task creation interface is encapsulated on XXL-JOB using a microservice architecture. The automatic creation device for a scheduled task also includes a second transmission module for calling a real-time task scheduling service and sending the scheduled task creation data to the XXL-JOB through the task creation interface.
[0066] Optionally, a scheduled task change interface is encapsulated using a microservice architecture on XXL-JOB. The automatic creation device of the scheduled task also includes a third transmission module, which is used to call the real-time task scheduling service, and send the target scheduled task update data to the XXL-JOB through the scheduled task change interface, so that the XXL-JOB performs information and / or status changes on the target scheduled task based on the target scheduled task update data.
[0067] Optionally, the target scheduled task update data includes at least one of scheduled task modification data, scheduled task deletion data, and scheduled task start and stop data.
[0068] Optionally, the XXL-JOB is used to start the target scheduled task according to the target annotation method and the scheduled task creation data.
[0069] The automatic creation device for scheduled tasks provided by the embodiment of the present invention can execute the automatic creation method for scheduled tasks provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0070] Embodiment 4
[0071] Figure 4 A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0072] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0073] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0074] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the automatic creation method of the scheduled task.
[0075] In some embodiments, the automatic creation method of the scheduled task can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the automatic creation method of the scheduled task described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the automatic creation method of the scheduled task by any other appropriate means (for example, by means of firmware).
[0076] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0077] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0078] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0079] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0080] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0081] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0082] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0083] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for automatically creating a scheduled task, characterized in that: include: Self-scanning service association information of the current business service, and generating actuator registration association data according to the service association information; After determining that XXL-JOB completes automatic executor registration based on the executor registration associated data, obtain and scan custom annotation data to generate scheduled task creation data, so as to generate a target scheduled task based on the scheduled task creation data through XXL-JOB.
2. The method according to claim 1, characterized in that The XXL-JOB uses a microservice architecture to encapsulate an actuator registration interface; After the self-scanning of the service association information of the current business service and generating the actuator registration association data according to the service association information, the method further includes: The real-time task scheduling service is called, and the executor registration associated data is sent to the XXL-JOB through the executor registration interface.
3. The method according to claim 1, characterized in that The XXL-JOB uses a microservice architecture to encapsulate a task creation interface; After generating the scheduled task creation data, the method further includes: The real-time task scheduling service is called, and the scheduled task creation data is sent to the XXL-JOB through the task creation interface.
4. The method according to claim 1, characterized in that The XXL-JOB uses a microservice architecture to encapsulate a scheduled task change interface; After the target scheduled task is generated based on the scheduled task creation data by the XXL-JOB, the method further includes: Call the real-time task scheduling service, and send the target scheduled task update data to the XXL-JOB through the scheduled task change interface, so that the XXL-JOB can update the target scheduled task and / or change the status based on the target scheduled task update data.
5. The method according to claim 4, characterized in that: The target scheduled task update data includes at least one of scheduled task modification data, scheduled task deletion data, and scheduled task start and stop data.
6. The method according to claim 1, characterized in that The XXL-JOB is used to start the target scheduled task according to the target annotation method and the scheduled task creation data.
7. An automatic creation device for a scheduled task, characterized in that: include: A first data generation module, used for self-scanning service association information of a current business service, and generating actuator registration association data according to the service association information; The second data generation module is used to obtain and scan custom annotation data and generate scheduled task creation data after determining that XXL-JOB completes automatic registration of the executor based on the executor registration associated data, so as to generate a target scheduled task based on the scheduled task creation data through XXL-JOB.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for automatically creating a scheduled task according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for automatically creating a scheduled task according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method for automatically creating a scheduled task according to any one of claims 1 to 6.
Citation Information
Cited By
Method and device for automatically configuring tasks based on task scheduling platform
CN119781872A