[go: up one dir, main page]

CN105117277A - Task cycle realization method and system - Google Patents

Task cycle realization method and system Download PDF

Info

Publication number
CN105117277A
CN105117277A CN201510529625.1A CN201510529625A CN105117277A CN 105117277 A CN105117277 A CN 105117277A CN 201510529625 A CN201510529625 A CN 201510529625A CN 105117277 A CN105117277 A CN 105117277A
Authority
CN
China
Prior art keywords
task
pool
duty cycle
tasks carrying
carrying program
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
CN201510529625.1A
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.)
Huayan Anti-Counterfeit Technology Co Ltd
Original Assignee
Huayan Anti-Counterfeit 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 Huayan Anti-Counterfeit Technology Co Ltd filed Critical Huayan Anti-Counterfeit Technology Co Ltd
Priority to CN201510529625.1A priority Critical patent/CN105117277A/en
Publication of CN105117277A publication Critical patent/CN105117277A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a task cycle realization method and system. The method comprises the following steps: starting a task execution program and checking whether a task to be processed exists in a task pool or not; when checking that no task to be processed exists in the task pool for three times, enabling the task execution process to enter a dormant state; when detecting that a task is added to the task pool, awakening the task execution program, obtaining the task from the task pool and executing the task until the task is completely executed. According to the task cycle realization method and system, the task execution program is enabled to enter the dormant state when monitoring that no task to be processed exists in the task pool for three times and awakened when a task is added to the task pool, so that the automation of the processing process is realized and the system resources are not consumed when in idle state.

Description

