WO2017107843A1 - 周期性任务的处理方法和装置及计算机程序和可读介质 - Google Patents

周期性任务的处理方法和装置及计算机程序和可读介质 Download PDF

Info

Publication number
WO2017107843A1
WO2017107843A1 PCT/CN2016/110141 CN2016110141W WO2017107843A1 WO 2017107843 A1 WO2017107843 A1 WO 2017107843A1 CN 2016110141 W CN2016110141 W CN 2016110141W WO 2017107843 A1 WO2017107843 A1 WO 2017107843A1
Authority
WO
WIPO (PCT)
Prior art keywords
executed
periodic task
periodic
preset
task
Prior art date
Application number
PCT/CN2016/110141
Other languages
English (en)
French (fr)
Inventor
杨德立
Original Assignee
北京奇虎科技有限公司
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 北京奇虎科技有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2017107843A1 publication Critical patent/WO2017107843A1/zh

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/466Transaction processing
    • 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

Definitions

  • the present invention relates to the field of information technology, and in particular, to a method and apparatus for processing periodic tasks, and a computer program and a readable medium.
  • Periodic tasks mainly refer to tasks that need to be performed after a certain interval.
  • the present invention provides a method and apparatus for processing periodic tasks, and a computer program and a readable medium, the main purpose of which is to reduce the development cost of new periodic tasks. Unified packaging and management of periodic tasks can be achieved.
  • a method for processing a periodic task comprising:
  • the preset list stores the identification information corresponding to the different periodic tasks to be executed and the cycle time corresponding to each periodic task to be executed;
  • the periodic task to be executed corresponding to the identifier information is acquired and executed.
  • a processing apparatus for a periodic task comprising:
  • An acquiring module configured to acquire, after receiving a new to-be-executed periodic task instruction, identifier information corresponding to the to-be-executed periodic task and a cycle time;
  • an adding module configured to add the identifier information acquired by the acquiring module and the cycle time to the preset list, where the preset list stores identifier information corresponding to different to-be-executed periodic tasks, and each to be executed The cycle time corresponding to the periodic task;
  • a detecting module configured to detect, according to the cycle time corresponding to each of the to-be-executed periodic tasks, whether the preset information corresponding to the to-be-executed periodic task outside the period exists in the preset list;
  • the acquiring module is further configured to: if the detecting module detects the identifier information corresponding to the to-be-executed periodic task that is in the preset list, obtain the to-be-executed periodic task corresponding to the identifier information ;
  • An execution module is configured to execute a periodic task to be executed corresponding to the identifier information.
  • a computer program comprising computer readable code causing the computing device to perform processing of the periodic task when the computer readable code is run on a computing device method.
  • a computer readable medium is provided, wherein Said computer program.
  • the technical solution provided by the embodiment of the present invention has at least the following advantages:
  • the method and device for processing a periodic task when receiving a new instruction to be executed, first obtain the identification information corresponding to the periodic task to be executed and a period of time; the identification information and the cycle time are added to the preset list, wherein the preset list stores identification information corresponding to different to-be-executed periodic tasks and corresponding to each periodic task to be executed. And determining, according to the cycle time corresponding to each of the to-be-executed periodic tasks, whether the identifier information corresponding to the to-be-executed periodic task outside the period exists in the preset list; if yes, acquiring The periodic task to be executed corresponding to the identification information is executed and executed.
  • the present invention adds the identification information of the newly added periodic task and the cycle time to the preset list, and uses the preset list to all the required cycles.
  • the tasks of the sexual execution are managed, and thus all the tasks that need to be performed periodically are encapsulated, and the unified management can be performed, which greatly reduces the development cost of the newly added periodic tasks to be executed.
  • the unified packaging and management of periodic tasks makes the periodic tasks easy to manage, the code is easy to read, and the probability of problems in related implementations is reduced.
  • the requirements for including periodic detection updates, periodic update configuration information, etc. can be easily added and managed.
  • FIG. 1 is a schematic flowchart of a method for processing a periodic task according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart diagram of another method for processing a periodic task according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a processing apparatus for a periodic task according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another apparatus for processing periodic tasks according to an embodiment of the present invention.
  • Figure 5 shows schematically a block diagram of a computing device for performing the method according to the invention
  • Fig. 6 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • An embodiment of the present invention provides a method for processing a periodic task. As shown in FIG. 1 , the method includes:
  • the identifier information corresponding to the periodic task to be executed and the cycle time are obtained.
  • the identifier information may be a name, an ID (Identity) number, and the like of the periodic task to be executed.
  • the preset information includes the identifier information corresponding to the different periodic tasks to be executed and the cycle time corresponding to each periodic task to be executed.
  • the preset list can be based on Configure the actual requirements.
  • the preset list there are three identification information corresponding to the periodic tasks to be executed, which are task a, task b, and task c.
  • the cycle time corresponding to task a is 10 seconds
  • the cycle time corresponding to task b is 1 hour.
  • the cycle time corresponding to task c is 2 hours, and the difference between the current time and the last successful execution time of the three pending periodic tasks is calculated respectively, and the obtained difference is 11 seconds, 10 minutes, and 2 hours, respectively. It can be determined that task a and task c are outside the cycle and task b is in the cycle.
  • the to-be-executed periodic task corresponding to the identifier information is acquired and executed.
  • the method for processing a periodic task when receiving a new instruction to be executed, first acquires the identification information corresponding to the periodic task to be executed and the cycle time; The identification information and the cycle time are added to the preset list, where the preset information stores the identification information corresponding to the different periodic tasks to be executed and the cycle time corresponding to each periodic task to be executed; And detecting, by the preset time period, the identifier information corresponding to the to-be-executed periodic task that is out of the period in the preset list; if yes, acquiring the to-be-executed period corresponding to the identifier information Sexual tasks and execution.
  • the present invention adds the identification information of the newly added periodic task and the cycle time to the preset list, and uses the preset list to all the required cycles.
  • the tasks of the sexual execution are managed, and thus all the tasks that need to be performed periodically are encapsulated, and the unified management can be performed, which greatly reduces the development cost of the newly added periodic tasks to be executed.
  • the unified packaging and management of periodic tasks makes the periodic tasks easy to manage, the code is easy to read, and the probability of problems in related implementations is reduced.
  • the requirements for including periodic detection updates, periodic update configuration information, etc. can be easily added and managed.
  • An embodiment of the present invention provides another method for processing a periodic task. As shown in FIG. 2, the method includes:
  • the period to be executed is acquired. Identification information corresponding to the sexual task and cycle time.
  • the identifier information may be a name, an ID number, and the like of the periodic task to be executed.
  • the step 201 may include: acquiring, by using a preset getTaskName interface function, identifier information corresponding to the to-be-executed periodic task, and acquiring, by using a preset getPeriodic interface function, the corresponding periodic task to be executed. period time.
  • the preset getTaskName interface function and the preset getPeriodic interface function can be configured according to actual requirements.
  • the preset information includes the identifier information corresponding to the different periodic tasks to be executed and the cycle time corresponding to each periodic task to be executed.
  • the preset list can be configured according to actual needs.
  • the method further includes: determining, by using a preset postDelayed interface function, whether the identifier information exists in the preset list; if not, executing the step 202.
  • the preset postDelayed interface function can be configured according to actual requirements. It should be noted that, by determining whether the identifier information exists in the preset list, the identifier information corresponding to the repeated periodic task to be executed may be saved in the preset list, thereby avoiding the same pending periodic task. Multiple tests can improve the efficiency of the test.
  • the step 204 may include: calculating a difference between the current time and a last successful execution time of each of the to-be-executed periodic tasks, to obtain each of the to-be-executed periodic tasks. Corresponding reference time.
  • the step 205 may specifically include: connecting by using a preset onPost
  • the mouth function detects whether there is identification information corresponding to the to-be-executed periodic task whose reference time is greater than or equal to the corresponding cycle time in the preset list.
  • the preset onPost interface function can be configured according to actual requirements.
  • the preset list there are three identification information corresponding to the periodic tasks to be executed, which are task 1, task 2, and task 3.
  • the cycle time corresponding to task 1 is 30 seconds
  • the cycle time corresponding to task 2 is 10 hours.
  • the cycle time corresponding to task c is 2 weeks, and the difference between the current time and the last successful execution time of the three pending periodic tasks is calculated respectively, and the obtained difference is 45 seconds, 30 minutes, and 1 week, respectively. It can be determined that task a is out of cycle and task b and task c are in a cycle.
  • the to-be-executed periodic task corresponding to the identifier information is acquired and executed.
  • the method may further include: detecting, according to the preset time interval corresponding to the periodic task to be executed, whether the preset task has a periodic task to be executed outside the cycle according to the preset time interval. Identification information.
  • the preset time interval may be configured by the actual needs of the user, or may be configured by default by the system, which is not limited in the embodiment of the present invention.
  • the preset time interval can be configured to be 0.1 s, 1 s, or the like.
  • the method may further include: performing all the to-be-executed periodic tasks in the preset list by using a preset postAllNow interface function; re-executing the to-be-executed periodic task by using a preset resume interface function; The periodic task to be executed is executed; the data is initialized by the preset start interface function. It should be noted that these preset interface functions can better control the execution of periodic tasks and facilitate management.
  • the method for processing a periodic task when receiving a new instruction to be executed, first acquires the identification information corresponding to the periodic task to be executed and the cycle time; The identification information and the cycle time are added to the preset list, where the preset information stores the identification information corresponding to the different periodic tasks to be executed and the cycle time corresponding to each periodic task to be executed; Determining, in the preset list, the identifier information corresponding to the to-be-executed periodic task that is out of the period; if yes, acquiring the identifier information corresponding to the identifier information The periodic task is to be executed and executed.
  • the present invention adds the identification information of the newly added periodic task and the cycle time to the preset list, and uses the preset list to all the required cycles.
  • the tasks of the sexual execution are managed, and thus all the tasks that need to be performed periodically are encapsulated, and the unified management can be performed, which greatly reduces the development cost of the newly added periodic tasks to be executed.
  • the unified packaging and management of periodic tasks makes the periodic tasks easy to manage, the code is easy to read, and the probability of problems in related implementations is reduced.
  • the requirements for including periodic detection updates, periodic update configuration information, etc. can be easily added and managed.
  • the embodiment of the present invention provides a processing device for a periodic task.
  • the device includes: an obtaining module 31, an adding module 32, and a detecting module 33.
  • Execution module 34 is a processing device for a periodic task.
  • the obtaining module 31 may be configured to acquire the identifier information corresponding to the to-be-executed periodic task and the cycle time when the new task to be executed is added.
  • the adding module 32 may be configured to add the identifier information acquired by the acquiring module 31 and the period of time to the preset list, where the preset list stores identifier information corresponding to different periodic tasks to be executed respectively. And the cycle time corresponding to each periodic task to be executed.
  • the detecting module 33 may be configured to detect, according to the cycle time corresponding to each of the to-be-executed periodic tasks, whether the preset information corresponding to the to-be-executed periodic task outside the period exists in the preset list.
  • the obtaining module 31 may be further configured to: if the detecting module 33 detects the identifier information corresponding to the to-be-executed periodic task that is in the preset list, obtain the to-be-executed corresponding to the identifier information. Periodic tasks.
  • the executing module 34 is configured to execute a periodic task to be executed corresponding to the identifier information.
  • the processing device of the periodic task provided by the embodiment of the present invention first acquires the identification letter corresponding to the periodic task to be executed when receiving a new instruction to be executed periodically. And the cycle time; the identification information and the cycle time are added to the preset list, wherein the preset list stores identification information corresponding to different to-be-executed periodic tasks and each periodic task to be executed Corresponding cycle time; finally, according to the cycle time corresponding to each of the to-be-executed periodic tasks, detecting whether there is identification information corresponding to the to-be-executed periodic task outside the period in the preset list; if yes, acquiring The periodic task to be executed corresponding to the identification information is executed.
  • the present invention adds the identification information of the newly added periodic task and the cycle time to the preset list, and uses the preset list to all the required cycles.
  • the tasks of the sexual execution are managed, and thus all the tasks that need to be performed periodically are encapsulated, and the unified management can be performed, which greatly reduces the development cost of the newly added periodic tasks to be executed.
  • the unified packaging and management of periodic tasks makes the periodic tasks easy to manage, the code is easy to read, and the probability of problems in related implementations is reduced.
  • the requirements for including periodic detection updates, periodic update configuration information, etc. can be easily added and managed.
  • the embodiment of the present invention provides another processing device for periodic tasks.
  • the device includes: an obtaining module 41, an adding module 42, and a detecting module. 43.
  • the obtaining module 41 may be configured to acquire the identifier information corresponding to the to-be-executed periodic task and the cycle time when the new periodic task to be executed is added.
  • the adding module 42 may be configured to add the identifier information acquired by the acquiring module 41 and the cycle time to the preset list, where the preset list stores identifier information corresponding to different periodic tasks to be executed respectively. And the cycle time corresponding to each periodic task to be executed.
  • the detecting module 43 may be configured to detect, according to the cycle time corresponding to each of the to-be-executed periodic tasks, whether the preset information corresponding to the to-be-executed periodic task outside the period exists in the preset list.
  • the obtaining module 41 may be further configured to: if the detecting module 43 detects the identifier information corresponding to the to-be-executed periodic task that is in the preset list, obtain the to-be-executed corresponding to the identifier information. Periodic tasks.
  • the executing module 44 may be configured to execute a periodic task to be executed corresponding to the identifier information.
  • the device further includes: a calculation module 45.
  • the obtaining module 41 is further configured to acquire a last successful execution time and a current time of each to-be-executed periodic task in the preset list.
  • the calculation module 45 may be configured to calculate a reference time corresponding to each periodic task to be executed according to the last successful execution time of each to-be-executed periodic task acquired by the obtaining module 41 and the current time.
  • the detecting module 43 is specifically configured to detect whether the identifier information corresponding to the to-be-executed periodic task whose reference time is greater than or equal to the corresponding period time exists in the preset list.
  • the calculation module 45 is specifically configured to calculate a difference between the current time and a last successful execution time of each of the to-be-executed periodic tasks, and obtain a reference time corresponding to each of the to-be-executed periodic tasks. .
  • the detecting module 43 is further configured to detect, according to the preset cycle time corresponding to each periodic task to be executed, whether the preset task in the preset list has a periodic task to be executed outside the period according to the preset time interval. Identification information.
  • the obtaining module 41 is specifically configured to obtain the identifier information corresponding to the to-be-executed periodic task by using a preset getTaskName interface function, and obtain a cycle time corresponding to the to-be-executed periodic task by using a preset getPeriodic interface function.
  • the detecting module 43 may be configured to: according to the cycle time corresponding to each of the to-be-executed periodic tasks, detect whether there is a periodic task to be executed outside the period in the preset list by using a preset onPost interface function. Identification information.
  • the device further includes: a determining module 46.
  • the determining module 46 may be configured to determine whether the identifier information exists in the preset list by using a preset postDelayed interface function.
  • the adding module 42 may be specifically configured to add the identifier information and the cycle time to the preset list if the determining module 46 determines that the identifier information does not exist in the preset list.
  • the processing device of the other periodic task when receiving a new instruction to be executed, periodically acquires the identification information corresponding to the periodic task to be executed and the cycle time;
  • the identification information and the cycle time are added to the preset list, where the preset information stores the identification information corresponding to the different periodic tasks to be executed and the cycle time corresponding to each periodic task to be executed; Determining, in the preset list, the identifier information corresponding to the to-be-executed periodic task that is out of the period; if yes, acquiring the to-be-executed corresponding to the identifier information Periodic tasks and execution.
  • the present invention adds the identification information of the newly added periodic task and the cycle time to the preset list, and uses the preset list to all the required cycles.
  • the tasks of the sexual execution are managed, and thus all the tasks that need to be performed periodically are encapsulated, and the unified management can be performed, which greatly reduces the development cost of the newly added periodic tasks to be executed.
  • the unified packaging and management of periodic tasks makes the periodic tasks easy to manage, the code is easy to read, and the probability of problems in related implementations is reduced.
  • the requirements for including periodic detection updates, periodic update configuration information, etc. can be easily added and managed.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of some or all of the processing methods and apparatus of periodic tasks in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 5 illustrates a computing device that can implement a method of processing a periodic task in accordance with the present invention.
  • the computing device conventionally includes a processor 510 and a computer program product or computer readable medium in the form of a memory 520.
  • the memory 520 can be, for example, a flash memory, an EEPROM (Electrically erasable programmable read only memory), electronic memory such as EPROM, hard disk or ROM.
  • Memory 520 has a memory space 530 for program code 531 for performing any of the method steps described above.
  • storage space 530 for program code may include various program code 531 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 520 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 531 ', ie, code readable by a processor, such as 510, that when executed by a computing device causes the computing device to perform each of the methods described above step.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.

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)
  • Stored Programmes (AREA)

