CN110245011A - A kind of method for scheduling task and device - Google Patents

A kind of method for scheduling task and device Download PDF

Info

Publication number
CN110245011A
CN110245011A CN201810189463.5A CN201810189463A CN110245011A CN 110245011 A CN110245011 A CN 110245011A CN 201810189463 A CN201810189463 A CN 201810189463A CN 110245011 A CN110245011 A CN 110245011A
Authority
CN
China
Prior art keywords
task
memory queue
queue
handles
abnormal
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
CN201810189463.5A
Other languages
Chinese (zh)
Inventor
姜洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810189463.5A priority Critical patent/CN110245011A/en
Publication of CN110245011A publication Critical patent/CN110245011A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of method for scheduling task and devices, are related to field of computer technology.One specific embodiment of this method includes: the task in scan database, is that memory queue is written in untreated task by task status;Task is removed from memory queue by handling thread, and handles the task;Judge whether the task handles success, if so, the task status of the task to be changed to processed, and more new database;If it is not, abnormal memory queue then is written in the task.The embodiment is able to solve the problem of reliability and high efficiency of the information interaction of system.

Description

A kind of method for scheduling task and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of method for scheduling task and device.
Background technique
With the development of Software Industry, more and more software systems are developed, and past between these software systems Toward the interaction that can all carry out information.For some large software systems, in order to decouple modules, at the beginning of design just Many subsystems have been divided, equally can also there is the interaction of information between these subsystems.Interaction between subsystem often relates to It and to multiple, and is interactional, wherein either which subsystem there is a problem or information exchange failure, It will influence the circulation of entire regular traffic.So the information exchange between system must be reliable.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery: not being reliable sexual intercourse Mutually, if system is died or system cut-off, data in EMS memory cannot reappear whole disappearances;Moreover, in processing thread process When business, it in case of exception, can be retried in current processing thread, cause task to overstock, influence the effect of information exchange Rate.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method for scheduling task and device, it is able to solve information between system The problem of interactive reliability and high efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of method for scheduling task is provided, is wrapped It includes:
Task status is that memory queue is written in untreated task by the task in scan database;
Task is removed from memory queue by handling thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to it is processed, and more New database;If it is not, abnormal memory queue then is written in the task.
Optionally, the method also includes:
Task is removed from abnormal memory queue by abnormality processing thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to it is processed, and more New database;If it is not, the task to be then written to the tail of the queue of abnormal memory queue again.
Optionally, the method also includes:
The size that abnormal memory queue is monitored by abnormality processing thread, when the size of abnormal memory queue is not zero, Task is removed from abnormal memory queue, and handles the task, when the size of abnormal memory queue is zero, is closed described different Often processing thread.
Optionally, before the task in scan database, the method also includes: each task received is deposited It is stored in database, and by task status labeled as untreated.
In addition, other side according to an embodiment of the present invention, provides a kind of task scheduling apparatus, comprising:
Task status is that memory queue is written in untreated task for the task in scan database by writing module;
Processing module for removing task from memory queue by handling thread, and handles the task;
Abnormal writing module, for judging whether the task handles success, if so, by the task status of the task It is changed to processed, and more new database;If it is not, abnormal memory queue then is written in the task.
Optionally, described device further includes exception processing module, is used for:
Task is removed from abnormal memory queue by abnormality processing thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to it is processed, and more New database;If it is not, the task to be then written to the tail of the queue of abnormal memory queue again.
Optionally, the exception processing module, is also used to:
The size that abnormal memory queue is monitored by abnormality processing thread, when the size of abnormal memory queue is not zero, Task is removed from abnormal memory queue, and handles the task, when the size of abnormal memory queue is zero, is closed described different Often processing thread.
Optionally, described device further includes memory module, is used for:
Before task in scan database, each task received is stored in database profession, and by task Status indication is untreated.
Other side according to an embodiment of the present invention, additionally provides a kind of electronic equipment, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes method described in any of the above-described embodiment.
Other side according to an embodiment of the present invention additionally provides a kind of computer-readable medium, is stored thereon with meter Calculation machine program, realizes method described in any of the above-described embodiment when described program is executed by processor.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because using being stored into database Memory queue is written in task, the technological means of task is removed and handled from memory queue, so overcoming information between system The technical issues of interactive reliability and high efficiency, by task storage into database, even service is cut off or is powered off Server is caused to shut down, although the task in memory queue is without the task in database also exists, in system starting When can task in scan database, while being the team that untreated task is automatically added to memory queue by task status Tail, processing thread still can handle the queue in memory queue, ensure that the reliable of the information interaction of subsystem in this way Property.Moreover, either task is handled successfully or processing failure, processing thread can all remove the task in memory queue, because This does not influence the processing of other tasks in memory queue, to improve the information exchange effect between task treatment effeciency and subsystem Rate.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the main flow of method for scheduling task according to an embodiment of the present invention;
Fig. 2 is the schematic diagram of the main flow of a method for scheduling task that can refer to embodiment according to the present invention;
Fig. 3 is the schematic diagram of the main modular of task scheduling apparatus according to an embodiment of the present invention;
Fig. 4 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 5 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1 is method for scheduling task according to an embodiment of the present invention.As an embodiment of the present invention, as shown in Figure 1, The method for scheduling task may include:
Step 101, task status is that memory queue is written in untreated task by the task in scan database.
In this step, task status is untreated task by timing or constantly the task in scan database The tail of the queue of memory queue is written one by one.
For some large software systems, in order to which modules are decoupled, just divided many sons at the beginning of design System equally can also have the interaction of information between these subsystems.Method for scheduling task provided in an embodiment of the present invention can be with Applied in a subsystem, the database is deployed in a subsystem, store tasks data is used for, in each subsystem Database not in other subsystems database carry out data interaction.
Since each task can store in database, even service, which is cut off or is powered off, causes server to close Machine, the data (i.e. task) in memory queue are although without the task in database also exists.Memory queue is one The array that has just initialized when system starting, therefore understand when system starting the task in scan database, while by task State is the tail of the queue that untreated task is automatically added to memory queue, and processing thread still can handle the team in memory queue Column, ensure that the reliability of the information interaction of subsystem in this way.
Each of as another embodiment of the invention, before step 101, the method also includes: will receive Task is all stored in database profession, and by task status labeled as untreated.After receiving the task that subsystem issues, first By task storage into database, the state of task is untreated.
Specifically, some subsystem issues task, another subsystem receives issuing for task, and every by what is received A task is all stored in the database of the subsystem.Optionally, the task can be outbound task, inbound task, prompt Message etc..
Step 102, task is removed from memory queue by handling thread, and handle the task.
Processing thread is that just the sub thread of operation, this thread loops monitor the big of memory queue after a system starts It is small, if it find that when the size of i.e. memory queue is not zero, then being moved from the head of the queue of memory queue with the presence of task in memory queue Except task, and handle the task.In the task of processing, the processing thread executes business processing logic, this business processing Logic can be an external interface and call, and be also possible to send out short message etc..
Step 103, judge whether the task handles success, if so, the task status of the task is changed to Processing, and more new database;If it is not, abnormal memory queue then is written in the task.
After executing step 102, implementing result is divided into two kinds of situations: a kind of situation is that task is handled successfully, by task shape State is changed to processed (handling successfully), and in more new database the task task status, then by processing thread at Manage the next task in memory queue;Another situation is that task, is written the team of abnormal memory queue by task processing failure Tail.As it can be seen that either task is handled successfully or processing failure, processing thread can all remove the task in memory queue, just Because of that method for scheduling task provided in an embodiment of the present invention does not influence the processing of other tasks in memory queue, to mention Information exchange efficiency between high task treatment effeciency and subsystem.
According to various embodiments recited above, it can be seen that the present invention writes by using being stored into database for task Enter memory queue, the technological means of task is removed and handled from memory queue, thus solve the information interaction of system The problem of reliability and high efficiency.That is, the prior art is if system is died or system cut-off, data in EMS memory will It all disappears, and in case of exception, can be retried in current processing thread, task is caused to overstock, influence information friendship Mutual efficiency.And the present invention is by task storage into database, even service, which is cut off or is powered off, causes server to close Machine, although the task in memory queue is without the task in database also exists, and can scan number when system starting It is the tail of the queue that untreated task is automatically added to memory queue according to the task in library, while by task status, processing thread is still It so can handle the queue in memory queue, ensure that the reliability of the information interaction of subsystem in this way.Moreover, either Task is handled successfully or processing failure, and processing thread can all remove the task in memory queue, therefore not influence memory team The processing of other tasks in column, to improve the information exchange efficiency between task treatment effeciency and subsystem.
As yet another embodiment of the present invention, after step 103, the method can also include: to pass through exception Lineation journey removes task from abnormal memory queue, and handles the task;Judge whether the task handles success, if so, The task status of the task is then changed to processed, and more new database;If it is not, exception is then written in the task again The tail of the queue of memory queue.
Abnormality processing thread is equally that just the sub thread of operation, this thread monitor abnormal memory team after a system starts The size of column leads to task processing failure if exception has occurred during executing step 102, in abnormal memory queue Task is just had, is i.e. when the size of memory queue is not zero, then removes task from the head of the queue of abnormal memory queue, executes at business Manage logic.
When handling the task in abnormal memory queue, two kinds of situations can also occur: a kind of situation is that task is handled successfully, Task status is changed to processed (handling successfully), and in more new database the task task status, then by different The often next task in processing thread process exception memory queue;Another situation is that task processing failure, will appoint after failure The tail of the queue of abnormal memory queue is written in business again, receives execution next time, until task execution success.
Optionally, the size that abnormal memory queue is monitored by abnormality processing thread, when abnormal memory queue size not When being zero, task is removed from abnormal memory queue, and handles the task, when the size of abnormal memory queue is zero, is closed Close the abnormality processing thread.
Therefore, in an embodiment of the present invention, exception has occurred when handling thread process business can't be current It is retried in processing thread, but passes through the task in abnormality processing thread asynchronous process exception memory queue, such memory queue In will not have task overstock, ensure that treatment effeciency.
Fig. 2 is the schematic diagram of the main flow of a method for scheduling task that can refer to embodiment according to the present invention.As Another embodiment of the invention, the method for scheduling task can specifically include:
Receive the task that other subsystems issue;
The each task received is stored in database profession, and by task status labeled as untreated;
Task status is that memory queue is written in untreated task by the task in scan database;
Task is removed from memory queue by handling thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to it is processed, and more New database;If it is not, abnormal memory queue then is written in the task;
Task is removed from abnormal memory queue by abnormality processing thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to it is processed, and more New database;If it is not, the task to be then written to the tail of the queue of abnormal memory queue again, receive execution next time, Zhi Daoren Business runs succeeded.
According to various embodiments recited above, it can be seen that the present invention writes by using being stored into database for task Enter memory queue, the technological means of task is removed and handled from memory queue, thus solve the information interaction of system The problem of reliability and high efficiency.That is, the prior art is if system is died or system cut-off, data in EMS memory will It all disappears, and in case of exception, can be retried in current processing thread, task is caused to overstock, influence information friendship Mutual efficiency.And the present invention is by task storage into database, even service, which is cut off or is powered off, causes server to close Machine, although the task in memory queue is without the task in database also exists, and can scan number when system starting It is the tail of the queue that untreated task is automatically added to memory queue according to the task in library, while by task status, processing thread is still It so can handle the queue in memory queue, ensure that the reliability of the information interaction of subsystem in this way.Moreover, either Task is handled successfully or processing failure, and processing thread can all remove the task in memory queue, therefore not influence memory team The processing of other tasks in column, to improve the information exchange efficiency between task treatment effeciency and subsystem.
In addition, can refer to the specific implementation content of method for scheduling task described in embodiment at the present invention one, above It has been described in detail in the method for scheduling task, therefore has no longer illustrated in this duplicate contents.
Fig. 3 is the schematic diagram of the main modular of task scheduling apparatus according to an embodiment of the present invention.As shown in figure 3, described Task scheduling apparatus 300 includes writing module 301, processing module 302 and abnormal writing module 303.Wherein, the write module Task status is that memory queue is written in untreated task by the task in 301 scan databases;The processing module 302 is logical It crosses processing thread and removes task from memory queue, and handle the task;The exception writing module 303 judges the task Whether processing success, if so, the task status of the task to be changed to processed, and more new database;If it is not, then by institute It states task and abnormal memory queue is written.
Task status is untreated by 301 timing of the write module or constantly the task in scan database The tail of the queue of memory queue is written in task one by one.Task scheduling apparatus provided in an embodiment of the present invention can be set in a subsystem In system, the database is deployed in a subsystem, is used for store tasks data, the database in each subsystem not with its Database in his subsystem carries out data interaction.
Since each task can store in database, even service, which is cut off or is powered off, causes server to close Machine, the data (i.e. task) in memory queue are although without the task in database also exists.Memory queue is one The array that has just initialized when system starting, therefore understand when system starting the task in scan database, while by task State is the tail of the queue that untreated task is automatically added to memory queue, and processing thread still can handle the team in memory queue Column, ensure that the reliability of the information interaction of subsystem in this way.
Optionally, described device further includes memory module, will before task of the memory module in scan database The each task received is stored in database profession, and by task status labeled as untreated.It is issued receiving subsystem Task after, memory module first by task storage into database, the state of task is untreated.
Specifically, some subsystem issues task, another subsystem receives issuing for task, and every by what is received A task is all stored in the database of the subsystem.Optionally, the task can be outbound task, inbound task, prompt Message etc..
Processing thread is that just the sub thread of operation, this thread loops monitor the big of memory queue after a system starts It is small, if it find that when the size of i.e. memory queue is not zero, then being moved from the head of the queue of memory queue with the presence of task in memory queue Except task, and handle the task.In the task of processing, the processing thread executes business processing logic, this business processing Logic can be an external interface and call, and be also possible to send out short message etc..
After 302 processing task of processing module, implementing result is divided into two kinds of situations: a kind of situation is that task is handled successfully, different Task status is changed to processed (handling successfully) by normal writing module 303, and in more new database the task task shape Then state passes through the next task in processing thread process memory queue;Another situation is that task processing failure, writes extremely Enter the tail of the queue that abnormal memory queue is written in task by module 303.As it can be seen that either task is handled successfully or processing failure, place Lineation journey can all remove the task in memory queue, and Just because of this, method for scheduling task provided in an embodiment of the present invention is not The processing for influencing other tasks in memory queue, to improve the information exchange efficiency between task treatment effeciency and subsystem.
Optionally, described device further includes that exception processing module 303 also passes through abnormality processing thread from abnormal memory queue Middle removal task, and handle the task;Judge whether the task handles success, if so, by the task shape of the task State is changed to processed, and more new database;If it is not, the task to be then written to the tail of the queue of abnormal memory queue again.
Abnormality processing thread is equally that just the sub thread of operation, this thread monitor abnormal memory team after a system starts The size of column leads to task processing failure, abnormal memory team if exception has occurred during running processing module 302 Task is just had in column, i.e. when the size of memory queue is not zero, then removes task from the head of the queue of abnormal memory queue, execute industry Business processing logic.
When handling the task in abnormal memory queue, two kinds of situations can also occur: a kind of situation is that task is handled successfully, Task status is changed to processed (handling successfully), and in more new database the task task status, then by different The often next task in processing thread process exception memory queue;Another situation is that task processing failure, will appoint after failure The tail of the queue of abnormal memory queue is written in business again, receives execution next time, until task execution success.
Optionally, the exception processing module 303 also monitors the size of abnormal memory queue by abnormality processing thread, when When the size of abnormal memory queue is not zero, task is removed from abnormal memory queue, and handles the task, when abnormal memory When the size of queue is zero, the abnormality processing thread is closed.
According to various embodiments recited above, it can be seen that the present invention writes by using being stored into database for task Enter memory queue, the technological means of task is removed and handled from memory queue, thus solve the information interaction of system The problem of reliability and high efficiency.That is, the prior art is if system is died or system cut-off, data in EMS memory will It all disappears, and in case of exception, can be retried in current processing thread, task is caused to overstock, influence information friendship Mutual efficiency.And the present invention is by task storage into database, even service, which is cut off or is powered off, causes server to close Machine, although the task in memory queue is without the task in database also exists, and can scan number when system starting It is the tail of the queue that untreated task is automatically added to memory queue according to the task in library, while by task status, processing thread is still It so can handle the queue in memory queue, ensure that the reliability of the information interaction of subsystem in this way.Moreover, either Task is handled successfully or processing failure, and processing thread can all remove the task in memory queue, therefore not influence memory team The processing of other tasks in column, to improve the information exchange efficiency between task treatment effeciency and subsystem.
It should be noted that in the specific implementation content of task scheduling apparatus of the present invention, task tune described above It has been described in detail in degree method, therefore has no longer illustrated in this duplicate contents.
Fig. 4 is shown can be using the method for scheduling task of the embodiment of the present invention or the exemplary system of task scheduling apparatus Framework 400.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405. Network 404 between terminal device 401,402,403 and server 405 to provide the medium of communication link.Network 404 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 401,402,403 and be interacted by network 404 with server 405, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath --- merely illustrative) feed back to terminal device.
It should be noted that the terminal device of method for scheduling task provided by the embodiment of the present invention generally in public places 401, it executes on 402,403, can also be executed by server 405, correspondingly, the task scheduling apparatus is generally located on public On the terminal device 401,402,403 in place, also it can be set in server 405.
It should be understood that the number of terminal device, network and server in Fig. 4 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 509, and/or from can Medium 511 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 501, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include writing module, processing module and abnormal writing module, wherein the title of these modules is not constituted to this under certain conditions The restriction of module itself.
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: the task in scan database, is that memory queue is written in untreated task by task status;Pass through processing Thread removes task from memory queue, and handles the task;Judge whether the task handles success, if so, by institute The task status for stating task is changed to processed, and more new database;If it is not, abnormal memory queue then is written in the task.
Technical solution according to an embodiment of the present invention, because memory queue is written using being stored into database for task, The technological means of task is removed and handled from memory queue, thus overcome the information interaction of system reliability and efficiently Property the technical issues of, by task storage into database, even service, which is cut off or is powered off, causes server to shut down, memory Although the task in queue is without the task in database also exists, when system starting in meeting scan database Task, while being that untreated task is automatically added to the tail of the queue of memory queue by task status, processing thread still can be with The queue in memory queue is handled, ensures that the reliability of the information interaction of subsystem in this way.Moreover, either at task It manages successfully or processing failure, processing thread can all remove the task in memory queue, therefore not influence its in memory queue The processing of his task, to improve the information exchange efficiency between task treatment effeciency and subsystem.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (10)

