CN112835692A - Log message driven task method, system, storage medium and equipment - Google Patents

Log message driven task method, system, storage medium and equipment Download PDF

Info

Publication number
CN112835692A
CN112835692A CN202110038871.2A CN202110038871A CN112835692A CN 112835692 A CN112835692 A CN 112835692A CN 202110038871 A CN202110038871 A CN 202110038871A CN 112835692 A CN112835692 A CN 112835692A
Authority
CN
China
Prior art keywords
task
log
information
subtask
queue
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.)
Granted
Application number
CN202110038871.2A
Other languages
Chinese (zh)
Other versions
CN112835692B (en
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.)
Zhongyang Health Technology Group Co ltd
Original Assignee
Shandong Msunhealth Technology Group 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 Shandong Msunhealth Technology Group Co Ltd filed Critical Shandong Msunhealth Technology Group Co Ltd
Priority to CN202110038871.2A priority Critical patent/CN112835692B/en
Publication of CN112835692A publication Critical patent/CN112835692A/en
Application granted granted Critical
Publication of CN112835692B publication Critical patent/CN112835692B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a system, a storage medium and equipment for driving tasks by log messages, which are used for executing subtasks and putting logs generated by the subtasks into a queue, wherein the logs comprise current subtask information, result information of subtask execution and possible next-step driving task information; if the result information of the subtask execution of the current log is successful, inserting the log information of the subtask into a database, and executing the subtask corresponding to the next possible driving task information until the whole task is completed; if the result information of the subtask execution of the current log is failure, the log information in the queue cache is inserted into a database for solidification, whether the subtask information corresponding to the log is a key task node is judged, and if yes, all tasks are ended; if not, driving the next subtask, and removing the related log information from the queue after the processing is finished; the invention can reasonably complete the data extraction work and improve the task scheduling stability.

Description

