WO2021147382A1 - Test task execution method and device - Google Patents

Test task execution method and device Download PDF

Info

Publication number
WO2021147382A1
WO2021147382A1 PCT/CN2020/120885 CN2020120885W WO2021147382A1 WO 2021147382 A1 WO2021147382 A1 WO 2021147382A1 CN 2020120885 W CN2020120885 W CN 2020120885W WO 2021147382 A1 WO2021147382 A1 WO 2021147382A1
Authority
WO
WIPO (PCT)
Prior art keywords
execution
executed
detection
time
task
Prior art date
Application number
PCT/CN2020/120885
Other languages
French (fr)
Chinese (zh)
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 WO2021147382A1 publication Critical patent/WO2021147382A1/en

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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Definitions

  • determining the synchronous detection information and the asynchronous detection information in the detection task to be executed includes:
  • the asynchronous execution time between any detection task to be executed in the asynchronous execution relationship is determined according to the detection time of the detection task currently to be executed and the information of the asynchronous detection.
  • determining the basic time consumed by the execution of the detection task currently to be executed according to the judgment result and the related information of the detection task currently to be executed includes:
  • the execution end point of the currently to-be-executed detection task is the same as the execution start point of the next-to-be-executed detection task, then the execution safety point of the current to-be-executed detection task is ,
  • the execution start point determines the basic time consumed for execution.
  • the remaining detection tasks to be executed are sequentially inserted into the sorting queue according to a preset insertion manner, and the task execution queue is obtained after the insertion of the last detection task to be executed is completed.
  • this application obtains relevant information of multiple to-be-executed detection tasks, where the relevant information includes the execution safety point, the execution start point, the detection time, and the execution end point; determining the to-be-executed The information of synchronous detection and asynchronous detection in the detection task; the basic time consumed by the execution of each detection task to be executed is determined according to the related information of the detection task, the information of the synchronous detection and the information of the asynchronous detection, Synchronous execution time and asynchronous execution time; according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue. Therefore, the optimal execution sequence of the detection task can be dynamically calculated based on the starting and ending path of the detection and the time-consuming comparison of multiple stages, so as to achieve the minimum overall time-consuming, improve task execution efficiency and allocate resources more reasonably.

Landscapes

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

Abstract

The object of the present application is to provide a test task execution method and device. The present application comprises: acquiring relevant information about a plurality of test tasks to be executed, the relevant information comprising an execution safety point, an execution start point, a test time, and an execution end point; determining information about synchronous test and information about asynchronous test in said test tasks; determining, according to the relevant information about said test tasks, the information about synchronous test, and the information about asynchronous test, a basic time, a synchronous execution time and an asynchronous execution time consumed for executing each of said test tasks; and ordering all said test tasks according to the basic time, the synchronous execution time and the asynchronous execution time consumed for executing each of said test tasks, and putting said test tasks into a task execution queue. In this way, the optimal execution sequence of test tasks to be executed can be dynamically calculated on the basis of a start test path and an end test path and by comparing time consumption in a plurality of stages, so as to achieve the minimum global total time consumption.

Description