1. a kind of method for scheduling task characterized by comprising
Task status is that memory queue is written in untreated task by the task in scan database;
Task is removed from memory queue by handling thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to processed, and updates number According to library;If it is not, abnormal memory queue then is written in the task.
2. the method according to claim 1, wherein further include:
Task is removed from abnormal memory queue by abnormality processing thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to processed, and updates number According to library;If it is not, the task to be then written to the tail of the queue of abnormal memory queue again.
3. according to the method described in claim 2, it is characterized by further comprising:
The size that abnormal memory queue is monitored by abnormality processing thread, when the size of abnormal memory queue is not zero, from different Task is removed in normal memory queue, and handles the task, when the size of abnormal memory queue is zero, closes the exception Lineation journey.
4. the method according to claim 1, wherein the method is also before task in scan database Include: that each task that will be received is stored in database profession, and by task status labeled as untreated.
5. a kind of task scheduling apparatus characterized by comprising
Task status is that memory queue is written in untreated task for the task in scan database by writing module;
Processing module for removing task from memory queue by handling thread, and handles the task;
Abnormal writing module, for judging whether the task handles success, if so, the task status of the task is changed To be processed, and more new database;If it is not, abnormal memory queue then is written in the task.
6. device according to claim 5, which is characterized in that further include exception processing module, be used for:
Task is removed from abnormal memory queue by abnormality processing thread, and handles the task;
Judge whether the task handles success, if so, the task status of the task is changed to processed, and updates number According to library;If it is not, the task to be then written to the tail of the queue of abnormal memory queue again.
7. device according to claim 6, which is characterized in that the exception processing module is also used to:
The size that abnormal memory queue is monitored by abnormality processing thread, when the size of abnormal memory queue is not zero, from different Task is removed in normal memory queue, and handles the task, when the size of abnormal memory queue is zero, closes the exception Lineation journey.
8. device according to claim 6, which is characterized in that further include memory module, be used for:
Before task in scan database, each task received is stored in database profession, and by task status Labeled as untreated.
9. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-4.
10. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1-4 is realized when row.
CN201810189463.5A 2018-03-08 2018-03-08 A kind of method for scheduling task and device Pending CN110245011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810189463.5A CN110245011A (en) 2018-03-08 2018-03-08 A kind of method for scheduling task and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810189463.5A CN110245011A (en) 2018-03-08 2018-03-08 A kind of method for scheduling task and device