Log message driven task method, system, storage medium and equipment
Technical Field
The invention belongs to the technical field of medical log message processing, and particularly relates to a method, a system, a storage medium and equipment for driving tasks by log messages.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
The informatization of medical services is an international development trend. With the rapid development of information technology, more and more hospitals in China are accelerating to implement overall construction based on an information platform and the like so as to improve the service level and the core competitiveness of the hospitals. The premise of informatization is to establish a data warehouse, and the scheduling of the task of data extraction is an important part in the process.
At present, data extraction tasks are mainly divided into real-time scheduling and timing scheduling, the whole process of data extraction and arrangement is divided into a plurality of data processing subtasks, a large task is firstly established, the plurality of subtasks are placed into the large task, the front-back sequence of the subtasks is configured in advance, and the like, a determined flow is formed, and the tasks are executed in sequence according to the preset flow. However, the task driving mode is relatively fixed and rigid, high coupling exists between the whole task and the subtasks, and the task driving mode is not flexible to schedule.
Meanwhile, the outer layer of the large task occupies one thread, and the overall resource allocation is influenced; if the thread of the outer layer large task has a problem, all tasks are affected. The sequence of the subtasks is fixed, and the drive of the subsequent subtasks is not changed in time according to the execution result of the previous subtask, so that the change and the adjustment are not easy.
Disclosure of Invention
In order to solve the problems, the invention provides a method, a system, a storage medium and equipment for driving tasks by log messages.
According to some embodiments, the invention adopts the following technical scheme:
a log message driven task method, comprising the steps of:
executing the subtasks, and putting the generated logs into a queue, wherein the logs comprise current subtask information, result information of subtask execution and possible next-step driving task information;
if the result information of the subtask execution of the current log is successful, inserting the log information of the subtask into a database, and executing the subtask corresponding to the next possible driving task information until the whole task is completed;
if the result information of the subtask execution of the current log is failure, the log information in the queue cache is inserted into a database for solidification, whether the subtask information corresponding to the log is a key task node is judged, and if yes, all tasks are ended; and if not, driving the next subtask, and removing the related log information from the queue after the processing is finished.
As an alternative, the above-described method steps are performed cyclically.
As an alternative implementation mode, a linked list mechanism is formed among all subtasks belonging to the same large task, and the subtasks carry out the next task driving according to executed log information, namely whether each task is executed or not is related to the front task of each task.
As an alternative embodiment, a queue is created for each large task, and the queue collects and processes all tasks in a workflow.
As an alternative, each subtask includes information about the task to be executed by the subtask itself, information about the next possible driving task, and a relevant determination condition for triggering the driving task.
As an alternative implementation, if there are multiple logs, the logs are sorted in time in a queue and processed in order.
As an alternative embodiment, if there are a plurality of subtasks to be executed simultaneously, the log information generated by the respective subtasks is inserted into the queue at the same time.
As an alternative implementation manner, if the result information of the sub-task execution of the current log is failure, the reminding task is driven at the same time to remind that the corresponding sub-task execution fails.
A log message driven task system, comprising:
the log queue building module is configured to put logs generated by executing the subtasks into a queue, wherein the logs comprise current subtask information, result information of subtask execution and possible next-step driving task information;
the sequence execution module is configured to insert the log information of the subtask into a database if the result information of the subtask execution of the current log is successful, and execute the subtask corresponding to the next possible driving task information until the whole task is completed; if the result information of the subtask execution of the current log is failure, the log information in the queue cache is inserted into a database for solidification, whether the subtask information corresponding to the log is a key task node is judged, and if yes, all tasks are ended; and if not, driving the next subtask, and removing the related log information from the queue after the processing is finished.
A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor of a terminal device and to perform the steps of a log message driven task method as described.
A terminal device comprising a processor and a computer readable storage medium, the processor being configured to implement instructions; the computer readable storage medium stores instructions adapted to be loaded by a processor and to perform the steps of the log message driven task method.
Compared with the prior art, the invention has the beneficial effects that:
the invention breaks through the form of the prior fixed task flow before the original task is executed, and drives the next task to be executed through the log of the previous task node, thereby more reasonably finishing the work of data extraction; the subtasks can be finished in real time, and the threads are released in real time. The bus program is not worried about suddenly dropping to influence the execution of all the subtasks, and the scheduling execution of the tasks is more stable.
The invention cancels the outer layer large task containing all subtasks, reduces the occupation of the thread to system resources, reduces the high coupling between tasks by adopting the log driving task, improves the stability of task scheduling, and does not interrupt the execution of the whole task due to the failure of the total task thread or the single subtask thread.
The execution sequence of each subtask can be flexibly changed, and compared with the original fixed execution flow, the method realizes flexible selection and adjustment of the next execution task by the log-driven task.
The invention does not need to solidify the whole task scheduling process before task execution, reduces mutual coupling, has higher task scheduling flexibility, and supports more various and complex scheduling conditions.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
Fig. 1 is a schematic flow chart of the present embodiment.
The specific implementation mode is as follows:
the invention is further described with reference to the following figures and examples.
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
As shown in fig. 1, a log message driven task method includes the following steps:
(1) when scheduling is carried out, a total task thread is not initialized to carry out total monitoring, if only one subtask is executed at first, the current subtask comprises the task information to be executed by the current subtask, the information of the next possible driving task and the relevant judgment condition for triggering the driving task. The generated logs are put into a queue, the logs comprise subtask information, result information of subtask execution and task information which can be driven in the next step, the logs are processed in the queue according to the sequence, and the next step of driving is carried out according to the information of the logs. If multiple subtasks are executed simultaneously, the log information generated by each subtask can be inserted into the queue at the same time. Each large task corresponds to a queue created to collect and process all tasks in a workflow.
(2) And if the log information fails, driving the next task to insert the log information in the queue cache into a database for solidification, facilitating subsequent inquiry, checking and the like, driving a reminding task, prompting on a foreground, and pushing error information to system operators. If the log judges that the node is a key task node, driving to finish all tasks; if the log information is judged not to be the key node, the next task can be driven smoothly, and after the processing is finished, the related log information is removed from the queue.
(3) If the subtask log state is successful, the log information of the subtask is inserted into the database, and the next task contained in the database is driven, so that the whole task can be continuously executed; and the log information of a plurality of subtasks can be used as a judgment in the queue to decide whether to drive the next task.
(4) According to the method, a plurality of subtasks form a linked list mechanism, and the subtasks carry out next-step task driving according to executed log information, namely whether each task is executed or not is related to the front task.
The following product examples are also provided:
a log message driven task system, comprising:
the log queue building module is configured to put logs generated by executing the subtasks into a queue, wherein the logs comprise current subtask information, result information of subtask execution and possible next-step driving task information;
the sequence execution module is configured to insert the log information of the subtask into a database if the result information of the subtask execution of the current log is successful, and execute the subtask corresponding to the next possible driving task information until the whole task is completed; if the result information of the subtask execution of the current log is failure, the log information in the queue cache is inserted into a database for solidification, whether the subtask information corresponding to the log is a key task node is judged, and if yes, all tasks are ended; and if not, driving the next subtask, and removing the related log information from the queue after the processing is finished.
A computer readable storage medium having stored therein a plurality of instructions adapted to be loaded by a processor of a terminal device and to perform the steps of a log message driven task method as described.
A terminal device comprising a processor and a computer readable storage medium, the processor being configured to implement instructions; the computer readable storage medium stores instructions adapted to be loaded by a processor and to perform the steps of the log message driven task method.
Of course, the scheme can also be used in a medical service system.
A medical service system adopts the method or comprises the system, a readable storage medium or terminal equipment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (10)