Abstract

周期性任务的处理方法和装置及计算机程序和可读介质,涉及信息技术领域,可以减少对新增周期性任务的开发成本,可以实现将周期性任务统一封装和管理。所述方法包括:当接收到添加新的待执行周期性任务指令时,首先获取所述待执行周期性任务对应的标识信息以及周期时间;然后将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;最后根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;若存在,则获取与所述标识信息对应的待执行周期性任务并执行。

Description

周期性任务的处理方法和装置及计算机程序和可读介质
本申请要求在2015年12月21日提交中国专利局、申请号为201510967738.X、发明名称为“周期性任务的处理方法和装置及计算机程序和可读介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及一种信息技术领域,特别是涉及一种周期性任务的处理方法和装置及计算机程序和可读介质。
背景技术
随着信息技术的不断发展,周期性任务的需求越来越广泛。例如,对于浏览器而言,通常会有一些需要周期执行的请求。周期性任务主要是指需要在一定间隔后要执行的任务。针对有周期性需要的任务,通常需要保证控制线程一直存在,例如,无论是使用Scheduled Executor Service工具又或者使用timer+Handler工具实现周期任务都需要保证控制线程一直存在。对于如何能保证既不受限于线程是否存在,又能保证每次启动都能够进行周期性检测已经成为用户越来越关心的问题。
目前,对于需要周期性执行的任务,在一次任务执行后,记录成时间,下次再执行的时候判断是否在周期内,如果处于周期时间内则不执行,如果超过周期时间则执行。然而,上述方式在周期性任务需求较多的场景中,需要针对不同的需求分别封装处理,每当需要新增周期性任务时,会造成开发成本较高。
发明内容
有鉴于此,本发明提供了一种周期性任务的处理方法和装置及计算机程序和可读介质,主要目的在于可以减少对新增周期性任务的开发成本, 可以实现将周期性任务统一封装和管理。
依据本发明一个方面,提供了一种周期性任务的处理方法,该方法包括:
当接收到添加新的待执行周期性任务指令时,获取所述待执行周期性任务对应的标识信息以及周期时间;
将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;
根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;
若存在,则获取与所述标识信息对应的待执行周期性任务并执行。
依据本发明另一个方面,提供了一种周期性任务的处理装置,该装置包括:
获取模块,用于当接收到添加新的待执行周期性任务指令时,获取所述待执行周期性任务对应的标识信息以及周期时间;
添加模块,用于将所述获取模块获取的标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;
检测模块,用于根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;
所述获取模块,还用于若所述检测模块检测出所述预置列表中存在处于周期外的待执行周期性任务对应的标识信息,则获取与所述标识信息对应的待执行周期性任务;
执行模块,用于执行与所述标识信息对应的待执行周期性任务。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行所述的周期性任务的处理方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了 所述的计算机程序。
借由上述技术方案,本发明实施例提供的技术方案至少具有下列优点:
本发明提供的一种周期性任务的处理方法和装置及计算机程序和可读介质,当接收到添加新的待执行周期性任务指令时,首先获取所述待执行周期性任务对应的标识信息以及周期时间;然后将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;最后根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;若存在,则获取与所述标识信息对应的待执行周期性任务并执行。与目前针对不同的周期性任务需求需要分别处理的方式相比,本发明通过将新增的待执行周期性任务的标识信息以及周期时间添加到预置列表中,通过预置列表对所有需要周期性执行的任务进行管理,进而实现了封装所有需要周期性执行的任务,对其可以进行统一管理,大大减少了对新增的待执行周期性任务的开发成本。并且将周期性任务统一封装和管理更是让周期性任务便于管理,代码便于阅读,减少了相关实现出现问题的几率。对于包括周期性检测更新,周期性更新配置信息等需求可以方便的添加和管理。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了本发明实施例提供的一种周期性任务的处理方法流程示意图;
图2示出了本发明实施例提供的另一种周期性任务的处理方法流程示意图;
图3示出了本发明实施例提供的一种周期性任务的处理装置结构示意图;
图4示出了本发明实施例提供的另一种周期性任务的处理装置结构示意图;
图5示意性地示出了用于执行根据本发明的方法的计算设备的框图;
图6示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本发明实施例提供了一种周期性任务的处理方法,如图1所示,所述方法包括:
101、当接收到添加新的待执行周期性任务指令时,获取待执行周期性任务对应的标识信息以及周期时间。
其中,所述标识信息可以为待执行周期性任务的名称、ID(Identity,身份标识号码)号等。
102、将待执行周期性任务对应的标识信息以及周期时间添加到预置列表中。
其中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间。所述预置列表可以根据 实际需求进行配置。
103、根据每个待执行周期性任务对应的周期时间,检测预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
例如,预置列表中存在3个待执行周期性任务对应的标识信息,分别为任务a、任务b、任务c,任务a对应的周期时间为10秒,任务b对应的周期时间为1小时,任务c对应的周期时间为2小时,分别计算当前时间与这3个待执行周期性任务上一次执行成功执行时间之间的差值,得到的差值分别为11秒、10分钟、2小时,可以判定任务a和任务c处于周期外、而任务b处于周期内。
104、若检测出预置列表中存在处于周期外的待执行周期性任务对应的标识信息,则获取与标识信息对应的待执行周期性任务并执行。
本发明实施例提供的一种周期性任务的处理方法,当接收到添加新的待执行周期性任务指令时,首先获取所述待执行周期性任务对应的标识信息以及周期时间;然后将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;最后根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;若存在,则获取与所述标识信息对应的待执行周期性任务并执行。与目前针对不同的周期性任务需求需要分别处理的方式相比,本发明通过将新增的待执行周期性任务的标识信息以及周期时间添加到预置列表中,通过预置列表对所有需要周期性执行的任务进行管理,进而实现了封装所有需要周期性执行的任务,对其可以进行统一管理,大大减少了对新增的待执行周期性任务的开发成本。并且将周期性任务统一封装和管理更是让周期性任务便于管理,代码便于阅读,减少了相关实现出现问题的几率。对于包括周期性检测更新,周期性更新配置信息等需求可以方便的添加和管理。
本发明实施例提供了另一种周期性任务的处理方法,如图2所示,所述方法包括:
201、当接收到添加新的待执行周期性任务指令时,获取待执行周期 性任务对应的标识信息以及周期时间。
其中,所述标识信息可以为待执行周期性任务的名称、ID号等。
对于本发明实施例,所述步骤201具体可以包括:通过预置getTaskName接口函数获取所述待执行周期性任务对应的标识信息,以及通过预置getPeriodic接口函数获取所述待执行周期性任务对应的周期时间。其中,所述预置getTaskName接口函数以及所述预置getPeriodic接口函数可以根据实际需求进行配置。
202、将待执行周期性任务对应的标识信息以及周期时间添加到预置列表中。
其中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间。所述预置列表可以根据实际需求进行配置。
对于本发明实施例,所述步骤202之前,还可以包括:通过预置postDelayed接口函数,判断所述预置列表中是否存在所述标识信息;若不存在,则执行所述步骤202。其中,所述预置postDelayed接口函数可以根据实际需求进行配置。需要说明的是,通过判断所述预置列表中是否存在所述标识信息,可以避免将重复的待执行周期性任务对应的标识信息保存在预置列表中,进而避免对同一待执行周期性任务进行多次检测,可以提高检测的效率。
203、获取预置列表中每个待执行周期性任务上一次成功执行时间以及当前时间。
204、根据每个待执行周期性任务上一次成功执行时间以及当前时间,计算每个待执行周期性任务对应的参考时间。
对于本发明实施例,所述步骤204具体可以包括:计算所述当前时间与所述每个待执行周期性任务上一次成功执行时间之间的差值,得到所述每个待执行周期性任务对应的参考时间。
205、检测预置列表中是否存在参考时间大于或等于相对应周期时间的待执行周期性任务对应的标识信息。
对于本发明实施例,所述步骤205具体可以包括:通过预置onPost接 口函数,检测所述预置列表中是否存在参考时间大于或等于相对应周期时间的待执行周期性任务对应的标识信息。其中,所述预置onPost接口函数可以根据实际需求进行配置。
例如,预置列表中存在3个待执行周期性任务对应的标识信息,分别为任务1、任务2、任务3,任务1对应的周期时间为30秒,任务2对应的周期时间为10小时,任务c对应的周期时间为2周,分别计算当前时间与这3个待执行周期性任务上一次执行成功执行时间之间的差值,得到的差值分别为45秒、30分钟、1周,可以判定任务a处于周期外、而任务b和任务c处于周期内。
206、若检测出预置列表中存在参考时间大于或等于相对应周期时间的待执行周期性任务对应的标识信息,则获取与标识信息对应的待执行周期性任务并执行。
进一步地,所述方法还可以包括:根据所述每个待执行周期性任务对应的周期时间,按照预置时间间隔检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。其中,所述预置时间间隔可以用户的实际需求进行配置,也可以由系统默认进行配置,本发明实施例不做限定。例如,所述预置时间间隔可以配置为0.1s、1s等。
进一步地,所述方法还可以包括:通过预置postAllNow接口函数执行预置列表中所有的待执行周期性任务;通过预置resume接口函数重新执行待执行周期性任务;通过预置stop接口函数暂停执行待执行周期性任务;通过预置start接口函数初始化数据。需要说明的是,通过这些预置接口函数可以更好的控制周期性任务的执行,方便进行管理。
本发明实施例提供的另一种周期性任务的处理方法,当接收到添加新的待执行周期性任务指令时,首先获取所述待执行周期性任务对应的标识信息以及周期时间;然后将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;最后根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;若存在,则获取与所述标识信息对应的 待执行周期性任务并执行。与目前针对不同的周期性任务需求需要分别处理的方式相比,本发明通过将新增的待执行周期性任务的标识信息以及周期时间添加到预置列表中,通过预置列表对所有需要周期性执行的任务进行管理,进而实现了封装所有需要周期性执行的任务,对其可以进行统一管理,大大减少了对新增的待执行周期性任务的开发成本。并且将周期性任务统一封装和管理更是让周期性任务便于管理,代码便于阅读,减少了相关实现出现问题的几率。对于包括周期性检测更新,周期性更新配置信息等需求可以方便的添加和管理。
进一步地,作为图1所述方法的具体实现,本发明实施例提供了一种周期性任务的处理装置,如图3所示,所述装置包括:获取模块31、添加模块32、检测模块33、执行模块34。
所述获取模块31,可以用于当接收到添加新的待执行周期性任务指令时,获取所述待执行周期性任务对应的标识信息以及周期时间。
所述添加模块32,可以用于将所述获取模块31获取的标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间。
所述检测模块33,可以用于根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
所述获取模块31,还可以用于若所述检测模块33检测出所述预置列表中存在处于周期外的待执行周期性任务对应的标识信息,则获取与所述标识信息对应的待执行周期性任务。
所述执行模块34,可以用于执行与所述标识信息对应的待执行周期性任务。
需要说明的是,本发明实施例提供的一种周期性任务的处理装置所涉及各功能单元的其他相应描述,可以参考图1中的对应描述,在此不再赘述。
本发明实施例提供的一种周期性任务的处理装置,当接收到添加新的待执行周期性任务指令时,首先获取所述待执行周期性任务对应的标识信 息以及周期时间;然后将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;最后根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;若存在,则获取与所述标识信息对应的待执行周期性任务并执行。与目前针对不同的周期性任务需求需要分别处理的方式相比,本发明通过将新增的待执行周期性任务的标识信息以及周期时间添加到预置列表中,通过预置列表对所有需要周期性执行的任务进行管理,进而实现了封装所有需要周期性执行的任务,对其可以进行统一管理,大大减少了对新增的待执行周期性任务的开发成本。并且将周期性任务统一封装和管理更是让周期性任务便于管理,代码便于阅读,减少了相关实现出现问题的几率。对于包括周期性检测更新,周期性更新配置信息等需求可以方便的添加和管理。
进一步地,作为图2所述方法的具体实现,本发明实施例提供了另一种周期性任务的处理装置,如图4所示,所述装置包括:获取模块41、添加模块42、检测模块43、执行模块44。
所述获取模块41,可以用于当接收到添加新的待执行周期性任务指令时,获取所述待执行周期性任务对应的标识信息以及周期时间。
所述添加模块42,可以用于将所述获取模块41获取的标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间。
所述检测模块43,可以用于根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
所述获取模块41,还可以用于若所述检测模块43检测出所述预置列表中存在处于周期外的待执行周期性任务对应的标识信息,则获取与所述标识信息对应的待执行周期性任务。
所述执行模块44,可以用于执行与所述标识信息对应的待执行周期性任务。
进一步地,所述装置还包括:计算模块45。
所述获取模块41,还可以用于获取所述预置列表中每个待执行周期性任务上一次成功执行时间以及当前时间。
所述计算模块45,可以用于根据所述获取模块41获取的每个待执行周期性任务上一次成功执行时间以及所述当前时间,计算每个待执行周期性任务对应的参考时间。
所述检测模块43,具体可以用于检测所述预置列表中是否存在所述参考时间大于或等于相对应周期时间的待执行周期性任务对应的标识信息。
所述计算模块45,具体可以用于计算所述当前时间与所述每个待执行周期性任务上一次成功执行时间之间的差值,得到所述每个待执行周期性任务对应的参考时间。
所述检测模块43,还可以用于根据所述每个待执行周期性任务对应的周期时间,按照预置时间间隔检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
所述获取模块41,具体可以用于通过预置getTaskName接口函数获取所述待执行周期性任务对应的标识信息,以及通过预置getPeriodic接口函数获取所述待执行周期性任务对应的周期时间。
所述检测模块43,具体可以用于根据所述每个待执行周期性任务对应的周期时间,通过预置onPost接口函数检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
进一步地,所述装置还包括:判断模块46。
所述判断模块46,可以用于通过预置postDelayed接口函数,判断所述预置列表中是否存在所述标识信息。
所述添加模块42,具体可以用于若所述判断模块46判定所述预置列表中不存在所述标识信息,则将所述标识信息以及所述周期时间添加到预置列表中。
需要说明的是,本发明实施例提供的另一种周期性任务的处理装置所涉及各功能单元的其他相应描述,可以参考图2中的对应描述,在此不再赘述。
本发明实施例提供的另一种周期性任务的处理装置,当接收到添加新的待执行周期性任务指令时,首先获取所述待执行周期性任务对应的标识信息以及周期时间;然后将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;最后根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;若存在,则获取与所述标识信息对应的待执行周期性任务并执行。与目前针对不同的周期性任务需求需要分别处理的方式相比,本发明通过将新增的待执行周期性任务的标识信息以及周期时间添加到预置列表中,通过预置列表对所有需要周期性执行的任务进行管理,进而实现了封装所有需要周期性执行的任务,对其可以进行统一管理,大大减少了对新增的待执行周期性任务的开发成本。并且将周期性任务统一封装和管理更是让周期性任务便于管理,代码便于阅读,减少了相关实现出现问题的几率。对于包括周期性检测更新,周期性更新配置信息等需求可以方便的添加和管理。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的周期性任务的处理方法和装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图5示出了可以实现根据本发明的周期性任务的处理方法的计算设备。该计算设备传统上包括处理器510和以存储器520形式的计算机程序产品或者计算机可读介质。存储器520可以是诸如闪存、EEPROM (电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器520具有用于执行上述方法中的任何方法步骤的程序代码531的存储空间530。例如,用于程序代码的存储空间530可以包括分别用于实现上面的方法中的各种步骤的各个程序代码531。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图6所述的便携式或者固定存储单元。该存储单元可以具有与图5的计算设备中的存储器520类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码531’,即可以由例如诸如510之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
可以理解的是,上述方法及装置中的相关特征可以相互参考。另外,上述实施例中的“第一”、“第二”等是用于区分各实施例,而并不代表各实施例的优劣。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将 该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。

Claims (16)

  1. 一种周期性任务的处理方法,其特征在于,包括:
    当接收到添加新的待执行周期性任务指令时,获取所述待执行周期性任务对应的标识信息以及周期时间;
    将所述标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;
    根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;
    若存在,则获取与所述标识信息对应的待执行周期性任务并执行。
  2. 根据权利要求1所述的周期性任务的处理方法,其特征在于,所述根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息之前,所述方法还包括:
    获取所述预置列表中每个待执行周期性任务上一次成功执行时间以及当前时间;
    根据所述每个待执行周期性任务上一次成功执行时间以及所述当前时间,计算每个待执行周期性任务对应的参考时间;
    所述根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息包括:
    检测所述预置列表中是否存在所述参考时间大于或等于相对应周期时间的待执行周期性任务对应的标识信息。
  3. 根据权利要求2所述的周期性任务的处理方法,其特征在于,所述根据所述每个待执行周期性任务上一次成功执行时间以及所述当前时间,计算每个待执行周期性任务对应的参考时间包括:
    计算所述当前时间与所述每个待执行周期性任务上一次成功执行时间之间的差值,得到所述每个待执行周期性任务对应的参考时间。
  4. 根据权利要求1所述的周期性任务的处理方法,其特征在于,所 述方法还包括:
    根据所述每个待执行周期性任务对应的周期时间,按照预置时间间隔检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
  5. 根据权利要求1所述的周期性任务的处理方法,其特征在于,所述获取所述待执行周期性任务对应的标识信息以及周期时间包括:
    通过预置getTaskName接口函数获取所述待执行周期性任务对应的标识信息,以及通过预置getPeriodic接口函数获取所述待执行周期性任务对应的周期时间。
  6. 根据权利要求1所述的周期性任务的处理方法,其特征在于,所述根据所述每个待执行周期性任务对应的周期时间,检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息包括:
    根据所述每个待执行周期性任务对应的周期时间,通过预置onPost接口函数检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
  7. 根据权利要求1所述的周期性任务的处理方法,其特征在于,所述将所述标识信息以及所述周期时间添加到预置列表中之前,所述方法还包括:
    通过预置postDelayed接口函数,判断所述预置列表中是否存在所述标识信息;
    所述将所述标识信息以及所述周期时间添加到预置列表中包括:
    若不存在,则将所述标识信息以及所述周期时间添加到预置列表中。
  8. 一种周期性任务的处理装置,其特征在于,包括:
    获取模块,用于当接收到添加新的待执行周期性任务指令时,获取所述待执行周期性任务对应的标识信息以及周期时间;
    添加模块,用于将所述获取模块获取的标识信息以及所述周期时间添加到预置列表中,所述预置列表中保存有不同待执行周期性任务分别对应的标识信息以及每个待执行周期性任务对应的周期时间;
    检测模块,用于根据所述每个待执行周期性任务对应的周期时间,检 测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息;
    所述获取模块,还用于若所述检测模块检测出所述预置列表中存在处于周期外的待执行周期性任务对应的标识信息,则获取与所述标识信息对应的待执行周期性任务;
    执行模块,用于执行与所述标识信息对应的待执行周期性任务。
  9. 根据权利要求8所述的周期性任务的处理装置,其特征在于,所述装置还包括:计算模块;
    所述获取模块,还用于获取所述预置列表中每个待执行周期性任务上一次成功执行时间以及当前时间;
    所述计算模块,用于根据所述获取模块获取的每个待执行周期性任务上一次成功执行时间以及所述当前时间,计算每个待执行周期性任务对应的参考时间;
    所述检测模块,具体用于检测所述预置列表中是否存在所述参考时间大于或等于相对应周期时间的待执行周期性任务对应的标识信息。
  10. 根据权利要求9所述的周期性任务的处理装置,其特征在于,
    所述计算模块,具体用于计算所述当前时间与所述每个待执行周期性任务上一次成功执行时间之间的差值,得到所述每个待执行周期性任务对应的参考时间。
  11. 根据权利要求9所述的周期性任务的处理装置,
    所述检测模块,还用于根据所述每个待执行周期性任务对应的周期时间,按照预置时间间隔检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
  12. 根据权利要求9所述的周期性任务的处理装置,
    所述获取模块,具体用于通过预置getTaskName接口函数获取所述待执行周期性任务对应的标识信息,以及通过预置getPeriodic接口函数获取所述待执行周期性任务对应的周期时间。
  13. 根据权利要求9所述的周期性任务的处理装置,
    所述检测模块,具体用于根据所述每个待执行周期性任务对应的周期 时间,通过预置onPost接口函数检测所述预置列表中是否存在处于周期外的待执行周期性任务对应的标识信息。
  14. 根据权利要求9所述的周期性任务的处理装置,所述装置还包括:判断模块;
    所述判断模块,用于通过预置postDelayed接口函数,判断所述预置列表中是否存在所述标识信息;
    所述添加模块,具体用于若所述判断模块判定所述预置列表中不存在所述标识信息,则将所述标识信息以及所述周期时间添加到预置列表中。
  15. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-7中的任一个所述的周期性任务的处理方法。
  16. 一种计算机可读介质,其中存储了如权利要求15所述的计算机程序。
PCT/CN2016/110141 2015-12-21 2016-12-15 周期性任务的处理方法和装置及计算机程序和可读介质 WO2017107843A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510967738.XA CN105630585A (zh) 2015-12-21 2015-12-21 周期性任务的处理方法及装置
CN201510967738.X 2015-12-21

Publications (1)

Publication Number Publication Date
WO2017107843A1 true WO2017107843A1 (zh) 2017-06-29

Family

ID=56045564

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/110141 WO2017107843A1 (zh) 2015-12-21 2016-12-15 周期性任务的处理方法和装置及计算机程序和可读介质

Country Status (2)

Country Link
CN (1) CN105630585A (zh)
WO (1) WO2017107843A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597678A (zh) * 2018-10-09 2019-04-09 阿里巴巴集团控股有限公司 任务处理方法及装置
CN111008072A (zh) * 2019-12-25 2020-04-14 青梧桐有限责任公司 任务调度方法、装置、存储介质及电子设备
CN111353719A (zh) * 2020-03-11 2020-06-30 深圳市元征科技股份有限公司 一种诊断任务的执行方法、装置、设备及介质
CN111767128A (zh) * 2020-06-23 2020-10-13 北京字节跳动网络技术有限公司 执行定时任务的方法以及装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630585A (zh) * 2015-12-21 2016-06-01 北京奇虎科技有限公司 周期性任务的处理方法及装置
CN107545053B (zh) * 2017-08-24 2021-01-22 苏州浪潮智能科技有限公司 一种集群系统缓存查询方法及设备
CN114629817A (zh) * 2022-03-23 2022-06-14 天津国能津能滨海热电有限公司 报警装置的控制方法、装置及电子设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101615131A (zh) * 2008-06-27 2009-12-30 中国电信股份有限公司 定时任务信息的存储方法和装置以及定时任务的调度方法
CN102129393A (zh) * 2011-03-09 2011-07-20 南京恩瑞特实业有限公司 通用定时任务管理的实现方法
CN103530179A (zh) * 2013-09-30 2014-01-22 大唐移动通信设备有限公司 一种定时任务的处理方法及装置
CN103645909A (zh) * 2013-12-30 2014-03-19 中国烟草总公司湖南省公司 定时任务的处理方法及装置
CN104156265A (zh) * 2014-08-08 2014-11-19 乐得科技有限公司 定时任务的处理方法和处理装置
CN105138598A (zh) * 2015-08-05 2015-12-09 深圳联友科技有限公司 远程定时任务的方法及系统
CN105630585A (zh) * 2015-12-21 2016-06-01 北京奇虎科技有限公司 周期性任务的处理方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002342097A (ja) * 2001-05-17 2002-11-29 Matsushita Electric Ind Co Ltd タスク割当可能時間決定装置及びタスク割当可能時間決定方法
CN101901164B (zh) * 2009-05-27 2012-07-04 北京金山软件有限公司 时间计划调度模块和方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101615131A (zh) * 2008-06-27 2009-12-30 中国电信股份有限公司 定时任务信息的存储方法和装置以及定时任务的调度方法
CN102129393A (zh) * 2011-03-09 2011-07-20 南京恩瑞特实业有限公司 通用定时任务管理的实现方法
CN103530179A (zh) * 2013-09-30 2014-01-22 大唐移动通信设备有限公司 一种定时任务的处理方法及装置
CN103645909A (zh) * 2013-12-30 2014-03-19 中国烟草总公司湖南省公司 定时任务的处理方法及装置
CN104156265A (zh) * 2014-08-08 2014-11-19 乐得科技有限公司 定时任务的处理方法和处理装置
CN105138598A (zh) * 2015-08-05 2015-12-09 深圳联友科技有限公司 远程定时任务的方法及系统
CN105630585A (zh) * 2015-12-21 2016-06-01 北京奇虎科技有限公司 周期性任务的处理方法及装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597678A (zh) * 2018-10-09 2019-04-09 阿里巴巴集团控股有限公司 任务处理方法及装置
CN109597678B (zh) * 2018-10-09 2023-07-21 创新先进技术有限公司 任务处理方法及装置
CN111008072A (zh) * 2019-12-25 2020-04-14 青梧桐有限责任公司 任务调度方法、装置、存储介质及电子设备
CN111353719A (zh) * 2020-03-11 2020-06-30 深圳市元征科技股份有限公司 一种诊断任务的执行方法、装置、设备及介质
CN111767128A (zh) * 2020-06-23 2020-10-13 北京字节跳动网络技术有限公司 执行定时任务的方法以及装置

Also Published As

Publication number Publication date
CN105630585A (zh) 2016-06-01

Similar Documents

Publication Publication Date Title
WO2017107843A1 (zh) 周期性任务的处理方法和装置及计算机程序和可读介质
US10437578B2 (en) Orchestration of software applications upgrade using automatic hang detection
WO2019041824A1 (zh) 任务调度方法及服务器
JP2015508549A5 (ja) モバイル環境用のトロイの木馬化されたアプリケーション(アプリ)を特定するためのコンピュータ実装方法、非一時コンピュータ読み取り可能な媒体およびコンピュータシステム
US20150355959A1 (en) Dependency monitoring
US20120096205A1 (en) Inter-virtual machine profiling
US8140901B2 (en) Validation of processors using a self-generating test case framework
US20150278068A1 (en) Initialization trace of a computing device
WO2017045482A1 (zh) 父任务进度更新方法及装置
WO2017107654A1 (zh) 一种页面入口图标的显示方法及装置
US20130231912A1 (en) Method, system, and scheduler for simulating multiple processors in parallel
US20140365833A1 (en) Capturing trace information using annotated trace output
JP5832954B2 (ja) タグ付与装置及びタグ付与方法
CN110765288B (zh) 一种图像信息同步方法、装置、系统及存储介质
WO2017193795A1 (zh) 一种移动终端的数据传输方法和装置
WO2017107696A1 (zh) 带权重的文章标识方法和装置
CN113508381A (zh) 用于嵌入式软件应用的基于机器学习的异常检测
CN110245074B (zh) 一种日志记录的生成方法、装置、存储介质和服务器
US11188449B2 (en) Automated exception resolution during a software development session based on previous exception encounters
US11496567B2 (en) Data processing method, apparatus, device and storage medium based on unmanned vehicle
WO2015062494A1 (zh) Sdk实现文件上传、下载的方法与装置
CN109034668B (zh) Etl任务调度方法、装置、计算机设备及存储介质
WO2020232871A1 (zh) 一种微服务依赖分析方法及装置
KR20170093121A (ko) 컴퓨팅 디바이스에서의 동기화
JP2017068691A (ja) 診断プログラム、診断方法および診断装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16877654

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16877654

Country of ref document: EP

Kind code of ref document: A1