一种检测任务执行方法及设备Method and equipment for executing detection task 技术领域Technical field
本申请涉及设备检测领域,尤其涉及一种检测任务执行方法及设备。This application relates to the field of equipment detection, and in particular to a detection task execution method and equipment.
背景技术Background technique
在设备的检测过程中,也包含大量的检测任务需要执行,而任务的执行的顺序和需要消耗的时间影响着整个检测性能以及消耗的资源,在多任务执行时,容易出现机械移动路径重复、任务堆积,处理延时的情况,以及不能合理安排待执行任务的执行顺序,会导致资源调度效率较低,不能充分发挥检测设备的计算能力,造成系统的等待时间过长,检测过程耗时较长等问题。In the detection process of the equipment, there are also a large number of detection tasks that need to be executed. The order of task execution and the time it takes affect the overall detection performance and the resources consumed. In the execution of multitasking, it is easy to repeat the mechanical movement path, The accumulation of tasks, processing delays, and the inability to arrange the execution order of the tasks to be executed reasonably will result in low resource scheduling efficiency, inability to give full play to the computing power of the detection equipment, resulting in excessive waiting time of the system and long detection process Long wait for the question.
发明内容Summary of the invention
本申请的一个目的是提供一种检测任务执行方法及设备,解决现有技术中执行检测任务时全局耗时长、不能动态计算待执行任务的执行顺序的问题。One purpose of the present application is to provide a detection task execution method and device, which solves the problem that the execution sequence of the task to be executed cannot be dynamically calculated when the detection task is executed in the prior art.
根据本申请的一个方面,提供了一种检测任务执行方法,该方法包括:According to one aspect of the present application, there is provided a detection task execution method, which includes:
获取多个待执行的检测任务的相关信息,其中,所述相关信息包括执行安全点、执行开始点、检测时间、执行结束点;Acquiring related information of multiple to-be-executed detection tasks, where the related information includes an execution safety point, an execution start point, a detection time, and an execution end point;
确定所述待执行的检测任务中同步检测的信息以及异步检测的信息;Determine the synchronous detection information and the asynchronous detection information in the detection task to be executed;
根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间;Determine the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed according to the related information of the detection task, the synchronous detection information, and the asynchronous detection information;
根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中。According to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue.
进一步地,确定所述待执行的检测任务中同步检测的信息以及异步检 测的信息,包括:Further, determining the synchronous detection information and the asynchronous detection information in the detection task to be executed includes:
获取所有待执行的检测任务之间的执行关系,其中,所述执行关系包括同步执行关系和异步执行关系;Acquiring the execution relationship between all to-be-executed detection tasks, where the execution relationship includes a synchronous execution relationship and an asynchronous execution relationship;
根据所述执行关系确定同步检测的信息以及异步检测的信息,其中,所述同步检测的信息包括同步的检测任务以及该同步的检测任务的相关信息,所述异步检测的信息包括异步的检测任务以及异步的检测任务的相关信息。The synchronous detection information and the asynchronous detection information are determined according to the execution relationship, wherein the synchronous detection information includes a synchronous detection task and related information of the synchronous detection task, and the asynchronous detection information includes an asynchronous detection task As well as information about asynchronous detection tasks.
进一步地,根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间,包括:Further, determining the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed according to the related information of the detection task, the synchronous detection information, and the asynchronous detection information includes:
根据当前待执行的检测任务的相关信息及下一待执行的检测任务的相关信息判断所述当前待执行的检测任务的执行结束点是否与所述下一待执行的检测任务的执行开始点为同一点,得到判断结果;According to the related information of the detection task to be executed currently and the related information of the next detection task to be executed, it is determined whether the execution end point of the detection task to be executed currently is the same as the execution start point of the next detection task to be executed. At the same point, get the judgment result;
根据所述判断结果及所述当前待执行的检测任务的相关信息确定该当前待执行的检测任务的执行消耗的基本时间,重复上述判断过程,以确定每一待执行的检测任务的执行消耗的基本时间;Determine the basic time consumed by the execution of the detection task currently to be executed according to the judgment result and the related information of the detection task currently to be executed, and repeat the above judgment process to determine the execution consumption of each detection task to be executed Basic time
根据当前待执行的检测任务的检测时间及所述同步检测的信息确定与同步执行关系中任一待执行的检测任务之间的同步执行时间;Determining the synchronization execution time with any detection task to be executed in the synchronization execution relationship according to the detection time of the detection task currently to be executed and the synchronization detection information;
根据当前待执行的检测任务的检测时间及所述异步检测的信息确定与异步执行关系中任一待执行的检测任务之间的异步执行时间。The asynchronous execution time between any detection task to be executed in the asynchronous execution relationship is determined according to the detection time of the detection task currently to be executed and the information of the asynchronous detection.
进一步地,根据所述判断结果及所述当前待执行的检测任务的相关信息确定该当前待执行的检测任务的执行消耗的基本时间,包括:Further, determining the basic time consumed by the execution of the detection task currently to be executed according to the judgment result and the related information of the detection task currently to be executed includes:
若所述判断结果为所述当前待执行的检测任务的执行结束点与所述下一待执行的检测任务的执行开始点不相同,则根据所述当前待执行的检测任务的执行安全点、执行开始点确定执行消耗的第一基本时间;If the judgment result is that the execution end point of the currently to-be-executed detection task is different from the execution start point of the next-to-be-executed detection task, then according to the execution safety point of the current to-be-executed detection task, The execution start point determines the first basic time consumed for execution;
根据当前待执行的检测任务的执行结束点及下一待执行的检测任务 的执行安全点确定与剩余待执行的检测任务之间的执行消耗的第二基本时间。According to the execution end point of the detection task currently to be executed and the execution safety point of the next detection task to be executed, the second basic time consumed between execution and the remaining detection task to be executed is determined.
进一步地,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中,包括:Further, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue, including:
根据所述第一基本时间、所述第二基本时间、所述同步执行时间以及所述异步执行时间,将所有待执行的检测任务排列放入任务执行队列中。According to the first basic time, the second basic time, the synchronous execution time, and the asynchronous execution time, all to-be-executed detection tasks are arranged into a task execution queue.
进一步地,根据所述判断结果及所述当前待检测任务的相关信息确定该当前待执行的检测任务的基本时间,包括:Further, determining the basic time of the current to-be-detected task according to the judgment result and the relevant information of the current to-be-detected task includes:
若所述判断结果为所述当前待执行的检测任务的执行结束点与所述下一待执行的检测任务的执行开始点为同一点,则根据所述当前待执行的检测任务的执行安全点、执行开始点确定执行消耗的基本时间。If the judgment result is that the execution end point of the currently to-be-executed detection task is the same as the execution start point of the next-to-be-executed detection task, then the execution safety point of the current to-be-executed detection task is , The execution start point determines the basic time consumed for execution.
进一步地,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中,包括:Further, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue, including:
根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间及异步执行时间确定所述每一待执行的检测任务的总执行消耗时长;Determine the total execution consumption time of each detection task to be executed according to the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed;
根据所述每一待执行的检测任务的总执行消耗时长进行时长升序排列,排列后放入任务执行队列中。According to the total execution consumption time of each detection task to be executed, the time lengths are arranged in ascending order, and then they are placed in the task execution queue.
进一步地,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中,包括:Further, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue, including:
优先选取多个待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间对该多个待执行的检测任务进行排序,得到排序队列;Prioritize selection of the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of multiple to-be-executed detection tasks to sort the multiple to-be-executed detection tasks to obtain a sorted queue;
将剩余的待执行的检测任务按照预设的插入方式依次插入至所述排序队列中,待最后一个待执行的检测任务插入完成后,得到任务执行队列。The remaining detection tasks to be executed are sequentially inserted into the sorting queue according to a preset insertion manner, and the task execution queue is obtained after the insertion of the last detection task to be executed is completed.
进一步地,所述预设的插入方式包括:Further, the preset insertion manner includes:
将待插入的检测任务依次插入至排序队列中由已有的待执行的检测任务确定的插入位点,得到每一插入位点对应的新的排序队列;Insert the detection tasks to be inserted into the sorting queue in turn into the insertion sites determined by the existing detection tasks to be executed, and obtain a new sorting queue corresponding to each insertion site;
计算所述每一插入位点对应的新的排序队列中所有待执行的检测任务的累加的总执行消耗时长,其中,所述总执行消耗时长由所述待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间确定。Calculate the cumulative total execution time length of all the detection tasks to be executed in the new sorting queue corresponding to each insertion site, where the total execution time length is determined by the basic cost of the execution of the detection task to be executed. Time, synchronous execution time and asynchronous execution time are determined.
根据计算得到的所有的累加的总执行消耗时长选取出最短时长对应的新的排序队列,作为将待插入的检测任务插入至排序队列的插入结果。A new sorting queue corresponding to the shortest duration is selected according to all the accumulated total execution consumption time obtained by calculation, as the insertion result of inserting the detection task to be inserted into the sorting queue.
进一步地,所述方法还包括:Further, the method further includes:
根据当前的运算状态对所有待执行的检测任务进行分组;Group all the detection tasks to be executed according to the current operation status;
根据每一分组内的每一待执行的检测任务的异步执行时间确定该分组的执行消耗时长;Determine the execution consumption time of each group according to the asynchronous execution time of each detection task to be executed in each group;
根据每一分组的执行消耗时长对每一分组进行排序,按照排序后的顺序依次执行所有分组内的待执行的检测任务。Each group is sorted according to the execution consumption time of each group, and the to-be-executed detection tasks in all the groups are sequentially executed in the sorted order.
根据本申请又一个方面,还提供了一种检测任务执行的设备,该设备包括:According to another aspect of the present application, there is also provided a device for detecting task execution, and the device includes:
一个或多个处理器;以及One or more processors; and
存储有计算机可读指令的存储器,所述计算机可读指令在被执行时使所述处理器执行如前述所述方法的操作。A memory storing computer-readable instructions, which when executed, cause the processor to perform operations as described in the foregoing method.
根据本申请再一个方面,还提供了一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现如前述所述的方法。According to still another aspect of the present application, there is also provided a computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the aforementioned method.
与现有技术相比,本申请通过获取多个待执行的检测任务的相关信息,其中,所述相关信息包括执行安全点、执行开始点、检测时间、执行结束点;确定所述待执行的检测任务中同步检测的信息以及异步检测的信息;根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信 息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间;根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中。从而可以基于检测的起止路径、对比多个阶段的耗时动态计算出最优检测任务的执行顺序,以达到全局总耗时最少,提高任务执行效率以及可以更加合理地分配资源。Compared with the prior art, this application obtains relevant information of multiple to-be-executed detection tasks, where the relevant information includes the execution safety point, the execution start point, the detection time, and the execution end point; determining the to-be-executed The information of synchronous detection and asynchronous detection in the detection task; the basic time consumed by the execution of each detection task to be executed is determined according to the related information of the detection task, the information of the synchronous detection and the information of the asynchronous detection, Synchronous execution time and asynchronous execution time; according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue. Therefore, the optimal execution sequence of the detection task can be dynamically calculated based on the starting and ending path of the detection and the time-consuming comparison of multiple stages, so as to achieve the minimum overall time-consuming, improve task execution efficiency and allocate resources more reasonably.
附图说明Description of the drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes, and advantages of the present application will become more apparent:
图1示出根据本申请的一个方面提供的一种检测任务执行方法的流程示意图。Fig. 1 shows a schematic flowchart of a detection task execution method provided according to an aspect of the present application.
附图中相同或相似的附图标记代表相同或相似的部件。The same or similar reference signs in the drawings represent the same or similar components.
具体实施方式Detailed ways
下面结合附图对本申请作进一步详细描述。The application will be further described in detail below in conjunction with the accompanying drawings.
在本申请一个典型的配置中,终端、服务网络的设备和可信方均包括一个或多个处理器(例如中央处理器(Central Processing Unit,CPU))、输入/输出接口、网络接口和内存。In a typical configuration of this application, the terminal, the equipment of the service network, and the trusted party all include one or more processors (for example, a central processing unit (CPU)), input/output interfaces, network interfaces, and memory .
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(Random Access Memory,RAM)和/或非易失性内存等形式,如只读存储器(Read Only Memory,ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read only memory (ROM) or flash memory (Read Only Memory). flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相 变内存(Phase-Change RAM,PRAM)、静态随机存取存储器(Static Random Access Memory,SRAM)、动态随机存取存储器(Dynamic Random Access Memory,DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能光盘(Digital Versatile Disk,DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, Phase-Change RAM (PRAM), Static Random Access Memory (SRAM), and Dynamic Random Access Memory (DRAM) , Other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), flash memory or other memory technologies, only CD-ROM (Compact Disc Read-Only Memory), Digital Versatile Disk (DVD) or other optical storage, magnetic cassette tape, magnetic tape disk storage or other magnetic storage devices or any other Non-transmission media that can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
图1示出根据本申请的一个方面提供的一种检测任务执行方法的流程示意图,该方法包括:步骤S11~步骤S14,Fig. 1 shows a schematic flow chart of a detection task execution method provided according to an aspect of the present application. The method includes: step S11 to step S14,
在步骤S11中,获取多个待执行的检测任务的相关信息,其中,所述相关信息包括执行安全点、执行开始点、检测时间、执行结束点;在一检测的应用场景下,比如进行手机的检测,则检测任务可为手机摄像头的检测、安装应用程序的检测、解锁检测等。执行安全点是为防止终端设备与检测该终端设备的机器发生碰撞确定的安全范围的阈值点,在检测过程中,无论终端设备如何移动都不会碰撞到机器。为每一个待执行的检测任务设定执行安全点、执行开始点、执行过程以及执行结束点,将该检测任务从执行安全点移动到执行开始点进行检测,执行到结束点时完成整个检测过程,得到检测时间。当该检测任务完成后从执行结束点进入下一个待执行的检测任务的执行安全点。需要说明的是,执行安全点的设定可在配置检测终端设备的机器时设置,根据机器的轴控的旋转信息进行确定,而执行开始点是根据执行该检测任务时耗时情况比较好时进行设定的,比如设定为耗时在某值范围内认为是比较好,则该值可为执行开始点,执行开始点和执行结束点都可以进行调整。In step S11, obtain relevant information of a plurality of detection tasks to be executed, where the relevant information includes the execution safety point, the execution start point, the detection time, and the execution end point; in a detection application scenario, such as mobile phone The detection task can be the detection of the mobile phone camera, the detection of the installed application, and the unlocking detection. The execution safety point is a threshold point of the safety range determined to prevent the terminal device from colliding with the machine that detects the terminal device. During the detection process, no matter how the terminal device moves, it will not collide with the machine. Set the execution safety point, execution start point, execution process, and execution end point for each detection task to be executed, move the detection task from the execution safety point to the execution start point for detection, and complete the entire detection process when the execution reaches the end point , Get the detection time. When the detection task is completed, it will enter the execution safety point of the next detection task to be executed from the execution end point. It should be noted that the setting of the execution safety point can be set when the machine of the detection terminal device is configured, and it is determined according to the rotation information of the machine's axis control, and the execution start point is based on the time-consuming execution of the detection task. For setting, for example, it is better to set time-consuming within a certain value range, then the value can be the execution start point, and both the execution start point and the execution end point can be adjusted.
在步骤S12中,确定所述待执行的检测任务中同步检测的信息以及异步检测的信息;在此,确定所有待执行的检测任务的执行顺序时,选择执行时间最短的队列中的执行顺序,则需要确定从当前的检测任务执行到下一检测任务需要耗时多久,在所有的待执行的检测任务中存在可以同步执行的待执行的检测任务以及异步执行的待执行的检测任务,如待执行的检测任务为A,与它可同步执行的有待执行的检测任务B和C,与它进行异步执行的待执行的检测任务有D和E,则需要确定每一待执行的检测任务的可同步执行的检测任务的信息以及需要异步执行的检测任务的信息,即进行同步和异步的分类划分,确定同步检测的信息以及异步检测的信息。In step S12, the synchronous detection information and asynchronous detection information in the detection tasks to be executed are determined; here, when the execution order of all the detection tasks to be executed is determined, the execution order in the queue with the shortest execution time is selected, It is necessary to determine how long it takes from the execution of the current detection task to the next detection task. Among all the detection tasks to be executed, there are detection tasks to be executed that can be executed synchronously and detection tasks that are executed asynchronously, such as waiting The executed detection task is A, the to-be-executed detection tasks B and C that can be executed synchronously with it, and the to-be-executed detection tasks that are executed asynchronously with it are D and E. You need to determine the availability of each to-be-executed detection task. The information of the detection tasks that are executed synchronously and the information of the detection tasks that need to be executed asynchronously, that is, the classification of synchronization and asynchronous is performed, and the information of synchronous detection and the information of asynchronous detection are determined.
在步骤S13中,根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间;在此,检测任务的执行消耗的基本时间为该检测任务执行到下一检测任务过程中所需要的基础阶段耗时时间,不因其他检测任务的执行和是否同步执行或异步执行而改变,根据检测任务的相关信息中设定的时间点确定,如从执行安全点到执行开始点属于执行消耗的基本时间。通过检测任务的相关信息以及确定的每一待执行的检测任务对应的同步检测的信息以及异步检测的信息可计算出从一个待执行的检测任务到达下一个待执行的检测任务所需要消耗的同步执行时间和异步执行时间。In step S13, the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed are determined according to the related information of the detection task, the synchronous detection information, and the asynchronous detection information; Here, the basic time consumed by the execution of a detection task is the basic phase time required from the execution of the detection task to the next detection task. It does not change due to the execution of other detection tasks and whether they are executed synchronously or asynchronously. The time point set in the relevant information of the detection task is determined, such as the basic time consumed by the execution from the execution safety point to the execution start point. Through the related information of the detection task and the determined synchronous detection information corresponding to each to-be-executed detection task and the asynchronous detection information, it is possible to calculate the synchronization that needs to be consumed from one to-be-executed detection task to the next to-be-executed detection task. Execution time and asynchronous execution time.
随后,在步骤S14中,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中。在此,根据计算出的各个阶段所需的耗时,从而根据得到的耗时对所有待执行的检测任务进行排序,排序形成一有序队列,如按照时间长短排序,将耗时最短的排列在最前面,如检测任务A到检测任务B需要的耗时最短,到检测任务C次之,则排序为A→B→C;将所有的待执行的检测任务按照耗时排序后最终得到任务执行队列,按照该任务执行 队列执行其中的检测任务。该任务执行队列在检测过程中还可以根据待执行的检测任务的动态变化进行调整队列,比如其中的待执行的检测任务需要重试、或出现新的待执行的检测任务以及需要移除其中的某一或某些待执行的检测任务,达到根据当前的执行队列动态计算出最优任务执行顺序,以达到全局总耗时最少。Subsequently, in step S14, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue. Here, according to the calculated time required for each stage, all the inspection tasks to be executed are sorted according to the obtained time, and the sorting forms an ordered queue. If sorted according to the length of time, the shortest time-consuming order will be arranged. At the forefront, if the time required for detection task A to detection task B is the shortest, and detection task C is the second, then the order is A→B→C; sort all the inspection tasks to be executed according to the time-consuming order and finally get the task The execution queue, according to the task execution queue, executes the detection tasks in it. During the detection process, the task execution queue can also be adjusted according to the dynamic changes of the detection tasks to be executed. For example, the detection tasks to be executed need to be retried, or new detection tasks to be executed appear and the detection tasks need to be removed. For one or some of the detection tasks to be executed, the optimal task execution order can be dynamically calculated according to the current execution queue, so as to achieve the least overall time-consuming.
在本申请中,设定执行任务的执行安全点、执行开始点以及执行结束点从而确定了检测起止路径,基于检测起止路径确定机械移动耗时(执行消耗的基本时间)以及异步计算检测任务耗时,进而根据确定的所有耗时计算出最优检测任务执行顺序。In this application, the execution safety point, execution start point, and execution end point of the execution task are set to determine the detection start and end path. Based on the detection start and end path, the mechanical movement time (basic time consumed for execution) and asynchronous calculation of the detection task are determined. Then, the optimal detection task execution sequence is calculated according to all the determined time-consuming.
在本申请一实施例中,在步骤S12中,获取所有待执行的检测任务之间的执行关系,其中,所述执行关系包括同步执行关系和异步执行关系;根据所述执行关系确定同步检测的信息以及异步检测的信息,其中,所述同步检测的信息包括同步的检测任务以及该同步的检测任务的相关信息,所述异步检测的信息包括异步的检测任务以及异步的检测任务的相关信息。在此,每一待执行的检测任务存在与其进行同步执行和/或异步执行的其他待执行的检测任务,确定每个待执行的检测任务与其他待执行的检测任务之间的执行关系,为同步执行关系的有哪些检测任务,为异步执行关系的有哪些检测任务。根据确定的执行关系得到分类的信息,即得到为同步执行关系的同步检测的信息,例如,检测任务A的同步执行步骤为检测任务B、检测任务C,则同步检测的信息包括检测任务A、检测任务B和检测任务C本身,还包括检测任务A、检测任务B的相关信息和检测任务C的相关信息,即检测任务B和C的执行安全点、执行开始点、检测时间以及执行结束点这些信息;同样,异步检测的信息包括同为异步执行的检测任务本身以及异步执行的检测任务的相关信息。将每一个待执行的检测任务的执行关系都确定后并确定出对应的同步检测的信息和异步检测的信息,方便后续进行计算每个待执行的检测任务之间的执行的耗时情况。In an embodiment of the present application, in step S12, the execution relationship between all to-be-executed detection tasks is acquired, where the execution relationship includes a synchronous execution relationship and an asynchronous execution relationship; the synchronous detection is determined according to the execution relationship Information and asynchronous detection information, wherein the synchronous detection information includes synchronous detection tasks and related information about the synchronous detection tasks, and the asynchronous detection information includes asynchronous detection tasks and related information about asynchronous detection tasks. Here, each to-be-executed detection task has other to-be-executed detection tasks that are executed synchronously and/or asynchronously with it, and the execution relationship between each to-be-executed detection task and other to-be-executed detection tasks is determined as What are the detection tasks that execute the relationship synchronously, and what are the detection tasks that execute the relationship asynchronously. According to the determined execution relationship, the classified information is obtained, that is, the synchronization detection information for the synchronization execution relationship is obtained. For example, if the synchronization execution step of detection task A is detection task B and detection task C, the synchronization detection information includes detection task A, Detection task B and detection task C itself, also include detection task A, related information of detection task B and related information of detection task C, that is, the execution safety point, execution start point, detection time, and execution end point of detection tasks B and C This information; similarly, asynchronous detection information includes the detection task itself and the related information of the detection task that is executed asynchronously. The execution relationship of each detection task to be executed is determined, and the corresponding synchronous detection information and asynchronous detection information are determined, so as to facilitate the subsequent calculation of the execution time consumption between each detection task to be executed.
在本申请一实施例中,在步骤S13中,根据当前待执行的检测任务的相关信息及下一待执行的检测任务的相关信息判断所述当前待执行的检测任务的执行结束点是否与所述下一待执行的检测任务的执行开始点为同一点,得到判断结果;根据所述判断结果及所述当前待执行的检测任务的相关信息确定该当前待执行的检测任务的执行消耗的基本时间,重复上述判断过程,以确定每一待执行的检测任务的执行消耗的基本时间;根据当前待执行的检测任务的检测时间及所述同步检测的信息确定与同步执行关系中任一待执行的检测任务之间的同步执行时间;根据当前待执行的检测任务的检测时间及所述异步检测的信息确定与异步执行关系中任一待执行的检测任务之间的异步执行时间。在此,当前待执行的检测任务为当前需要计算的执行耗时时间的检测任务,如需要计算检测任务A到检测任务B的耗时,则检测任务A为当前待执行的检测任务,检测任务B为下一待执行的检测任务。根据检测任务A的相关信息和检测任务B的相关信息判断检测任务A的执行结束点是否与检测任务B的执行开始点为同一个,从而根据判断结果计算对应的检测任务A的执行消耗的基本时间。根据每个待执行的检测任务所需要的执行消耗的基本时间、同步执行时间以及异步执行时间确定每个待执行的检测任务之间的执行顺序,如先执行检测任务A再执行检测任务B需要耗时为T1,先执行检测任务B再执行检测任务A需要耗时为T2,若T1<T2,则可以确定执行顺序为先执行A再执行B。In an embodiment of the present application, in step S13, it is determined whether the execution end point of the current detection task to be executed is the same as the execution end point of the current detection task to be executed according to the related information of the detection task to be executed currently and the related information of the next detection task to be executed. The execution start point of the next detection task to be executed is the same point, and the judgment result is obtained; according to the judgment result and the relevant information of the detection task to be executed currently, the basic cost of execution of the detection task to be executed is determined Time, repeat the above judgment process to determine the basic time consumed by the execution of each detection task to be executed; according to the detection time of the detection task currently to be executed and the information of the synchronization detection, determine any one of the relationship to be executed in the synchronization execution relationship The synchronous execution time between the detection tasks of the detection task; the asynchronous execution time between any detection task to be executed in the asynchronous execution relationship is determined according to the detection time of the detection task currently to be executed and the information of the asynchronous detection. Here, the detection task currently to be executed is the detection task that needs to be calculated and is time-consuming to execute. If it is necessary to calculate the time from detection task A to detection task B, then detection task A is the current detection task to be executed. B is the next detection task to be executed. According to the related information of detection task A and related information of detection task B, it is judged whether the execution end point of detection task A and the execution start point of detection task B are the same, so as to calculate the corresponding execution consumption of detection task A according to the judgment result. time. According to the basic time, synchronous execution time and asynchronous execution time required for each detection task to be executed, the execution sequence of each detection task to be executed is determined. For example, it is necessary to execute detection task A first and then execute detection task B. The time-consuming is T1, and the time-consuming to execute detection task B first and then detection task A needs to be T2. If T1<T2, the execution order can be determined as executing A first and then executing B.
在本申请一实施例中,若所述判断结果为所述当前待执行的检测任务的执行结束点与所述下一待执行的检测任务的执行开始点不相同,则根据所述当前待执行的检测任务的执行安全点、执行开始点确定执行消耗的第一基本时间;根据当前待执行的检测任务的执行结束点及下一待执行的检测任务的执行安全点确定与剩余待执行的检测任务之间的执行消耗的第二基本时间。在此,以检测任务A到检测任务B为例,若检测任务A的 执行结束点与检测任务B的执行开始点不为同一点,则需要消耗掉从A的执行结束点到B的执行安全点的时间加上从B的执行安全点到B的执行开始点的时间,将该段消耗掉的时间作为先执行检测任务A再执行检测任务B的执行消耗的第二基本时间,原本的检测任务A的执行安全点到A的执行开始点作为执行消耗的第一基本时间。In an embodiment of the present application, if the judgment result is that the execution end point of the currently to-be-executed detection task is different from the execution start point of the next-to-be-executed detection task, then according to the current to-be-executed The execution safety point and the execution start point of the detection task determine the first basic time consumed for execution; the execution end point of the current detection task to be executed and the execution safety point of the next detection task to be executed are determined and the remaining detections to be executed The second basic time consumed by the execution between tasks. Here, taking detection task A to detection task B as an example, if the execution end point of detection task A and the execution start point of detection task B are not the same point, the execution safety from the execution end point of A to B is consumed. Point time plus the time from the execution safety point of B to the execution start point of B. This period of time is used as the second basic time consumed by the execution of detection task A and then execution of detection task B. The original detection The execution safety point of task A to the execution start point of task A is regarded as the first basic time consumed for execution.
接上述实施例,根据所述第一基本时间、所述第二基本时间、所述同步执行时间以及所述异步执行时间,将所有待执行的检测任务排列放入任务执行队列中。在此,当检测任务A的执行结束点与检测任务B的执行开始点不为同一点时,先执行检测任务A再执行检测任务B所需要消耗的总时间由上述确定的第一基本时间、第二基本时间、检测任务A、检测任务B对应的同步执行时间以及检测任务A和检测任务B对应的异步执行时间确定;根据每两个待执行的检测任务之间的先后执行得到的消耗时间将每一个待执行的检测任务进行排序,放入至任务执行队列中。Following the above embodiment, according to the first basic time, the second basic time, the synchronous execution time, and the asynchronous execution time, all to-be-executed detection tasks are arranged into the task execution queue. Here, when the execution end point of the detection task A and the execution start point of the detection task B are not the same point, the total time required to execute the detection task A and then the detection task B is determined by the first basic time, The second basic time, the synchronous execution time corresponding to the detection task A and the detection task B, and the asynchronous execution time corresponding to the detection task A and the detection task B are determined; the consumption time is obtained according to the sequential execution between each two detection tasks to be executed Sort each detection task to be executed and put it into the task execution queue.
在本申请又一实施例中,若所述判断结果为所述当前待执行的检测任务的执行结束点与所述下一待执行的检测任务的执行开始点为同一点,则根据所述当前待执行的检测任务的执行安全点、执行开始点确定执行消耗的基本时间。在此,以先执行检测任务A再执行检测任务B为例,当检测任务A的执行结束点与检测任务B的执行开始点为同一点时,则从检测任务A的执行结束点到检测任务B的执行安全点以及从检测任务B的执行安全点到检测任务B的执行开始点所需要的时间为0,此时,先执行A再执行B所需要的执行消耗的基本时间为检测任务A的执行安全点到检测任务A的执行开始点。In yet another embodiment of the present application, if the judgment result is that the execution end point of the currently to-be-executed detection task is the same as the execution start point of the next-to-be-executed detection task, then according to the current The execution safety point and execution start point of the detection task to be executed determine the basic time consumed for execution. Here, taking the detection task A first and then the detection task B as an example, when the execution end point of the detection task A and the execution start point of the detection task B are the same point, then from the execution end point of the detection task A to the detection task The execution safety point of B and the time required from the execution safety point of detection task B to the execution start point of detection task B is 0. At this time, the basic time consumed by the execution required to execute A and then execute B is detection task A The execution safety point to the execution start point of detection task A.
在本申请一实施例中,在步骤S14中,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间及异步执行时间确定所述每一待执行的检测任务的总执行消耗时长;根据所述每一待执行的检测任务的总执行消耗时长进行时长升序排列,排列后放入任务执行队列中。在此,通过对 比执行消耗的基本时间、同步执行时间以及异步执行时间动态计算出最优任务执行顺序,以达到全局总耗时最少。比如确定先执行检测任务A再执行检测任务B的总执行消耗时长,先执行检测任务A再执行检测任务C的总执行消耗时长,先执行检测任务B再执行检测任务C的总执行消耗时长等,根据各待执行的检测任务之间的执行顺序确定的总执行消耗时长对所有待执行的检测任务进行时长升序排列,即将总执行消耗时长最短的排在前面,总执行消耗时长最长的排在后面,排列完成后放入任务执行队列中,按照执行队列中的顺序执行所有待执行的检测任务。In an embodiment of the present application, in step S14, the total execution consumption time of each detection task to be executed is determined according to the basic time, synchronous execution time, and asynchronous execution time of each detection task to be executed. ; According to the total execution consumption time of each detection task to be executed, the time length is arranged in ascending order, and then placed in the task execution queue after the arrangement. Here, the optimal task execution order is dynamically calculated by comparing the basic time consumed by execution, synchronous execution time, and asynchronous execution time, so as to achieve the minimum overall time consumption. For example, determine the total execution consumption time of the detection task A and then the detection task B, the total execution consumption time of the detection task A and then the detection task C, the total execution consumption time of the detection task B and then the detection task C, etc. , According to the total execution consumption time determined by the execution order between the detection tasks to be executed, all the detection tasks to be executed are arranged in ascending order, that is, the row with the shortest total execution consumption time is ranked first, and the row with the longest total execution consumption time Later, after the arrangement is completed, it is placed in the task execution queue, and all the detection tasks to be executed are executed in the order in the execution queue.
在本申请一实施例中,在步骤S14中,进行确定待执行的检测任务的执行顺序时,还可以优先选取多个待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间对该多个待执行的检测任务进行排序,得到排序队列;将剩余的待执行的检测任务按照预设的插入方式依次插入至所述排序队列中,待最后一个待执行的检测任务插入完成后,得到任务执行队列。在此,采用预设的插入方式将所有待执行的检测任务进行排序,从而降低了时间复杂度,排序的过程变成了自由解法,从动态变成静态,进行深度搜索确定最终的排序队列。具体地,是先选取多个待执行的检测任务,按照它们的执行消耗的基本时间、同步执行时间以及异步执行时间对选出的这些待执行的检测任务进行排序,排序完成后形成队列,再逐一将其他的待执行的检测任务插入至当前队列中,按照预设的插入方式得到最优解的插入位置,从而确定新的排列顺序,得到新的待执行的检测任务插入至原有的执行队列中后的新的执行队列。In an embodiment of the present application, in step S14, when determining the execution sequence of the detection tasks to be executed, the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of multiple detection tasks to be executed may also be selected first. Sort the multiple to-be-executed detection tasks to obtain a sorted queue; insert the remaining to-be-executed detection tasks into the sorted queue in sequence according to a preset insertion method, and wait for the insertion of the last to-be-executed detection task to be completed , Get the task execution queue. Here, the preset insertion method is used to sort all the inspection tasks to be executed, thereby reducing the time complexity, the sorting process becomes a free solution method, from dynamic to static, and in-depth search is performed to determine the final sorting queue. Specifically, a plurality of detection tasks to be executed is selected first, and the selected detection tasks to be executed are sorted according to the basic time consumed by their execution, synchronous execution time, and asynchronous execution time. After the sorting is completed, a queue is formed, and then Insert other inspection tasks to be executed into the current queue one by one, and obtain the insertion position of the optimal solution according to the preset insertion method, so as to determine the new arrangement order, and obtain the new inspection task to be executed and insert it into the original execution The new execution queue after the queue.
具体地,所述预设的插入方式包括:将待插入的检测任务依次插入至排序队列中由已有的待执行的检测任务确定的插入位点,得到每一插入位点对应的新的排序队列;计算所述每一插入位点对应的新的排序队列中所有待执行的检测任务的累加的总执行消耗时长,其中,所述总执行消耗时长由所述待执行的检测任务的执行消耗的基本时间、同步执行时间和异步 执行时间确定。根据计算得到的所有的累加的总执行消耗时长选取出最短时长对应的新的排序队列,作为将待插入的检测任务插入至排序队列的插入结果。在此,插入位点为队列中的待执行的检测任务的前后位置处。假设已有待执行的检测任务(A1、A2、A3和A4)组成最优的排序队列,排序队列中的任务执行顺序依次为A1、A2、A3和A4,则将待执行的检测任务A5依次插入到的插入位点为A1前面、A1和A2之间、A2和A3之间、A3和A4之间以及A4之后,插入到每一位点后形成对应的新的执行队列,计算每一新的执行队列中包含的所有待执行的检测任务都执行完毕所需要的总执行消耗时长,最终比较所有总执行消耗时长,确定最短的总执行消耗时长对应的新的执行队列,比如A5插入至A1和A2之间形成的新的执行队列的总执行消耗时长最短,则执行顺序为A1、A5、A2、A3、A4,再按照上述插入方式依次插入剩余的待执行的检测任务,直至将所有的待执行的检测任务排好序,确定所有待执行的检测任务最终的执行顺序。Specifically, the preset insertion method includes: sequentially inserting the detection tasks to be inserted into the insertion sites determined by the existing detection tasks to be executed in the sorting queue, and obtaining a new sorting corresponding to each insertion site Queue; Calculate the cumulative total execution time length of all the detection tasks to be executed in the new sorting queue corresponding to each insertion site, wherein the total execution time length is consumed by the execution of the detection task to be executed The basic time, synchronous execution time and asynchronous execution time are determined. A new sorting queue corresponding to the shortest duration is selected according to all the accumulated total execution consumption time obtained by calculation, as the insertion result of inserting the detection task to be inserted into the sorting queue. Here, the insertion site is the position before and after the detection task to be executed in the queue. Assuming that the detection tasks to be executed (A1, A2, A3, and A4) form the optimal sorting queue, and the task execution order in the sorting queue is A1, A2, A3, and A4, then the to-be-executed detection task A5 is inserted in sequence The inserted positions are in front of A1, between A1 and A2, between A2 and A3, between A3 and A4, and after A4. After inserting into each position, a corresponding new execution queue is formed, and each new execution queue is calculated. The total execution consumption time required for all the detection tasks to be executed in the execution queue are executed. Finally, all the total execution consumption times are compared to determine the new execution queue corresponding to the shortest total execution consumption time, for example, A5 is inserted into A1 and The total execution time of the new execution queue formed between A2 is the shortest, and the execution sequence is A1, A5, A2, A3, A4, and then the remaining detection tasks to be executed are inserted in sequence according to the above insertion method, until all waiting The executed inspection tasks are arranged in order, and the final execution order of all the inspection tasks to be executed is determined.
在本申请一实施例中,所述方法还包括:根据当前的运算状态对所有待执行的检测任务进行分组;根据每一分组内的每一待执行的检测任务的异步执行时间确定该分组的执行消耗时长;根据每一分组的执行消耗时长对每一分组进行排序,按照排序后的顺序依次执行所有分组内的待执行的检测任务。在此,对所有的待执行的检测任务进行排执行顺序时,还可以按照异步执行时间的长短进行排序,按照当前的运算状态对已有的所有待执行的检测任务进行分组,如按照系统的最大的运算能力来分组,假如一次可以处理10个检测任务,则将每10个待执行的检测任务分为一组,确定每一分组中所有的待执行的检测任务的异步执行时间,进而确定该分组的执行消耗时长,其中,执行完该分组内所有的检测任务所需要的异步执行时间是多少为该分组的执行消耗时长,从而根据每一分组的执行消耗时长对所有分组进行排序,如排序顺序为N1组、N2组、N3组,则依次执行N1组内的待执行的检测任务后再执行N2组内的待执行的检测任务, 其中,每个分组内的所有待执行的检测任务的执行顺序可以根据各自的异步执行时间确定,或根据对应的执行消耗的基本时间、同步执行时间及异步执行时间中任几种组合确定;通过异步执行时间长短进行排序可以提升系统的运算效率。In an embodiment of the present application, the method further includes: grouping all the detection tasks to be executed according to the current operation status; and determining the grouping according to the asynchronous execution time of each detection task to be executed in each group Execution consumption time; each group is sorted according to the execution consumption time of each group, and the to-be-executed detection tasks in all the groups are executed in sequence in the sorted order. Here, when sorting the execution order of all the detection tasks to be executed, you can also sort according to the length of the asynchronous execution time, and group all the existing detection tasks to be executed according to the current operation state, such as according to the system The maximum computing power is grouped. If 10 detection tasks can be processed at a time, each 10 detection tasks to be executed are divided into a group, and the asynchronous execution time of all the detection tasks to be executed in each group is determined, and then the determination The execution consumption time of the group, where the asynchronous execution time required to execute all the detection tasks in the group is the execution consumption time of the group, so that all the groups are sorted according to the execution consumption time of each group, such as The sorting order is group N1, group N2, group N3, and then the to-be-executed detection tasks in the N1 group are executed in turn, and then the to-be-executed detection tasks in the N2 group are executed. Among them, all the to-be-executed detection tasks in each group The order of execution can be determined according to the respective asynchronous execution time, or according to any combination of the corresponding basic time consumed by execution, synchronous execution time and asynchronous execution time; sorting by the length of asynchronous execution time can improve the operating efficiency of the system.
需要说明的是,在步骤S14之后,当按照确定的任务执行队列执行其中的待执行的检测任务时,若每执行一个检测任务后,根据执行结果判断是不是需要重试,若是,则将该当前执行完成的检测任务重新放入任务执行队列中,再重新计算放入该当前执行完成的检测任务的任务执行队列中所有待执行的检测任务的执行顺序,从而确保当前的任务执行队列中的执行顺序为最优执行结果。It should be noted that after step S14, when the detection task to be executed is executed according to the determined task execution queue, if each detection task is executed, it is determined whether a retry is required according to the execution result, and if so, the The currently executed detection task is put into the task execution queue again, and the execution sequence of all pending detection tasks in the task execution queue of the currently executed detection task is recalculated to ensure that the current task execution queue The execution order is the optimal execution result.
此外,本申请实施例还提供了一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现前述一种检测任务执行方法。In addition, an embodiment of the present application also provides a computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the foregoing detection task execution method.
在本申请一实施例中,还提供了一种检测任务执行的设备,所述设备包括:In an embodiment of the present application, a device for detecting task execution is also provided, and the device includes:
一个或多个处理器;以及One or more processors; and
存储有计算机可读指令的存储器,所述计算机可读指令在被执行时使所述处理器执行如前述所述方法的操作。A memory storing computer-readable instructions, which when executed, cause the processor to perform operations as described in the foregoing method.
例如,计算机可读指令在被执行时使所述一个或多个处理器:For example, computer-readable instructions, when executed, cause the one or more processors:
获取多个待执行的检测任务的相关信息,其中,所述相关信息包括执行安全点、执行开始点、检测时间、执行结束点;Acquiring related information of multiple to-be-executed detection tasks, where the related information includes an execution safety point, an execution start point, a detection time, and an execution end point;
确定所述待执行的检测任务中同步检测的信息以及异步检测的信息;Determine the synchronous detection information and the asynchronous detection information in the detection task to be executed;
根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间;Determine the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed according to the related information of the detection task, the synchronous detection information, and the asynchronous detection information;
根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和 异步执行时间将所有待执行的检测任务排列放入任务执行队列中。According to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, then this application is also intended to include these modifications and variations.
需要注意的是,本申请可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本申请的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本申请的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本申请的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。It should be noted that this application can be implemented in software and/or a combination of software and hardware. For example, it can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In an embodiment, the software program of the present application may be executed by a processor to realize the steps or functions described above. Likewise, the software program (including related data structures) of the present application can be stored in a computer-readable recording medium, for example, RAM memory, magnetic or optical drives or floppy disks and similar devices. In addition, some steps or functions of the present application may be implemented by hardware, for example, as a circuit that cooperates with a processor to execute each step or function.
另外,本申请的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本申请的方法和/或技术方案。而调用本申请的方法的程序指令,可能被存储在固定的或可移动的记录介质中,和/或通过广播或其他信号承载媒体中的数据流而被传输,和/或被存储在根据所述程序指令运行的计算机设备的工作存储器中。在此,根据本申请的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本申请的多个实施例的方法和/或技术方案。In addition, a part of this application can be applied as a computer program product, such as a computer program instruction, when it is executed by a computer, through the operation of the computer, the method and/or technical solution according to this application can be invoked or provided. The program instructions for calling the method of the present application may be stored in a fixed or removable recording medium, and/or be transmitted through a data stream in a broadcast or other signal-bearing medium, and/or be stored in accordance with the Said program instructions run in the working memory of the computer equipment. Here, an embodiment according to the present application includes a device that includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device triggers The operation of the device is based on the aforementioned methods and/or technical solutions according to multiple embodiments of the present application.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括 在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any reference signs in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Words such as first and second are used to denote names, but do not denote any specific order.

Claims (12)

  1. 一种检测任务执行方法,其特征在于,所述方法包括:A detection task execution method, characterized in that the method includes:
    获取多个待执行的检测任务的相关信息,其中,所述相关信息包括执行安全点、执行开始点、检测时间、执行结束点;Acquiring related information of multiple to-be-executed detection tasks, where the related information includes an execution safety point, an execution start point, a detection time, and an execution end point;
    确定所述待执行的检测任务中同步检测的信息以及异步检测的信息;Determine the synchronous detection information and the asynchronous detection information in the detection task to be executed;
    根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间;Determine the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed according to the related information of the detection task, the synchronous detection information, and the asynchronous detection information;
    根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中。According to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue.
  2. 根据权利要求1所述的方法,其特征在于,确定所述待执行的检测任务中同步检测的信息以及异步检测的信息,包括:The method according to claim 1, wherein determining the synchronous detection information and the asynchronous detection information in the detection task to be executed comprises:
    获取所有待执行的检测任务之间的执行关系,其中,所述执行关系包括同步执行关系和异步执行关系;Acquiring the execution relationship between all to-be-executed detection tasks, where the execution relationship includes a synchronous execution relationship and an asynchronous execution relationship;
    根据所述执行关系确定同步检测的信息以及异步检测的信息,其中,所述同步检测的信息包括同步的检测任务以及该同步的检测任务的相关信息,所述异步检测的信息包括异步的检测任务以及异步的检测任务的相关信息。The synchronous detection information and the asynchronous detection information are determined according to the execution relationship, wherein the synchronous detection information includes a synchronous detection task and related information of the synchronous detection task, and the asynchronous detection information includes an asynchronous detection task As well as information about asynchronous detection tasks.
  3. 根据权利要求2所述的方法,其特征在于,根据所述检测任务的相关信息、所述同步检测的信息及所述异步检测的信息确定每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间,包括:The method according to claim 2, characterized in that the basic time consumed by the execution of each detection task to be executed is determined according to the related information of the detection task, the information of the synchronous detection and the information of the asynchronous detection, Synchronous execution time and asynchronous execution time, including:
    根据当前待执行的检测任务的相关信息及下一待执行的检测任务的相关信息判断所述当前待执行的检测任务的执行结束点是否与所述下一 待执行的检测任务的执行开始点为同一点,得到判断结果;According to the related information of the detection task to be executed currently and the related information of the next detection task to be executed, it is determined whether the execution end point of the detection task to be executed currently is the same as the execution start point of the next detection task to be executed. At the same point, get the judgment result;
    根据所述判断结果及所述当前待执行的检测任务的相关信息确定该当前待执行的检测任务的执行消耗的基本时间,重复上述判断过程,以确定每一待执行的检测任务的执行消耗的基本时间;Determine the basic time consumed by the execution of the detection task currently to be executed according to the judgment result and the related information of the detection task currently to be executed, and repeat the above judgment process to determine the execution consumption of each detection task to be executed Basic time
    根据当前待执行的检测任务的检测时间及所述同步检测的信息确定与同步执行关系中任一待执行的检测任务之间的同步执行时间;Determining the synchronization execution time with any detection task to be executed in the synchronization execution relationship according to the detection time of the detection task currently to be executed and the synchronization detection information;
    根据当前待执行的检测任务的检测时间及所述异步检测的信息确定与异步执行关系中任一待执行的检测任务之间的异步执行时间。The asynchronous execution time between any detection task to be executed in the asynchronous execution relationship is determined according to the detection time of the detection task currently to be executed and the information of the asynchronous detection.
  4. 根据权利要求3所述的方法,其特征在于,根据所述判断结果及所述当前待执行的检测任务的相关信息确定该当前待执行的检测任务的执行消耗的基本时间,包括:The method according to claim 3, wherein determining the basic time consumed by the execution of the detection task currently to be executed according to the judgment result and the related information of the detection task currently to be executed comprises:
    若所述判断结果为所述当前待执行的检测任务的执行结束点与所述下一待执行的检测任务的执行开始点不相同,则根据所述当前待执行的检测任务的执行安全点、执行开始点确定执行消耗的第一基本时间;If the judgment result is that the execution end point of the currently to-be-executed detection task is different from the execution start point of the next-to-be-executed detection task, then according to the execution safety point of the current to-be-executed detection task, The execution start point determines the first basic time consumed for execution;
    根据当前待执行的检测任务的执行结束点及下一待执行的检测任务的执行安全点确定与剩余待执行的检测任务之间的执行消耗的第二基本时间。According to the execution end point of the detection task currently to be executed and the execution safety point of the next detection task to be executed, the second basic time consumed between execution and the remaining detection task to be executed is determined.
  5. 根据权利要求4所述的方法,其特征在于,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中,包括:The method according to claim 4, characterized in that, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue, include:
    根据所述第一基本时间、所述第二基本时间、所述同步执行时间以及所述异步执行时间,将所有待执行的检测任务排列放入任务执行队列中。According to the first basic time, the second basic time, the synchronous execution time, and the asynchronous execution time, all to-be-executed detection tasks are arranged into a task execution queue.
  6. 根据权利要求3所述的方法,其特征在于,根据所述判断结果及所述当前待检测任务的相关信息确定该当前待执行的检测任务的基本时间,包括:The method according to claim 3, wherein determining the basic time of the currently to-be-detected task according to the judgment result and the related information of the current to-be-detected task comprises:
    若所述判断结果为所述当前待执行的检测任务的执行结束点与所述下一待执行的检测任务的执行开始点为同一点,则根据所述当前待执行的检测任务的执行安全点、执行开始点确定执行消耗的基本时间。If the judgment result is that the execution end point of the currently to-be-executed detection task is the same as the execution start point of the next-to-be-executed detection task, then the execution safety point of the current to-be-executed detection task is , The execution start point determines the basic time consumed for execution.
  7. 根据权利要求1所述的方法,其特征在于,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中,包括:The method according to claim 1, characterized in that, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue, include:
    根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间及异步执行时间确定所述每一待执行的检测任务的总执行消耗时长;Determine the total execution consumption time of each detection task to be executed according to the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of each detection task to be executed;
    根据所述每一待执行的检测任务的总执行消耗时长进行时长升序排列,排列后放入任务执行队列中。According to the total execution consumption time of each detection task to be executed, the time lengths are arranged in ascending order, and then they are placed in the task execution queue.
  8. 根据权利要求1所述的方法,其特征在于,根据每一待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间将所有待执行的检测任务排列放入任务执行队列中,包括:The method according to claim 1, characterized in that, according to the basic time, synchronous execution time and asynchronous execution time consumed by the execution of each detection task to be executed, all the detection tasks to be executed are arranged into the task execution queue, include:
    优先选取多个待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间对该多个待执行的检测任务进行排序,得到排序队列;Prioritize selection of the basic time, synchronous execution time, and asynchronous execution time consumed by the execution of multiple to-be-executed detection tasks to sort the multiple to-be-executed detection tasks to obtain a sorted queue;
    将剩余的待执行的检测任务按照预设的插入方式依次插入至所述排序队列中,待最后一个待执行的检测任务插入完成后,得到任务执行队列。The remaining detection tasks to be executed are sequentially inserted into the sorting queue according to a preset insertion manner, and the task execution queue is obtained after the insertion of the last detection task to be executed is completed.
  9. 根据权利要求8所述的方法,其特征在于,所述预设的插入方式包括:The method according to claim 8, wherein the preset insertion manner comprises:
    将待插入的检测任务依次插入至排序队列中由已有的待执行的检测任务确定的插入位点,得到每一插入位点对应的新的排序队列;Insert the detection tasks to be inserted into the sorting queue in turn into the insertion sites determined by the existing detection tasks to be executed, and obtain a new sorting queue corresponding to each insertion site;
    计算所述每一插入位点对应的新的排序队列中所有待执行的检测任务的累加的总执行消耗时长,其中,所述总执行消耗时长由所述待执行的检测任务的执行消耗的基本时间、同步执行时间和异步执行时间确定。Calculate the cumulative total execution time length of all the detection tasks to be executed in the new sorting queue corresponding to each insertion site, where the total execution time length is determined by the basic amount consumed by the execution of the detection task to be executed. Time, synchronous execution time and asynchronous execution time are determined.
    根据计算得到的所有的累加的总执行消耗时长选取出最短时长对应的新的排序队列,作为将待插入的检测任务插入至排序队列的插入结果。A new sorting queue corresponding to the shortest duration is selected according to all the accumulated total execution consumption time obtained by calculation, as the insertion result of inserting the detection task to be inserted into the sorting queue.
  10. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    根据当前的运算状态对所有待执行的检测任务进行分组;Group all the detection tasks to be executed according to the current operation status;
    根据每一分组内的每一待执行的检测任务的异步执行时间确定该分组的执行消耗时长;Determine the execution consumption time of each group according to the asynchronous execution time of each detection task to be executed in each group;
    根据每一分组的执行消耗时长对每一分组进行排序,按照排序后的顺序依次执行所有分组内的待执行的检测任务。Each group is sorted according to the execution consumption time of each group, and the to-be-executed detection tasks in all the groups are sequentially executed in the sorted order.
  11. 一种检测任务执行的设备,其特征在于,所述设备包括:A device for detecting task execution, characterized in that the device includes:
    一个或多个处理器;以及One or more processors; and
    存储有计算机可读指令的存储器,所述计算机可读指令在被执行时使所述处理器执行如权利要求1至10中任一项所述方法的操作。A memory storing computer-readable instructions, which when executed, cause the processor to perform the operation of the method according to any one of claims 1 to 10.
  12. 一种计算机可读介质,其上存储有计算机可读指令,所述计算机可读指令可被处理器执行以实现如权利要求1至10中任一项所述的方法。A computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can be executed by a processor to implement the method according to any one of claims 1 to 10.
PCT/CN2020/120885 2020-01-21 2020-10-14 Test task execution method and device WO2021147382A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010072757.7 2020-01-21
CN202010072757.7A CN111309475B (en) 2020-01-21 2020-01-21 Detection task execution method and equipment

Publications (1)

Publication Number Publication Date
WO2021147382A1 true WO2021147382A1 (en) 2021-07-29

Family

ID=71148917

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/120885 WO2021147382A1 (en) 2020-01-21 2020-10-14 Test task execution method and device

Country Status (2)

Country Link
CN (1) CN111309475B (en)
WO (1) WO2021147382A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309475B (en) * 2020-01-21 2022-12-02 上海万物新生环保科技集团有限公司 Detection task execution method and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140053157A1 (en) * 2012-08-16 2014-02-20 Microsoft Corporation Asynchronous execution flow
US20150227389A1 (en) * 2014-02-07 2015-08-13 International Business Machines Corporation Interleave-scheduling of correlated tasks and backfill-scheduling of depender tasks into a slot of dependee tasks
CN106598725A (en) * 2016-10-31 2017-04-26 武汉斗鱼网络科技有限公司 Android-based Handler memory leakage prevention device and method
CN109298951A (en) * 2018-08-21 2019-02-01 平安科技(深圳)有限公司 The execution method and terminal device of Celery task
CN109710407A (en) * 2018-12-21 2019-05-03 浪潮电子信息产业股份有限公司 Distributed system real-time task scheduling method, device, equipment and storage medium
CN111309475A (en) * 2020-01-21 2020-06-19 上海悦易网络信息技术有限公司 Detection task execution method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213080B (en) * 2017-06-29 2020-10-23 深圳模德宝科技有限公司 Machine tool control method and device
CN108255589A (en) * 2017-08-29 2018-07-06 平安科技(深圳)有限公司 Method for scheduling task and server
CN109445926A (en) * 2018-11-09 2019-03-08 杭州玳数科技有限公司 Data task dispatching method and data task dispatch system
CN109992385B (en) * 2019-03-19 2021-05-14 四川大学 GPU internal energy consumption optimization method based on task balance scheduling
CN110489217A (en) * 2019-07-11 2019-11-22 新华三大数据技术有限公司 A kind of method for scheduling task and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140053157A1 (en) * 2012-08-16 2014-02-20 Microsoft Corporation Asynchronous execution flow
US20150227389A1 (en) * 2014-02-07 2015-08-13 International Business Machines Corporation Interleave-scheduling of correlated tasks and backfill-scheduling of depender tasks into a slot of dependee tasks
CN106598725A (en) * 2016-10-31 2017-04-26 武汉斗鱼网络科技有限公司 Android-based Handler memory leakage prevention device and method
CN109298951A (en) * 2018-08-21 2019-02-01 平安科技(深圳)有限公司 The execution method and terminal device of Celery task
CN109710407A (en) * 2018-12-21 2019-05-03 浪潮电子信息产业股份有限公司 Distributed system real-time task scheduling method, device, equipment and storage medium
CN111309475A (en) * 2020-01-21 2020-06-19 上海悦易网络信息技术有限公司 Detection task execution method and device

Also Published As

Publication number Publication date
CN111309475B (en) 2022-12-02
CN111309475A (en) 2020-06-19

Similar Documents

Publication Publication Date Title
CN107450979B (en) Block chain consensus method and device
WO2017076184A1 (en) Data writing method and device in distributed file system
WO2017167105A1 (en) Task-resource scheduling method and device
CN113535367B (en) Task scheduling method and related device
CN111427859B (en) Message processing method and device, electronic equipment and storage medium
CN111949568B (en) Message processing method, device and network chip
CN116167463B (en) Distributed model training container scheduling method and device for intelligent computing
US9870314B1 (en) Update testing by build introspection
US9921951B2 (en) Optimizations for regression tracking and triaging in software testing
WO2021147382A1 (en) Test task execution method and device
CN117234859B (en) Performance event monitoring method, device, equipment and storage medium
CN113282402A (en) Test task scheduling method oriented to complex resource constraint
CN114861579A (en) Method and system for analyzing time sequence bottleneck node and optimizing time sequence in integrated circuit
WO2018127012A1 (en) Method and device for detecting transmission node cluster
US10929054B2 (en) Scalable garbage collection
CN112989758B (en) Method for synchronously resetting multiple prototype verification boards, verification system and storage medium
CN113918322A (en) Method and equipment for dynamically storing simulation data of logic system design in memory
WO2024032781A1 (en) Algorithm testing method and apparatus, and storage medium
CN109542785A (en) A kind of invalid bug determines method and apparatus
CN117251275A (en) Multi-application asynchronous I/O request scheduling method, system, equipment and medium
CN107451038B (en) Hardware event acquisition method, processor and computing system
CN109669735B (en) Application starting method and device based on delayed registration and storage medium
CN110046194A (en) A kind of method, apparatus and electronic equipment of expanding node relational graph
CN114756287A (en) Data processing method and device for reorder buffer and storage medium
CN111045959B (en) Complex algorithm variable mapping method based on storage optimization

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: 20915960

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: 20915960

Country of ref document: EP

Kind code of ref document: A1