A kind of duty cycle implementation method and system
Technical field
The present invention relates to the duty cycle technical field of intelligent terminal, in particular a kind of duty cycle implementation method and system.
Background technology
Common batch tasks executive system workflow is: start-up routine, performs pending batch tasks, automatically terminate program.If when having new batch processing task to need to process again, restart program etc.Need artificial irregular start-up routine.
Have a kind of improvement project to be at present, after start-up routine, using timer to be confirmed whether at set intervals, new task is added comes in, but machine can be made so also to consume system resource not having the idle period of task.
Therefore, prior art has yet to be improved and developed.
Summary of the invention
In view of above-mentioned the deficiencies in the prior art, the object of the present invention is to provide a kind of duty cycle implementation method and system, be intended to solve batch tasks in prior art need artificial irregular start-up routine when performing and cause automaticity low, or whether have new task to add by timer timing inquiry and cause the defect also in consume system resources between terminal lay-up period.
Technical scheme of the present invention is as follows:
A kind of duty cycle implementation method, wherein, said method comprising the steps of:
A, initiating task executive routine, and check in task pool whether have waiting task;
B, when check continuously three times all without waiting task time, then tasks carrying program enters dormant state;
C, when the task of having detected is added into task pool, then wakes tasks carrying program up, and from task pool, obtain task and perform, until be finished.
Described duty cycle implementation method, wherein, also comprises:
D, when check in task pool have waiting task time, then from thread pool, obtain thread, juxtaposition checks that task pool be empty number of times is 0 time;
E, when waiting task is complete, then discharge thread, and return execution steps A.
Described duty cycle implementation method, wherein, wakes described tasks carrying program up by socket communication in described step C.
Described duty cycle implementation method, wherein, described tasks carrying program be arranged on be equipped with Windows, Linux, MacOS, UNIX or AIX operating system intelligent terminal on.
A kind of duty cycle realizes system, wherein, comprising:
Enquiry module, for initiating task executive routine, and checks in task pool whether have waiting task;
First control module, for when check continuously three times all without waiting task time, then tasks carrying program enters dormant state;
Task execution module, for when having detected that task is added into task pool, has then waken tasks carrying program up, and from task pool, has obtained task and perform, until be finished.
Described duty cycle realizes system, wherein, also comprises:
Second control module, for when check in task pool have waiting task time, then from thread pool, obtain thread, juxtaposition checks that task pool be empty number of times is 0 time;
3rd control module, for when waiting task is complete, then discharges thread, and starts enquiry module.
Described duty cycle realizes system, wherein, wakes described tasks carrying program up in described task execution module by socket communication.
Described duty cycle realizes system, wherein, described tasks carrying program be arranged on be equipped with Windows, Linux, MacOS, UNIX or AIX operating system intelligent terminal on.
A kind of duty cycle implementation method of the present invention and system, method comprises: initiating task executive routine, and checks in task pool whether have waiting task; When check continuously three times all without waiting task time, then tasks carrying program enters dormant state; When the task of having detected is added into task pool, then wake tasks carrying program up, and from task pool, obtain task and perform, until be finished.In the present invention when monitoring for continuous three times in task pool without waiting task, tasks carrying program is just made to enter dormant state, when being just again waken up during newly-increased task in task pool, not only achieve processing procedure robotization, and also not consume system resources time idle.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of duty cycle implementation method of the present invention preferred embodiment.
Fig. 2 is the structured flowchart that duty cycle of the present invention realizes system preferred embodiment.
Embodiment
The invention provides a kind of duty cycle implementation method and system, for making object of the present invention, technical scheme and effect clearly, clearly, the present invention is described in more detail below.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to Fig. 1, Fig. 1 is the process flow diagram of duty cycle implementation method of the present invention preferred embodiment.As shown in Figure 1, it comprises the following steps:
Step S100, initiating task executive routine, and check in task pool whether have waiting task.
In embodiments of the invention, tasks carrying program be mounted in be equipped with Windows, Linux, MacOS, UNIX or AIX operating system intelligent terminal on.When tasks carrying program starts, then check in task pool whether have waiting task, thus determine whether intelligent terminal enters dormant state, to reduce taking system resource.
Step S200, when check continuously three times all without waiting task time, then tasks carrying program enters dormant state.
When tasks carrying program is continuous to go in task pool inquiry for three times all without waiting task time, then illustrate that now nothing increases task newly in task pool.Take degree in order to reduce to system resource, then tasks carrying program enters dormant state.
Step S300, when the task of having detected is added into task pool, then wakes tasks carrying program up, and from task pool, obtain task and perform, until be finished.
In step S300, wake described tasks carrying program up by socket communication, as long as namely detected that task is added into task pool, then to be communicated the tasks carrying program waken up in intelligent terminal by socket immediately.
Further, described duty cycle implementation method, also comprises:
Step S400, when check in task pool have waiting task time, then from thread pool, obtain thread, juxtaposition checks that task pool be empty number of times is 0 time;
Step S500, when waiting task is complete, then discharge thread, and return and perform step S100.
In embodiments of the invention, as long as when tasks carrying program has taken out waiting task from task pool, then check that task pool is that empty cumulative number is cleared.Only having continuous task of checking for three times time to be sky just can make tasks carrying program enter dormant state, as long as but once inquire in task pool and tasks carrying program then can not be made to enter dormant state for sky, but keep running status, to guarantee that task has been performed always.
Based on said method embodiment, the present invention also provides a kind of duty cycle to realize system, and as shown in Figure 2, it comprises:
Enquiry module 100, for initiating task executive routine, and checks in task pool whether have waiting task;
First control module 200, for when check continuously three times all without waiting task time, then tasks carrying program enters dormant state;
Task execution module 300, for when having detected that task is added into task pool, has then waken tasks carrying program up, and from task pool, has obtained task and perform, until be finished.
Further, realize, in system, also comprising in described duty cycle:
Second control module, for when check in task pool have waiting task time, then from thread pool, obtain thread, juxtaposition checks that task pool be empty number of times is 0 time;
3rd control module, for when waiting task is complete, then discharges thread, and starts enquiry module.
Further, realize in system in described duty cycle, in described task execution module, wake described tasks carrying program up by socket communication.
Further, realize in system in described duty cycle, described tasks carrying program be arranged on be equipped with Windows, Linux, MacOS, UNIX or AIX operating system intelligent terminal on.
In sum, a kind of duty cycle implementation method of the present invention and system, method comprises: initiating task executive routine, and checks in task pool whether have waiting task; When check continuously three times all without waiting task time, then tasks carrying program enters dormant state; When the task of having detected is added into task pool, then wake tasks carrying program up, and from task pool, obtain task and perform, until be finished.In the present invention when monitoring for continuous three times in task pool without waiting task, tasks carrying program is just made to enter dormant state, when being just again waken up during newly-increased task in task pool, not only achieve processing procedure robotization, and also not consume system resources time idle.
Should be understood that, application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can be improved according to the above description or convert, and all these improve and convert the protection domain that all should belong to claims of the present invention.

Claims (8)

