CN117687750A - Timing task scheduling method and device, storage medium and electronic device - Google Patents

Timing task scheduling method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117687750A
CN117687750A CN202311566309.2A CN202311566309A CN117687750A CN 117687750 A CN117687750 A CN 117687750A CN 202311566309 A CN202311566309 A CN 202311566309A CN 117687750 A CN117687750 A CN 117687750A
Authority
CN
China
Prior art keywords
task
timing
timed
scheduling
timing task
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
CN202311566309.2A
Other languages
Chinese (zh)
Inventor
董一博
尹飞
邓邱伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202311566309.2A priority Critical patent/CN117687750A/en
Publication of CN117687750A publication Critical patent/CN117687750A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a timing task scheduling method and device, a storage medium and an electronic device, and relates to the technical field of intelligent home, wherein the method comprises the following steps: accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance; wherein, each timing task instance stores a plurality of timing tasks; under the condition that the timing task meets a time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit; and sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task. When the task peaks are faced, each scheduling unit schedules the corresponding timing task instance, and the scheduling units do not interfere with each other, so that higher scheduling capability of the timing task can be realized, and the stability of the timing task scheduling engine can be ensured.

Description

Timing task scheduling method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of intelligent home, in particular to a timing task scheduling method and device, a storage medium and an electronic device.
Background
The AI+IOT platform is connected with a large number of intelligent devices, and a large number of users control the intelligent devices to realize an intelligent scene every day, such as automatically opening an air conditioner at 7 am every day, starting a sweeping machine at a fixed time at noon every day, automatically drawing a window curtain at 9 am every day, and the like; in addition, thousands of scheduled tasks are run daily within the platform of the system to meet other functional sets on the business.
In the prior art, when the timing tasks are operated, the timing tasks are independently operated through different hosts in the system, and as the amount of the timing tasks is increased, the resources required for operating the timing tasks are correspondingly increased, the performance bottleneck is caused by a certain amount of tasks, the amount of tasks are piled up, the scheduling capability of the system is limited, and the system is unstable.
Disclosure of Invention
The application provides a timing task scheduling method and device, a storage medium and an electronic device, which are used for solving the defect of unstable system caused by large task amount in the prior art.
The application provides a timing task scheduling method, which is used for a timing task scheduling engine, wherein the timing task scheduling engine comprises the following steps: the system comprises a timing task management module, a distributed scheduling cluster and a timing task storage module, wherein the distributed scheduling cluster is respectively connected with the timing task management module and the timing task storage module;
The distributed scheduling cluster comprises a plurality of scheduling units, and the timed task storage module stores a plurality of timed task instances; the timing task instance and the scheduling unit have a preset corresponding relation;
the method comprises the following steps:
accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance; wherein, each timing task instance stores a plurality of timing tasks;
under the condition that the timing task meets a time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit;
and sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
According to the timing task scheduling method provided by the application, the timing task management module is connected with the service system through a stream data cluster;
the timing task triggering instruction is sent to a corresponding service system through the timing task management module, and the method comprises the following steps:
and sending a plurality of timed task trigger instructions to the stream data cluster in a queue form through the timed task management module, and sending the timed task trigger instructions in the queue to a corresponding service system through the stream data cluster.
According to the timing task scheduling method provided by the application, the timing task scheduling engine further comprises: the timing callback module is respectively connected with the stream data clusters;
after sending the timing task trigger instruction in the queue to the corresponding service system through the stream data cluster, the method further includes:
and sending the timed task trigger instruction in the queue to the timed callback module through the stream data cluster so as to execute the timed task callback instruction corresponding to the timed task trigger instruction through the timed callback module.
According to the timing task scheduling method provided by the application, the timing task scheduling engine further comprises: the memory is respectively connected with the timing task management module and the timing callback module;
after sending, by the timed task management module, a plurality of the timed task trigger instructions into a stream data cluster in the form of a queue, the method further comprises:
generating a sent timing task record through the timing task management module, and storing the sent timing task record into the memory;
After executing the timed task callback instruction corresponding to the timed task trigger instruction by the timed callback module, the method further comprises:
storing a timed task callback result to a memory through the timed callback module; and storing the timed task callback result corresponding to the sent timed task record.
According to the timed task scheduling method provided by the application, after the timed task callback result is stored into the memory through the timed callback module, the method further comprises the following steps:
through a preset timing scanning tool, timing tasks which are not called back when the time is overtime are scanned in the memory at fixed time, and a notification is generated according to the timing tasks which are not called back when the time is overtime and sent to the timing callback module;
and if the timed task trigger instruction which is not called back after the timeout exists in the timed callback module, re-executing the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the timeout through the timed callback module, and storing the regenerated timed task callback result into the memory.
According to the timing task scheduling method provided by the application, after a timing task generation notification which is not called back according to timeout is sent to the timing callback module, the method further comprises the following steps:
If the timing callback module does not have the timing task trigger instruction which is not called back after the timeout, a task compensation notice is sent to the stream data cluster through the timing callback module;
sending a target timing task trigger instruction corresponding to the task compensation notification to a corresponding service system through the stream data cluster;
and sending the target timed task trigger instruction to the timed callback module through the stream data cluster so that the timed callback module re-executes the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the time-out, and storing the regenerated timed task callback result into the memory.
According to the timing task scheduling method provided by the application, the distributed scheduling cluster comprises a controller, wherein the controller is respectively connected with a plurality of scheduling units and is used for managing the plurality of scheduling units;
the method further comprises the steps of:
sending an operation task instruction to a controller through the timing task management module so as to respectively control the scheduling unit to operate corresponding timing tasks through the controller;
wherein the operational task instruction includes: adding timed task instructions, deleting timed task instructions and modifying timed task instructions.
The application also provides a timed task scheduling device, which is used for a timed task scheduling engine, wherein the timed task scheduling engine comprises: the system comprises a timing task management module, a distributed scheduling cluster and a timing task storage module, wherein the distributed scheduling cluster is respectively connected with the timing task management module and the timing task storage module;
the distributed scheduling cluster comprises a plurality of scheduling units, and the timed task storage module stores a plurality of timed task instances; the timing task instance and the scheduling unit have a preset corresponding relation;
the device comprises:
the acquisition unit is used for accessing the corresponding timing task storage modules through each scheduling unit to acquire timing task instances; wherein, each timing task instance stores a plurality of timing tasks;
the sending unit is used for sending a timing task trigger instruction corresponding to the timing task management module through the scheduling unit under the condition that the timing task is determined to meet a time trigger condition;
the triggering unit is used for sending the timing task triggering instruction to the corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task
The present application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to implement a timed task scheduling method as described in any one of the above by execution of the computer program.
The present application also provides a computer-readable storage medium comprising a stored program, wherein the program when run performs a method of scheduling timed tasks as described in any of the above.
The present application also provides a computer program product comprising a computer program which when executed by a processor implements a timed task scheduling method as described in any one of the above.
According to the timing task scheduling method and device, scheduling of the timing tasks is achieved through the distributed scheduling clusters, the distributed scheduling clusters and the timing task storage are decoupled and separated, distributed scheduling can be supported, when the distributed scheduling is faced with a peak of the tasks, each scheduling unit schedules the corresponding timing task instance, the timing task instances do not interfere with each other, and the timing task triggering instruction is sent to the corresponding service system to execute the timing tasks through the timing task management module, so that higher scheduling capability of the timing tasks can be achieved, and stability of the timing task scheduling engine can be guaranteed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic architecture diagram of a timed task scheduling engine according to the present application;
FIG. 2 is a schematic architecture diagram of a timed task scheduling engine according to the present application;
FIG. 3 is one of the flow diagrams of the timed task scheduling method provided herein;
FIG. 4 is a second flow chart of the method for scheduling timed tasks provided in the present application;
FIG. 5 is a schematic diagram of a system architecture for timed task scheduling provided herein;
FIG. 6 is a schematic diagram of a timing task scheduler provided herein;
fig. 7 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiment of the application, an interaction method of intelligent home equipment is provided. The interaction method of the intelligent household equipment is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home, intelligent household equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in this embodiment, the above-mentioned interaction method of the smart home device may be applied to a hardware environment formed by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In order to meet the requirements of stability, accuracy and high throughput of simultaneous triggering of a large number of timing tasks in the internet of things (Internet of Things, IOT) system in the prior art, the embodiment provides a set of timing task scheduling system to realize high-performance task scheduling of which the number of tasks is more than 100 ten thousand, the number of tasks triggered at the same time is more than 10 ten thousand, and the number of tasks triggered at the same time is 10 ten thousand, wherein the performance requirement is completed within three seconds. Meanwhile, the technical scheme provided by the embodiment can meet the performance requirement of simultaneously executing more tasks according to the expansion of the resource server.
Referring to fig. 2, fig. 2 shows a schematic diagram of the timing task scheduling engine of the present embodiment.
The timed task scheduling engine includes: the system comprises a timing task management module, a distributed scheduling cluster and a timing task storage module, wherein the distributed scheduling cluster is respectively connected with the timing task management module and the timing task storage module;
the distributed scheduling cluster comprises a plurality of scheduling units, and the timed task storage module stores a plurality of timed task instances. The multiple scheduling units and the multiple timed task instances support lateral expansion, and the distributed environment operates. A single scheduling unit supports more than 10 tens of thousands of timed tasks scheduled simultaneously.
The timing task examples and the scheduling unit have preset corresponding relations, and a plurality of timing tasks are stored in each timing task example. Each scheduling unit schedules the own managed instance, and the instances do not interfere with each other.
In addition, the distributed scheduling cluster comprises a controller, wherein the controller is respectively connected with the plurality of scheduling units and is used for managing the plurality of scheduling units. When the timing task trigger instruction is stored in the timing task instance, the distributed timing task instance can bear the scheduling operation of the current task through a core routing algorithm, and timely arrival and stable operation of the task are guaranteed. The core routing algorithm of the controller supports distributed scheduling cluster deployment, and can ensure that single node faults are not affected.
The embodiment of the invention discloses a timing task scheduling method, which is used for a timing task scheduling engine, and referring to fig. 3, and comprises the following steps:
301. and accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance.
Each scheduling unit manages its corresponding timing task storage module, so that timing task instances can be obtained in parallel. Specifically, each scheduling unit may correspond to a plurality of timed task instances. The timing task instances corresponding to different scheduling units are different from each other.
The timing task instance is used for storing a timing task trigger instruction. After the timing task instance is created, the scheduling unit monitors the timing task instance in real time.
302. And under the condition that the timing task meets the time triggering condition, sending a timing task triggering instruction in the timing task instance to a timing task management module through the scheduling unit.
Wherein the time trigger condition may be, for example, less than 1 minute from a specified time, or the current time is within a time trigger interval. For example, for an air conditioner, its timing tasks include: the air conditioner is turned on at 7 pm every day and turned off at 7 am every day, and the triggering condition may be based on time. And under the condition that the time meets the trigger condition, sending a timing task trigger instruction to a timing task management module.
303. And sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
The timed task management module API server is used as a data bus and a data core of the timed task scheduling engine, and can provide a Rest API interface of cluster management, including authentication authorization, data verification, cluster data change and other operations; a hub for data interaction and communication between other modules may also be provided.
And the timing task management module can send the timing task trigger instruction to the corresponding service system after receiving the timing task trigger instruction. The timing task management module can determine the corresponding service system according to the timing task trigger instruction.
The service system may be various, for example, a service system of a single terminal, for example, a service system of an air conditioner or a service system of a sweeper, or may be a service system formed by a plurality of terminals, for example, a service system of a kitchen, etc.
According to the timing task scheduling method, the scheduling of the timing tasks is achieved through the distributed scheduling clusters, the distributed scheduling clusters and the timing tasks are decoupled and separated, distributed scheduling can be supported, when the distributed scheduling is faced with a peak of the tasks, each scheduling unit schedules the corresponding timing task instance, the timing task instances do not interfere with each other, and the timing task triggering instruction is sent to the corresponding service system through the timing task management module to execute the timing tasks, so that higher scheduling capability of the timing tasks can be achieved, and stability of the timing task scheduling engine can be guaranteed.
Further, the timing task management module is connected with the service system through a stream data cluster. Specifically, the streaming data cluster may be a kafka cluster, and the plurality of timing task trigger instructions are respectively sent to the corresponding service systems through a form of a streaming data queue.
Step 303 specifically includes: and sending a plurality of timed task trigger instructions to the stream data cluster in a queue form through the timed task management module, and sending the timed task trigger instructions in the queue to a corresponding service system through the stream data cluster.
And the flow data cluster sends a plurality of timing task trigger instructions in a queue form, so that asynchronous requests can be realized, and the pressure caused by excessive timing tasks is relieved.
In addition, the decoupling of the timing task scheduling engine and the service system can be realized through the stream data cluster.
Further, the timed task scheduling engine further comprises: the timing callback module is respectively connected with the stream data clusters;
after sending the timing task trigger instruction in the queue to the corresponding service system through the stream data cluster, the method further includes:
And sending the timed task trigger instruction in the queue to the timed callback module through the stream data cluster so as to execute the timed task callback instruction corresponding to the timed task trigger instruction through the timed callback module.
The timing callback module in the embodiment is decoupled from the timing task engine, and is used for monitoring the sending condition of the timing task trigger instruction.
Further, the timed task scheduling engine further comprises: and the memory is respectively connected with the timing task management module and the timing callback module. The memory may be a Redis cache.
After sending, by the timed task management module, a plurality of the timed task trigger instructions into a stream data cluster in the form of a queue, the method further comprises:
generating a sent timing task record through the timing task management module, and storing the sent timing task record into the memory;
after executing the timed task callback instruction corresponding to the timed task trigger instruction by the timed callback module, the method further comprises:
storing a timed task callback result to a memory through the timed callback module; and the timed task callback result is stored corresponding to the sent timed task record.
By storing timed task callback results in correspondence with sent timed task records, it can be determined which sent timed task records have failed callback, meaning that the timed task is abnormal, such as failed sending, failed callback, etc.
Illustrating: the timed task management module sends timed task trigger instructions A, B and C to the kafka cluster, and stores the sent timed task records corresponding to the timed task trigger instructions A, B and C respectively in a memory. After the timed task trigger instructions A, B, C are respectively sent to the corresponding service systems through the kafka cluster, the timed task callback instructions corresponding to the timed task trigger instructions A, B, C are executed through the timed callback module, and the timed task callback results a, b and c are sent to the memory to be stored.
And scanning the timing task trigger instruction and the corresponding sent timing task record stored in the memory, and if a certain timing task trigger instruction is overtime and does not store a corresponding timing task callback result, determining that the timing task trigger instruction does not callback normally. The reason for the abnormal callback may be that the timing callback module is abnormal, or that the link between the kafka cluster and the timing callback module is abnormal.
Further, referring to fig. 4, after storing the timed task callback result to the memory by the timed callback module, the method further comprises:
s1, regularly scanning the timed tasks which are not called back when the time is overtime in the memory through a preset timed scanning tool, generating a notification according to the timed tasks which are not called back when the time is overtime, and sending the notification to the timed callback module.
S2, if the timed task trigger instruction which is not called back after the timeout exists in the timed callback module, re-executing the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the timeout through the timed callback module, and storing the regenerated timed task callback result into the memory.
Through the steps S1-S2, under the condition that a timed task trigger instruction which is not called back after overtime exists in the timed callback module, the timed task callback instruction corresponding to the timed task trigger instruction is re-executed, and effective monitoring of the timed task trigger instruction is achieved.
Further, after step S1, the method further comprises:
and S3, if the timed callback module does not have the timed task trigger instruction which is not called back after the timeout, sending a task compensation notice to the stream data cluster through the timed callback module.
S4, sending a target timing task trigger instruction corresponding to the task compensation notification to a corresponding service system through the stream data cluster.
And S5, sending the target timing task trigger instruction to the timing callback module through the stream data cluster, so that the timing callback module re-executes the timing task callback instruction corresponding to the timing task trigger instruction which is not called back in a time-out manner, and storing the regenerated timing task callback result into the memory.
Through the steps S3 to S5, under the condition that the timing task trigger instruction which is not called back by the timeout does not exist in the timing callback module, the fact that the stream data cluster does not successfully send the target timing task trigger instruction to the service system can be achieved, and the stream data cluster can send the target timing task trigger instruction which is not successfully sent to the corresponding service system.
Further, the distributed scheduling cluster comprises a controller, wherein the controller is respectively connected with a plurality of scheduling units and is used for managing the plurality of scheduling units;
the method further comprises the steps of:
sending an operation task instruction to a controller through the timing task management module so as to respectively control the scheduling unit to operate corresponding timing tasks through the controller;
Wherein the operational task instruction includes: adding timed task instructions, deleting timed task instructions and modifying timed task instructions. In addition, the operation task instruction may further include: query timed task instructions, pause timed task instructions, resume timed task instructions, reset timed task instructions, etc.
Through the timing task management module, the operation of the timing task instance can be realized. By combining the foregoing description of the embodiment, the timing task scheduling engine provided by the embodiment can realize decoupling of the scheduling task and the operation task, so that the complexity of the scheduling engine is increased when the scheduling task and the operation task occur simultaneously, and the instability of the scheduling engine is further caused.
In order to facilitate understanding of the technical solution of the present embodiment, referring to fig. 5, fig. 5 shows a system architecture diagram of the present embodiment. The method disclosed by the embodiment comprises the following steps:
501. and accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance.
502. And under the condition that the timing task meets the time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit.
503. And sending a plurality of timed task trigger instructions to the stream data cluster in a queue mode through the timed task management module.
504. And generating a sent timed task record through the timed task management module, and storing the sent timed task record into the memory.
505. And sending the timing task trigger instruction in the queue to a corresponding service system through the stream data cluster so as to enable the corresponding service system to execute the timing task.
506. And sending the timed task trigger instruction in the queue to the timed callback module through the stream data cluster so as to execute the timed task callback instruction corresponding to the timed task trigger instruction through the timed callback module.
507. Storing a timed task callback result to a memory through the timed callback module; and storing the timed task callback result corresponding to the sent timed task record.
508. And through a preset timing scanning tool, timing tasks which are not called back when the time is overtime are scanned in a memory in a timing mode, and a notification is generated according to the timing tasks which are not called back when the time is overtime and is sent to the timing callback module.
509. And if the timed task trigger instruction which is not called back after the timeout exists in the timed callback module, re-executing the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the timeout through the timed callback module, and storing the regenerated timed task callback result into the memory.
510. And if the timed task trigger instruction which is not called back after the timeout does not exist in the timed callback module, sending a task compensation notice to the stream data cluster through the timed callback module.
511. And sending the target timing task trigger instruction corresponding to the task compensation notification to the corresponding service system through the stream data cluster.
512. And sending the target timing task trigger instruction to the timing callback module through the stream data cluster.
513. And re-executing the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the timeout through the timed callback module, and storing the regenerated timed task callback result into the memory.
Furthermore, the timing callback module can update the service table Taskinfo in time according to the callback result so as to be used for recording the callback result.
The following describes the timed task scheduling device provided in the present application, and the timed task scheduling device described below and the timed task scheduling method described above may be referred to correspondingly.
The embodiment of the invention discloses a timing task scheduling device which is used for a timing task scheduling engine, wherein the timing task scheduling engine comprises: the system comprises a timing task management module, a distributed scheduling cluster and a timing task storage module, wherein the distributed scheduling cluster is respectively connected with the timing task management module and the timing task storage module;
The distributed scheduling cluster comprises a plurality of scheduling units, and the timed task storage module stores a plurality of timed task instances; the timing task instance and the scheduling unit have a preset corresponding relation;
referring to fig. 6, the apparatus includes:
an obtaining unit 601, configured to access, through each scheduling unit, the corresponding timed task storage module, and obtain a timed task instance; wherein, each timing task instance stores a plurality of timing tasks;
a sending unit 602, configured to send, by using the scheduling unit, a timing task trigger instruction corresponding to the timing task to a timing task management module, where the timing task is determined to meet a time trigger condition;
and the triggering unit 603 is configured to send the timing task triggering instruction to the corresponding service system through the timing task management module, so that the corresponding service system executes the timing task.
Optionally, the timing task management module is connected with the service system through a stream data cluster;
the triggering unit 603 is specifically configured to: and sending a plurality of timed task trigger instructions to the stream data cluster in a queue form through the timed task management module, and sending the timed task trigger instructions in the queue to a corresponding service system through the stream data cluster.
Optionally, the timing task scheduling engine further comprises: the timing callback module is respectively connected with the stream data clusters;
the apparatus further comprises: and the timing callback unit is used for sending the timing task trigger instruction in the queue to the timing callback module through the stream data cluster after sending the timing task trigger instruction in the queue to the corresponding service system through the stream data cluster, so as to execute the timing task callback instruction corresponding to the timing task trigger instruction through the timing callback module.
Optionally, the timing task scheduling engine further comprises: the memory is respectively connected with the timing task management module and the timing callback module;
the apparatus further comprises: the first storage unit is used for generating a sent timed task record through the timed task management module after the timed task trigger instructions are sent to the stream data cluster in a queue form through the timed task management module, and storing the sent timed task record into the memory;
the apparatus further comprises: the second storage unit is used for storing a timed task callback result to the memory through the timed callback module after the timed task callback instruction corresponding to the timed task trigger instruction is executed through the timed callback module; and storing the timed task callback result corresponding to the sent timed task record.
Optionally, the apparatus further comprises: the scanning unit is used for regularly scanning the timed tasks which are not called back when the time is overtime in the memory through a preset timed scanning tool after the timed task callback result is stored in the memory through the timed callback module, and generating a notification according to the timed tasks which are not called back when the time is overtime and sending the notification to the timed callback module;
and the first callback processing unit is used for re-executing the timed task callback instruction corresponding to the timed task triggering instruction which is not called back by the time-out and storing the regenerated timed task callback result into the memory through the timed callback module if the timed task triggering instruction which is not called back by the time-out exists in the timed callback module.
Optionally, the apparatus further comprises:
the second callback processing unit is used for sending a task compensation notice to the stream data cluster through the timing callback module if the timing task triggering instruction which is not called back by the timeout does not exist in the timing callback module after the notice generated by the timing task which is not called back by the timeout is sent to the timing callback module;
sending a target timing task trigger instruction corresponding to the task compensation notification to a corresponding service system through the stream data cluster;
And sending the target timed task trigger instruction to the timed callback module through the stream data cluster so that the timed callback module re-executes the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the time-out, and storing the regenerated timed task callback result into the memory.
Optionally, the distributed scheduling cluster includes a controller, where the controller is respectively connected with a plurality of scheduling units, and the controller is configured to manage a plurality of scheduling units;
the apparatus further comprises: the timing task operation unit is used for sending an operation task instruction to the controller through the timing task management module so as to respectively control the scheduling unit to operate the corresponding timing task through the controller;
wherein the operational task instruction includes: adding timed task instructions, deleting timed task instructions and modifying timed task instructions.
According to the timing task scheduling device, scheduling of the timing tasks is achieved through the distributed scheduling clusters, decoupling and separation are conducted on the distributed scheduling clusters and the timing task storage, distributed scheduling can be supported, when the distributed scheduling is faced with a peak of the tasks, each scheduling unit schedules the corresponding timing task instance, the timing task instances do not interfere with each other, and the timing task triggering instruction is sent to the corresponding service system through the timing task management module to execute the timing tasks, so that higher scheduling capability of the timing tasks can be achieved, and stability of the timing task scheduling engine can be guaranteed.
Fig. 7 illustrates a physical schematic diagram of an electronic device, as shown in fig. 7, which may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform a timed task scheduling method comprising: accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance; wherein, each timing task instance stores a plurality of timing tasks; under the condition that the timing task meets a time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit; and sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application further provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a computer readable storage medium, where the computer program when executed by a processor can perform a method for scheduling a timing task provided by the above methods, where the method includes: accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance; wherein, each timing task instance stores a plurality of timing tasks; under the condition that the timing task meets a time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit; and sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
In still another aspect, the present application further provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where the program executes a timing task scheduling method provided by the above methods, and the method includes: accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance; wherein, each timing task instance stores a plurality of timing tasks; under the condition that the timing task meets a time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit; and sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. A method for timing task scheduling, characterized by being used for a timing task scheduling engine, the timing task scheduling engine comprising: the system comprises a timing task management module, a distributed scheduling cluster and a timing task storage module, wherein the distributed scheduling cluster is respectively connected with the timing task management module and the timing task storage module;
the distributed scheduling cluster comprises a plurality of scheduling units, and the timed task storage module stores a plurality of timed task instances; the timing task instance and the scheduling unit have a preset corresponding relation;
the method comprises the following steps:
accessing the corresponding timing task storage module through each scheduling unit to acquire a timing task instance; wherein, each timing task instance stores a plurality of timing tasks;
Under the condition that the timing task meets a time triggering condition, sending a timing task triggering instruction corresponding to the timing task to a timing task management module through the scheduling unit;
and sending the timing task trigger instruction to a corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
2. The timed task scheduling method according to claim 1, characterized in that the timed task management module is connected with the service system through a stream data cluster;
the timing task triggering instruction is sent to a corresponding service system through the timing task management module, and the method comprises the following steps:
and sending a plurality of timed task trigger instructions to the stream data cluster in a queue form through the timed task management module, and sending the timed task trigger instructions in the queue to a corresponding service system through the stream data cluster.
3. The timed task scheduling method of claim 2, wherein,
the timed task scheduling engine further includes: the timing callback module is respectively connected with the stream data clusters;
After sending the timing task trigger instruction in the queue to the corresponding service system through the stream data cluster, the method further includes:
and sending the timed task trigger instruction in the queue to the timed callback module through the stream data cluster so as to execute the timed task callback instruction corresponding to the timed task trigger instruction through the timed callback module.
4. A timed task scheduling method according to claim 3 characterised in that the timed task scheduling engine further comprises: the memory is respectively connected with the timing task management module and the timing callback module;
after sending, by the timed task management module, a plurality of the timed task trigger instructions into a stream data cluster in the form of a queue, the method further comprises:
generating a sent timing task record through the timing task management module, and storing the sent timing task record into the memory;
after executing the timed task callback instruction corresponding to the timed task trigger instruction by the timed callback module, the method further comprises:
storing a timed task callback result to a memory through the timed callback module; and storing the timed task callback result corresponding to the sent timed task record.
5. A timed task scheduling method according to claim 4, characterized in that after storing timed task callback results to memory by the timed callback module, the method further comprises:
through a preset timing scanning tool, timing tasks which are not called back when the time is overtime are scanned in the memory at fixed time, and a notification is generated according to the timing tasks which are not called back when the time is overtime and sent to the timing callback module;
and if the timed task trigger instruction which is not called back after the timeout exists in the timed callback module, re-executing the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the timeout through the timed callback module, and storing the regenerated timed task callback result into the memory.
6. The timed task scheduling method of claim 5, wherein,
after the timing task generation notification which is not called back according to the timeout is sent to the timing callback module, the method further comprises the following steps:
if the timing callback module does not have the timing task trigger instruction which is not called back after the timeout, a task compensation notice is sent to the stream data cluster through the timing callback module;
Sending a target timing task trigger instruction corresponding to the task compensation notification to a corresponding service system through the stream data cluster;
and sending the target timed task trigger instruction to the timed callback module through the stream data cluster so that the timed callback module re-executes the timed task callback instruction corresponding to the timed task trigger instruction which is not called back after the time-out, and storing the regenerated timed task callback result into the memory.
7. The timed task scheduling method according to claim 1, characterized in that the distributed scheduling cluster comprises a controller, the controller being respectively connected with a plurality of scheduling units, the controller being used for managing a plurality of the scheduling units;
the method further comprises the steps of:
sending an operation task instruction to a controller through the timing task management module so as to respectively control the scheduling unit to operate corresponding timing tasks through the controller;
wherein the operational task instruction includes: adding timed task instructions, deleting timed task instructions and modifying timed task instructions.
8. A timed task scheduling device for a timed task scheduling engine, the timed task scheduling engine comprising: the system comprises a timing task management module, a distributed scheduling cluster and a timing task storage module, wherein the distributed scheduling cluster is respectively connected with the timing task management module and the timing task storage module;
The distributed scheduling cluster comprises a plurality of scheduling units, and the timed task storage module stores a plurality of timed task instances; the timing task instance and the scheduling unit have a preset corresponding relation;
the device comprises:
the acquisition unit is used for accessing the corresponding timing task storage modules through each scheduling unit to acquire timing task instances; wherein, each timing task instance stores a plurality of timing tasks;
the sending unit is used for sending a timing task trigger instruction corresponding to the timing task management module through the scheduling unit under the condition that the timing task is determined to meet a time trigger condition;
and the triggering unit is used for sending the timing task triggering instruction to the corresponding service system through the timing task management module so as to enable the corresponding service system to execute the timing task.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the timed task scheduling method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to perform the timed task scheduling method of any one of claims 1 to 7 by means of the computer program.
CN202311566309.2A 2023-11-22 2023-11-22 Timing task scheduling method and device, storage medium and electronic device Pending CN117687750A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311566309.2A CN117687750A (en) 2023-11-22 2023-11-22 Timing task scheduling method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311566309.2A CN117687750A (en) 2023-11-22 2023-11-22 Timing task scheduling method and device, storage medium and electronic device