1. A log message driven task method is characterized in that: the method comprises the following steps:
executing the subtasks, and putting the generated logs into a queue, wherein the logs comprise current subtask information, result information of subtask execution and possible next-step driving task information;
if the result information of the subtask execution of the current log is successful, inserting the log information of the subtask into a database, and executing the subtask corresponding to the next possible driving task information until the whole task is completed;
if the result information of the subtask execution of the current log is failure, the log information in the queue cache is inserted into a database for solidification, whether the subtask information corresponding to the log is a key task node is judged, and if yes, all tasks are ended; and if not, driving the next subtask, and removing the related log information from the queue after the processing is finished.
2. The log message driven task method of claim 1, wherein: and a linked list mechanism is formed among all subtasks belonging to the same large task, and the subtasks carry out next-step task driving according to executed log information, namely whether each task is executed or not is related to a front task of each task.
3. The log message driven task method of claim 1, wherein: each large task corresponds to a queue created to collect and process all tasks in a workflow.
4. The log message driven task method of claim 1, wherein: each subtask includes task information to be executed by the subtask, information of a next possible driving task and related judgment conditions for triggering the driving task.
5. The log message driven task method of claim 1, wherein: if a plurality of logs exist, sequencing the logs in the queue according to time sequence, and processing according to the sequence.
6. The log message driven task method of claim 1, wherein: if a plurality of subtasks are executed simultaneously, the log information generated by each subtask is simultaneously inserted into the queue.
7. The log message driven task method of claim 1, wherein: and if the result information of the sub-task execution of the current log is failure, simultaneously driving a reminding task to remind that the corresponding sub-task execution fails.
8. A log message driven task system, characterized by: the method comprises the following steps:
the log queue building module is configured to put logs generated by executing the subtasks into a queue, wherein the logs comprise current subtask information, result information of subtask execution and possible next-step driving task information;
the sequence execution module is configured to insert the log information of the subtask into a database if the result information of the subtask execution of the current log is successful, and execute the subtask corresponding to the next possible driving task information until the whole task is completed; if the result information of the subtask execution of the current log is failure, the log information in the queue cache is inserted into a database for solidification, whether the subtask information corresponding to the log is a key task node is judged, and if yes, all tasks are ended; and if not, driving the next subtask, and removing the related log information from the queue after the processing is finished.
9. A computer-readable storage medium characterized by: in which a plurality of instructions are stored, said instructions being adapted to be loaded by a processor of a terminal device and to carry out the steps of a log message driven task method according to any one of claims 1 to 7.
10. A terminal device is characterized in that: the system comprises a processor and a computer readable storage medium, wherein the processor is used for realizing instructions; a computer readable storage medium for storing a plurality of instructions adapted to be loaded by a processor and for performing the steps of a log message driven task method as claimed in any one of claims 1 to 7.
CN202110038871.2A 2021-01-12 2021-01-12 Log message driven task method, system, storage medium and equipment Active CN112835692B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110038871.2A CN112835692B (en) 2021-01-12 2021-01-12 Log message driven task method, system, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110038871.2A CN112835692B (en) 2021-01-12 2021-01-12 Log message driven task method, system, storage medium and equipment

Publications (2)

Publication Number Publication Date
CN112835692A true CN112835692A (en) 2021-05-25
CN112835692B CN112835692B (en) 2022-08-19

Family