1. a duty cycle implementation method, is characterized in that, said method comprising the steps of:
A, initiating task executive routine, and check in task pool whether have waiting task;
B, when check continuously three times all without waiting task time, then tasks carrying program enters dormant state;
C, when the task of having detected is added into task pool, then wakes tasks carrying program up, and from task pool, obtain task and perform, until be finished.
2. duty cycle implementation method according to claim 1, is characterized in that, also comprise:
D, when check in task pool have waiting task time, then from thread pool, obtain thread, juxtaposition checks that task pool be empty number of times is 0 time;
E, when waiting task is complete, then discharge thread, and return execution steps A.
3. duty cycle implementation method according to claim 1, is characterized in that, wakes described tasks carrying program up in described step C by socket communication.
4. duty cycle implementation method according to claim 1, is characterized in that, described tasks carrying program be arranged on be equipped with Windows, Linux, MacOS, UNIX or AIX operating system intelligent terminal on.
5. duty cycle realizes a system, it is characterized in that, comprising:
Enquiry module, for initiating task executive routine, and checks in task pool whether have waiting task;
First control module, for when check continuously three times all without waiting task time, then tasks carrying program enters dormant state;
Task execution module, for when having detected that task is added into task pool, has then waken tasks carrying program up, and from task pool, has obtained task and perform, until be finished.
6. duty cycle realizes system according to claim 5, it is characterized in that, also comprises:
Second control module, for when check in task pool have waiting task time, then from thread pool, obtain thread, juxtaposition checks that task pool be empty number of times is 0 time;
3rd control module, for when waiting task is complete, then discharges thread, and starts enquiry module.
7. duty cycle realizes system according to claim 5, it is characterized in that, wakes described tasks carrying program up in described task execution module by socket communication.
8. duty cycle realizes system according to claim 5, it is characterized in that, described tasks carrying program be arranged on be equipped with Windows, Linux, MacOS, UNIX or AIX operating system intelligent terminal on.
CN201510529625.1A 2015-08-26 2015-08-26 Task cycle realization method and system Pending CN105117277A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510529625.1A CN105117277A (en) 2015-08-26 2015-08-26 Task cycle realization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510529625.1A CN105117277A (en) 2015-08-26 2015-08-26 Task cycle realization method and system

Publications (1)

Publication Number Publication Date
CN105117277A true CN105117277A (en) 2015-12-02

Family

ID=54665278

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510529625.1A Pending CN105117277A (en) 2015-08-26 2015-08-26 Task cycle realization method and system

Country Status (1)

Country Link
CN (1) CN105117277A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597753A (en) * 2018-10-22 2019-04-09 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of interface testing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122870A (en) * 2007-09-30 2008-02-13 金蝶软件(中国)有限公司 Thread wakening control systems and method
US20130073884A1 (en) * 2011-09-19 2013-03-21 Qualcomm Incorporated Dynamic sleep for multicore computing devices
CN103294528A (en) * 2012-03-01 2013-09-11 宇龙计算机通信科技(深圳)有限公司 Terminal and process control method
CN104753711A (en) * 2013-12-31 2015-07-01 华为技术有限公司 Method and device for adjusting resource allocation of network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122870A (en) * 2007-09-30 2008-02-13 金蝶软件(中国)有限公司 Thread wakening control systems and method
US20130073884A1 (en) * 2011-09-19 2013-03-21 Qualcomm Incorporated Dynamic sleep for multicore computing devices
CN103294528A (en) * 2012-03-01 2013-09-11 宇龙计算机通信科技(深圳)有限公司 Terminal and process control method
CN104753711A (en) * 2013-12-31 2015-07-01 华为技术有限公司 Method and device for adjusting resource allocation of network equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597753A (en) * 2018-10-22 2019-04-09 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of interface testing

Similar Documents

Publication Publication Date Title
US9970966B2 (en) Method, device and computer storage medium for detecting power consumption of an application
CN103200314B (en) A kind of intelligent dormancy method of mobile terminal and device
CN100489788C (en) Thread wakening control systems and method
CN103402027A (en) Mobile terminal and method for putting same into sleeping state
CN106020415B (en) Application control method and device under smart machine standby mode
CN109314923A (en) A kind of website awakening method, relevant device and system
CN105353864A (en) Static power consumption management method and system for electronic device
CN106255184B (en) A data transmission method and terminal equipment
CN103744503A (en) Method and system for prohibiting automatic running of applications after boot
CN104111850A (en) Method and system for reducing power consumption of MCU (Micro-Control Unit)
CN104267992A (en) Method and device for shielding wake-up program of mobile terminal
CN105095045A (en) Method and system for monitoring background service of Android system
CN103634663B (en) Set-top box standby method, set-top box standby control device and set top box
CN105264970A (en) Method, device and mobile terminal for reducing power consumption
CN105117277A (en) Task cycle realization method and system
CN111246549B (en) Method and device for providing node dormancy and wakeup time
CN104102503B (en) Computer capable of automatically booting at preset time and automatic booting method of computer at preset time
CN115640136A (en) Control method, main processor, cooperation processor and system of transformer substation system
Gebennini et al. Discrete time model of a two-station one-buffer serial system with inventory level-dependent operation
CN108566669A (en) A kind of method of terminal intelligent power saving, terminal and the device with store function
DE502007005793D1 (en) METHOD FOR PERFORMING ONLINE PROGRAM CHANGES IN AN AUTOMATION SYSTEM
CN105022665A (en) Control method for locking long-term unused app for Android and system of control method
CN104572019B (en) A kind of method and apparatus of inspection task
CN205223355U (en) Alkaline etching liquid water disposal recycle and regeneration device
CN201572608U (en) An Improved Double-box Reverse Osmosis Cleaning Device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20151202