Publications (1)

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

Family

ID=90134270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311566309.2A Pending CN117687750A (en) 2023-11-22 2023-11-22 Timing task scheduling method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117687750A (en)

Similar Documents

Publication Publication Date Title
CN113726846B (en) Edge cloud system, resource scheduling method, equipment and storage medium
Khazaei et al. Analysis of a pool management scheme for cloud computing centers
US8606908B2 (en) Wake-up server
CN116048467A (en) Micro-service development platform and business system development method
CN108667639A (en) A kind of method for managing resource under privately owned cloud environment and management server
CN114697150B (en) Command issuing method and device, storage medium and electronic device
US10122602B1 (en) Distributed system infrastructure testing
CN117687750A (en) Timing task scheduling method and device, storage medium and electronic device
CN116033006A (en) Data processing method, system, storage medium and electronic device
CN116107975A (en) Control method and device of equipment, storage medium and electronic device
CN107465727B (en) Time monitoring system and method
CN115048392A (en) Data deletion method and device, storage medium and electronic device
CN115309062A (en) Device control method, device, storage medium, and electronic apparatus
CN110099208B (en) Method and device for cross-level and cross-domain upgrading of camera in video monitoring system
CN115174296B (en) Equipment function access method and device, storage medium and electronic device
CN115296958B (en) Distribution method and device of equipment control tasks, storage medium and electronic device
CN115296945B (en) Control method, system and device of equipment, storage medium and electronic device
CN109327529A (en) Distributed Scans method and system
CN116684374A (en) Gateway message processing method and device, storage medium and electronic device
WO2024016506A1 (en) Gateway device control method and apparatus, and storage medium and electronic apparatus
CN117527459A (en) Control method and device of intelligent equipment, storage medium and electronic device
CN116846936A (en) Method and device for sending control instruction, storage medium and electronic device
CN115314245B (en) Authority management method, system, storage medium and electronic device
CN117914788A (en) Message current limiting processing method and device for intelligent household equipment
CN115587103A (en) Algorithm resource planning method, device, terminal and computer readable 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