Publications (1)

Publication Number Publication Date
CN110245011A true CN110245011A (en) 2019-09-17

Family

ID=67882452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810189463.5A Pending CN110245011A (en) 2018-03-08 2018-03-08 A kind of method for scheduling task and device

Country Status (1)

Country Link
CN (1) CN110245011A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955508A (en) * 2019-11-28 2020-04-03 广州鼎甲计算机科技有限公司 Asynchronous task scheduling method and device based on distributed architecture and computer equipment
CN111324783A (en) * 2020-03-18 2020-06-23 上海东普信息科技有限公司 Data processing method and device
CN111415725A (en) * 2020-03-05 2020-07-14 北京深睿博联科技有限责任公司 Scheduling method, system, terminal and storage medium applied to AI medical image diagnosis algorithm
CN111782996A (en) * 2020-05-29 2020-10-16 厦门市美亚柏科信息股份有限公司 Asynchronous request processing method and device
CN112181621A (en) * 2020-09-27 2021-01-05 中国建设银行股份有限公司 Task scheduling system, method, equipment and storage medium
CN112181701A (en) * 2020-09-23 2021-01-05 中国建设银行股份有限公司 Method and device for positioning abnormal service request
CN112667368A (en) * 2019-10-16 2021-04-16 北京京东乾石科技有限公司 Task data processing method and device
CN113064913A (en) * 2021-03-26 2021-07-02 北京深思数盾科技股份有限公司 Interactive statement processing method, electronic device and computer-readable storage medium
CN113703933A (en) * 2020-05-22 2021-11-26 北京沃东天骏信息技术有限公司 Task processing method and device
CN113886497A (en) * 2021-10-09 2022-01-04 北京房江湖科技有限公司 Bidirectional real-time data monitoring method and device
CN114153389A (en) * 2021-11-22 2022-03-08 浙江大华技术股份有限公司 Automatic abnormal zone supplementing method, device and equipment
CN115629890A (en) * 2022-10-27 2023-01-20 圣名科技(广州)有限责任公司 Sensor data acquisition method and device and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719079A (en) * 2009-12-17 2010-06-02 中国电力科学研究院 Method and device for processing tasks
RU2411574C2 (en) * 2009-01-29 2011-02-10 Александр Валерьевич Бухановский Intellectual grid-system for highly efficient data processing
CN102611642A (en) * 2012-02-27 2012-07-25 杭州闪亮科技有限公司 System for processing nonsynchronous message and method for system to send message and monitor processing task
CN102769781A (en) * 2012-07-17 2012-11-07 青岛海信传媒网络技术有限公司 Method and device for recommending television program
CN103686247A (en) * 2013-12-04 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and system for video distribution based on synchronization and asynchronization
CN103702135A (en) * 2013-12-17 2014-04-02 乐视网信息技术(北京)股份有限公司 Method and system for interaction of video distribution and medium resource system
CN104601696A (en) * 2015-01-13 2015-05-06 北京京东尚科信息技术有限公司 Service processing method and service invoking frame, device and architecture
CN105183549A (en) * 2015-08-27 2015-12-23 携程计算机技术(上海)有限公司 Automatic ticketing system based on task assignment
CN105843937A (en) * 2016-03-31 2016-08-10 北京奇虎科技有限公司 Data processing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2411574C2 (en) * 2009-01-29 2011-02-10 Александр Валерьевич Бухановский Intellectual grid-system for highly efficient data processing
CN101719079A (en) * 2009-12-17 2010-06-02 中国电力科学研究院 Method and device for processing tasks
CN102611642A (en) * 2012-02-27 2012-07-25 杭州闪亮科技有限公司 System for processing nonsynchronous message and method for system to send message and monitor processing task
CN102769781A (en) * 2012-07-17 2012-11-07 青岛海信传媒网络技术有限公司 Method and device for recommending television program
CN103686247A (en) * 2013-12-04 2014-03-26 乐视网信息技术(北京)股份有限公司 Method and system for video distribution based on synchronization and asynchronization
CN103702135A (en) * 2013-12-17 2014-04-02 乐视网信息技术(北京)股份有限公司 Method and system for interaction of video distribution and medium resource system
CN104601696A (en) * 2015-01-13 2015-05-06 北京京东尚科信息技术有限公司 Service processing method and service invoking frame, device and architecture
CN105183549A (en) * 2015-08-27 2015-12-23 携程计算机技术(上海)有限公司 Automatic ticketing system based on task assignment
CN105843937A (en) * 2016-03-31 2016-08-10 北京奇虎科技有限公司 Data processing method and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667368A (en) * 2019-10-16 2021-04-16 北京京东乾石科技有限公司 Task data processing method and device
CN110955508A (en) * 2019-11-28 2020-04-03 广州鼎甲计算机科技有限公司 Asynchronous task scheduling method and device based on distributed architecture and computer equipment
CN111415725A (en) * 2020-03-05 2020-07-14 北京深睿博联科技有限责任公司 Scheduling method, system, terminal and storage medium applied to AI medical image diagnosis algorithm
CN111415725B (en) * 2020-03-05 2023-09-26 北京深睿博联科技有限责任公司 Scheduling method, system, terminal and storage medium applied to AI medical image diagnosis algorithm
CN111324783A (en) * 2020-03-18 2020-06-23 上海东普信息科技有限公司 Data processing method and device
CN111324783B (en) * 2020-03-18 2023-08-29 上海东普信息科技有限公司 Data processing method and device
CN113703933A (en) * 2020-05-22 2021-11-26 北京沃东天骏信息技术有限公司 Task processing method and device
CN111782996A (en) * 2020-05-29 2020-10-16 厦门市美亚柏科信息股份有限公司 Asynchronous request processing method and device
CN112181701A (en) * 2020-09-23 2021-01-05 中国建设银行股份有限公司 Method and device for positioning abnormal service request
CN112181621A (en) * 2020-09-27 2021-01-05 中国建设银行股份有限公司 Task scheduling system, method, equipment and storage medium
CN113064913A (en) * 2021-03-26 2021-07-02 北京深思数盾科技股份有限公司 Interactive statement processing method, electronic device and computer-readable storage medium
CN113886497A (en) * 2021-10-09 2022-01-04 北京房江湖科技有限公司 Bidirectional real-time data monitoring method and device
CN114153389A (en) * 2021-11-22 2022-03-08 浙江大华技术股份有限公司 Automatic abnormal zone supplementing method, device and equipment
CN115629890A (en) * 2022-10-27 2023-01-20 圣名科技(广州)有限责任公司 Sensor data acquisition method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN110245011A (en) A kind of method for scheduling task and device
CN108920222A (en) A kind of method and device for business processing of rule-based engine
CN108897854A (en) A kind of monitoring method and device of overtime task
CN109308214A (en) Data task processing method and system
CN107844324A (en) Customer terminal webpage redirects treating method and apparatus
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN109257320A (en) Message storage method and device
CN108874513A (en) Handle method, system, electronic equipment and the computer-readable medium of timed task
CN110473036A (en) A kind of method and apparatus generating order number
CN110019258A (en) The method and apparatus for handling order data
CN110019087A (en) Data processing method and its system
CN109995801A (en) A kind of method for message transmission and device
CN110471848A (en) A kind of method and apparatus of dynamic returned packet
CN110019214A (en) The method and apparatus that data split result is verified
CN110019539A (en) A kind of method and apparatus that the data of data warehouse are synchronous
CN109960212A (en) Task sending method and device
CN109597810A (en) A kind of task cutting method, device, medium and electronic equipment
CN110445632A (en) A kind of method and apparatus for preventing client collapse
CN109814957A (en) A kind of label addition method and device for IOS system
CN109976919A (en) A kind of transmission method and device of message request
CN109218041A (en) Request processing method and device for server system
CN110389976A (en) A kind of dispatching method and device of multi-interface data
CN107526838A (en) The method and apparatus of data-base cluster dilatation
CN113706064A (en) Order processing method and device
CN109688174A (en) A kind of virtual service implementation method and device based on more agents service

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190917

RJ01 Rejection of invention patent application after publication