ID=75928004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110038871.2A Active CN112835692B (en) 2021-01-12 2021-01-12 Log message driven task method, system, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN112835692B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045203A1 (en) * 2021-09-24 2023-03-30 苏州浪潮智能科技有限公司 Task scheduling method, chip, and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599145A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of Workflow management method and system
CN107577586A (en) * 2016-07-04 2018-01-12 阿里巴巴集团控股有限公司 A kind of method and apparatus for being used to determine that business performs link in distributed system
CN108874559A (en) * 2018-05-31 2018-11-23 康键信息技术(深圳)有限公司 electronic device, distributed system service link analysis method and storage medium
CN110210763A (en) * 2019-06-05 2019-09-06 深圳前海微众银行股份有限公司 Event-driven method, device, equipment and storage medium based on ITSM
CN110286892A (en) * 2019-06-26 2019-09-27 成都九洲电子信息系统股份有限公司 A kind of quick exploitation automotive engine system based on business Process Design
CN110333940A (en) * 2019-06-25 2019-10-15 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and storage medium based on condition
CN110597613A (en) * 2018-06-12 2019-12-20 成都鼎桥通信技术有限公司 Task processing method, device, equipment and computer readable storage medium
CN111198769A (en) * 2018-11-16 2020-05-26 北京京东金融科技控股有限公司 Information processing method and system, computer system and computer readable medium
CN112200208A (en) * 2020-05-14 2021-01-08 北京理工大学 Cloud workflow task execution time prediction method based on multi-dimensional feature fusion

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599145A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of Workflow management method and system
CN107577586A (en) * 2016-07-04 2018-01-12 阿里巴巴集团控股有限公司 A kind of method and apparatus for being used to determine that business performs link in distributed system
CN108874559A (en) * 2018-05-31 2018-11-23 康键信息技术(深圳)有限公司 electronic device, distributed system service link analysis method and storage medium
CN110597613A (en) * 2018-06-12 2019-12-20 成都鼎桥通信技术有限公司 Task processing method, device, equipment and computer readable storage medium
CN111198769A (en) * 2018-11-16 2020-05-26 北京京东金融科技控股有限公司 Information processing method and system, computer system and computer readable medium
CN110210763A (en) * 2019-06-05 2019-09-06 深圳前海微众银行股份有限公司 Event-driven method, device, equipment and storage medium based on ITSM
CN110333940A (en) * 2019-06-25 2019-10-15 深圳前海微众银行股份有限公司 Method for scheduling task, device, equipment and storage medium based on condition
CN110286892A (en) * 2019-06-26 2019-09-27 成都九洲电子信息系统股份有限公司 A kind of quick exploitation automotive engine system based on business Process Design
CN112200208A (en) * 2020-05-14 2021-01-08 北京理工大学 Cloud workflow task execution time prediction method based on multi-dimensional feature fusion

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023045203A1 (en) * 2021-09-24 2023-03-30 苏州浪潮智能科技有限公司 Task scheduling method, chip, and electronic device

Also Published As

Publication number Publication date
CN112835692B (en) 2022-08-19

Similar Documents

Publication Publication Date Title
CN106802826B (en) Service processing method and device based on thread pool
WO2020052301A1 (en) Resource scheduling method and device
CN111782360A (en) Distributed task scheduling method and device
CN105159768A (en) Task management method and cloud data center management platform
CN109656782A (en) Visual scheduling monitoring method, device and server
CN111399989A (en) Task preemption scheduling method and system for container cloud
CN109710416B (en) Resource scheduling method and device
CN110673927B (en) Scheduling method and device of virtual machine
CN107168777B (en) Method and device for scheduling resources in distributed system
CN105573827A (en) Multi-machine parallel processing method and device
WO2015131542A1 (en) Data processing method, device and system
CN111459754A (en) Abnormal task processing method, device, medium and electronic equipment
CN112835692B (en) Log message driven task method, system, storage medium and equipment
CN112150015A (en) Task allocation method and device
CN113626173B (en) Scheduling method, scheduling device and storage medium
CN114327894A (en) Resource allocation method, device, electronic equipment and storage medium
US20130117757A1 (en) Method and apparatus for scheduling application programs
CN113157411A (en) Reliable configurable task system and device based on Celery
CN116302420A (en) Concurrent scheduling method, concurrent scheduling device, computer equipment and computer readable storage medium
CN107544840A (en) A kind of process management method and device
CN113342512B (en) IO task silencing and driving method and device and related equipment
CN111638965B (en) Command queue inter-fence synchronization method and system based on fence replication and handshake
CN110046809B (en) Job scheduling method and device
CN112231087A (en) Task scheduling method, device, equipment and storage medium
CN111597018A (en) Robot job scheduling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 12 / F, building 1, Aosheng building, 1166 Xinluo street, hi tech Zone, Jinan City, Shandong Province

Patentee after: Zhongyang Health Technology Group Co.,Ltd.

Address before: 12 / F, building 1, Aosheng building, 1166 Xinluo street, hi tech Zone, Jinan City, Shandong Province

Patentee before: SHANDONG MSUNHEALTH TECHNOLOGY GROUP Co.,Ltd.