Task execution method and device, equipment and storage medium
By grouping and batch execution of task units, the problem of inefficient task execution is solved, and the task execution efficiency is improved.
Patent Information
- Application Number
- CN202410177329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, tasks including multiple experiments are inefficient in execution because the experimental steps are performed separately.
Group multiple task units in the task, determine the target grouping results, and batch execute each group of task units until all task units are completed according to the execution order of the task units in the subtask.
Through grouping and batch execution of task units, the task execution efficiency is significantly improved.
Smart Images

Figure CN120448085A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automation technology, and in particular to a task execution method, device, equipment and storage medium. Background Art
[0002] Currently, experimental workstations are used to perform various tasks, and one task can include multiple identical or similar experiments to achieve high-throughput experiments.
[0003] In related technologies, when executing a task that includes multiple experiments, individual experiments are generally executed sequentially, that is, after all steps in one experiment are completed, the next experiment is started. This will result in low execution efficiency of the entire task. Summary of the Invention
[0004] In order to solve the above problems, the present application proposes a task execution method, device, equipment and storage medium, which can significantly improve the execution efficiency of tasks.
[0005] According to a first aspect of an embodiment of the present application, a method for executing a task is provided, comprising:
[0006] Grouping multiple task units in a first task to determine a target grouping result; wherein the first task includes at least two subtasks, each subtask includes at least one task unit; and the target grouping result includes at least one group of task units;
[0007] The task units of each group in the target grouping result are executed in batches according to the execution order of the task units in the subtasks until all the task units in the target grouping result are completed.
[0008] According to a second aspect of an embodiment of the present application, there is provided a task execution device, comprising:
[0009] a grouping module, configured to group multiple task units in a first task and determine a target grouping result; wherein the first task includes at least two subtasks, each subtask includes at least one task unit; and the target grouping result includes at least one group of task units;
[0010] The execution module is used to batch execute each group of task units in the target grouping result according to the execution order of the task units in the subtasks until all task units in the target grouping result are executed.
[0011] A third aspect of the present application provides an electronic device, including:
[0012] memory and processor;
[0013] The memory is connected to the processor and is used to store programs;
[0014] The processor implements the above-mentioned task execution method by running the program in the memory.
[0015] A fourth aspect of the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for executing the above-mentioned task is implemented.
[0016] A fifth aspect of the present application provides a computer program product, comprising a computer program, which implements the above-mentioned task execution method when executed by a processor.
[0017] One embodiment of the above application has the following advantages or beneficial effects:
[0018] The task units of the subtasks in the first task are grouped to determine a target grouping result. Each group of task units in the target grouping result is batch-executed in the order in which the task units in the subtasks were executed, until all task units in the target grouping result are executed. In this way, the task units of each subtask in the first task are batch-executed, thereby improving task processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0020] Figure 1 A schematic diagram of an experiment execution system provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of a method for executing a task provided in an embodiment of the present application;
[0022] Figure 3 Schematic diagram of tasks, subtasks, and task units provided in the embodiments of the present application;
[0023] Figure 4 A schematic diagram of the operations corresponding to the task units provided in the embodiments of the present application;
[0024] Figure 5 A schematic diagram of the grouping of task units provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a specific process for executing a task provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the process of parallel execution of tasks provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of a task execution device provided in an embodiment of the present application;
[0028] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0030] Exemplary Implementation Environment
[0031] like Figure 1 As shown, Figure 1 The figure is a schematic diagram of an implementation environment according to the present invention. This application scenario can be for automated experiments. The experiment execution system includes a task executor. The task executor can be a server. Specifically, the server can also refer to software running on the electronic device. The server can also be a distributed server, which can be a system with multiple processors, memories, network communication modules, etc. operating in coordination. Alternatively, the server can be a server cluster formed by multiple servers. Alternatively, with the advancement of science and technology, the server can also be a new technical means capable of implementing the functions described in the embodiments of this specification. For example, it can be a new form of "server" based on quantum computing. In this scenario, the server can receive a first task sent by a client, that is, the user can set the task on the client's front-end interface. The server then groups multiple task units in the first task and determines a target grouping result. The first task includes at least two subtasks, each subtask includes at least one task unit, and the target grouping result includes at least one group of task units. Each group of task units in the target grouping result is batch-executed according to the execution order of the task units in the subtasks until all task units in the target grouping result are executed. After execution is completed, the task execution result can be fed back to the front-end interface for display. In this way, batch processing of each experiment in the task can be achieved, thereby improving the processing efficiency of tasks in the workstation.
[0032] Among them, the task executor includes multiple modules such as task context module, task analyzer, task resource management module and task execution module to realize the functions of grouping and packaging of task units, resource management, task execution, etc.
[0033] Furthermore, batch execution of each group of task units within the target grouping results can be achieved by invoking a multi-device control platform to perform specific operations. For example, interactions can be performed using the multi-device control platform's communication framework, with operations implemented via scripts. The script executor, acting as a system node within the multi-device control platform, utilizes the "request-response" mechanism within the control softlink to implement an operation invocation interface, i.e., a script invocation interface, for the task executor to invoke. The multi-device control platform can also be used to monitor the status of devices and operation execution, reporting this monitoring information as events to the experiment execution system.
[0034] In addition, the experiment execution system can also include: a monitor, which performs secondary processing (filtering, storage, data format conversion, etc.) on the monitoring information of the multi-device control platform and associates the monitoring information with tasks and task units to adapt to the front-end interface display requirements. The monitor communicates with the task executor, and the task executor can read the device status and operation execution status from the monitor. The device status includes the device's working status (such as idle, working, abnormal operation, etc.), device parameters (such as temperature, air pressure, speed, etc.), etc. The operation execution status includes the operation start status, operation end status, and operation abnormality status.
[0035] The information exchange between the monitor and the task executor is achieved through multi-threaded synchronization and interface calls. For example, if the monitor detects an emergency stop event, it can directly call the pause interface of the task executor to stop the task. The monitor includes an event processor and an event listener. The event listener is used to subscribe to and filter events of interest (events generated by the device control platform, such as device start and stop events, abnormal events, state change events, etc.). The event processor is used to process the events obtained by the event listener. The information exchange between the event processor and the event listener can be achieved by directly calling the interface within the module. For example, if the event listener obtains an event of a device status change, the event processor will maintain the current status of the device and convert it into a front-end data model to notify the front-end for display. In addition, the task executor can also query the status of the device.
[0036] Exemplary Methods
[0037] Figure 2 FIG1 is a flowchart of a method for executing a task according to an embodiment of the present application. In an exemplary embodiment, a method for executing a task is provided, comprising:
[0038] S110, grouping multiple task units in a first task to determine a target grouping result; wherein the first task includes at least two subtasks, each subtask includes at least one task unit; and the target grouping result includes at least one group of task units;
[0039] S120 , batch-execute each group of task units in the target grouping result according to the execution order of the task units in the subtasks, until all task units in the target grouping result are executed.
[0040] In step S110, illustratively, the task may represent an experimental task in an automated device. The automated device may be regarded as a large device comprising multiple functional modules, such as an automated workstation. For example, the automated device may include, but is not limited to: a handling module for realizing material transfer (such as a multi-degree-of-freedom robotic arm, an XYZ three-axis translation mechanism, etc.), a powder adding module for realizing a powder adding function, a liquid adding module for realizing a liquid adding function, a stirring module / oscillation module for realizing a mixing function, a detection module for realizing a detection function (such as a UPLC / LCMS detection module, etc.), and the like. Optionally, the experimental task may be a chemical experimental task, or other types of experimental tasks, such as a biological experimental task, which is not limited here.
[0041] Among them, different functional modules are used alone or in combination to complete different experiments. An experiment can be regarded as a process of a single or a series of experimental steps around a clear entity, such as the preparation or detection of a substance, and the clear entity can be regarded as a container for carrying the substance. Multiple experiments can constitute a task, an experiment can be regarded as a subtask in the task, and the steps in the experiment can be regarded as task units. In other words, a task can include multiple experiments (i.e. subtasks), an experiment can include one or more experimental steps (i.e. task units), that is, a task can contain multiple task units. Among them, the task unit can be regarded as the smallest execution unit of the task, and a task unit can include one or more operations. The operation can be regarded as an abstract, hardware-independent specific action process.
[0042] For example, Figure 3 As shown in , a task contains a set of experiments (i.e., experiment-1 to experiment-m). Each experiment corresponds to a subtask in the task. Each experiment contains n steps, and each step corresponds to a task unit. Each task unit can be completed by one or more operations, such as Figure 4As shown, a task contains multiple preparation experiments (i.e., subtasks), and a preparation experiment includes task units such as adding powder, adding liquid, shaking, centrifugation, and filtration. The centrifugation task unit may need to be implemented by moving the tray (test tubes are on the tray), closing the test tube caps (if the test tubes are not closed), moving the test tubes (to the centrifuge), centrifugation (starting the centrifuge), and moving the test tubes (moving to the destination position after centrifugation is completed).
[0043] Specifically, each task unit of each subtask in the first task is determined, and identical or similar task units are found in each subtask and grouped together, thereby obtaining a target grouping result.
[0044] In step S120, illustratively, the execution order of the task units in the subtask represents the task logic order of the pre-set subtask. For example, the execution order of the task units in the subtask is adding powder, adding liquid, shaking, centrifuging, and filtering. Assume that the first task includes a high-throughput experiment consisting of a plurality of identical experiments, and the execution order of the task units in each experiment (subtask) is the same, therefore, the same task units in each experiment can be grouped and packaged, for example, the adding powder task units in all experiments are packaged into the same group, the adding liquid task units are packaged into the same group, the shaking task units are packaged into the same group, the centrifuging task units are packaged into the same group, and the filtering task units are packaged into the same group. Next, the adding powder task units, the adding liquid task units, the shaking task units, the centrifuging task units, and the filtering task units are executed in batches in order. In this way, the batch processing of each subtask in the first task is realized.
[0045] In the technical solution of the present application, the task units of the subtasks in the first task are grouped to determine a target grouping result. Each group of task units in the target grouping result is executed in batches according to the execution order of the task units in the subtasks until all task units in the target grouping result are executed. In this way, the task units of each subtask in the first task are executed in batches, thereby improving the processing efficiency of the task.
[0046] In one embodiment, grouping the multiple task units in the first task and determining a target grouping result includes:
[0047] grouping the task units in the first task using configuration parameters of the task units included in the first task to determine a first grouping result, wherein the first grouping result includes at least one group of task units;
[0048] The target grouping result is determined according to the first grouping result.
[0049] Exemplarily, the configuration parameters represent various attribute information of the task unit, and the configuration parameters include at least one of the following: task unit type, task unit execution parameters, and task unit location information. Specifically, first obtain the first task to be executed, parse the first task, determine the subtasks in the first task, and then determine the task units in each subtask, that is, determine the operations corresponding to each task unit. Then, extract the configuration parameters of each task unit. For example, when the configuration parameters are task unit type, task unit execution parameters, or task unit location information, then the task unit type, task unit execution parameters, or task unit location information of each task unit are extracted accordingly. When the configuration parameters are task unit type and task unit execution parameters, then the task unit type and task unit execution parameters of each task unit are extracted. When the configuration parameters are task unit type and task unit location information, then the task unit type and task unit location information of each task unit are extracted. When the configuration parameters are task unit execution parameters and task unit location information, then the task unit execution parameters and task unit location information of each task unit are extracted. When the configuration parameters are task unit type, task unit execution parameters and task unit location information, the task unit type, task unit execution parameters and task unit location information of each task unit are extracted. Task units with the same or similar configuration parameters are grouped together to obtain a first grouping result. Furthermore, when there are multiple configuration parameters, all task units can be grouped according to the multiple configuration parameters, and the intersection between the various groups is taken as a group of task units in the first grouping result. It is also possible to group all task units according to the multiple configuration parameters in turn to obtain multiple groups of task units in the first grouping result. This allows for packaging and grouping according to different configuration parameters.
[0050] Furthermore, determining the target grouping result according to the first grouping result includes:
[0051] The first grouping result is grouped again using the resource information corresponding to each group of task units to determine a target grouping result of the task units in the first task.
[0052] Exemplarily, resource information represents the resources required to execute the operations corresponding to the task unit, and may include static resources (e.g., fixed-position robotic arms, oscillation modules, powder adding modules, and other execution devices) and dynamic resources (e.g., test tubes, TIP heads, powder barrels, test tube racks, and other media). Resource information may include, but is not limited to, the number and / or capacity of execution devices.
[0053] Optionally, the resource information corresponding to each group of task units is used to perform secondary grouping on the first grouping result to determine the target grouping result of the task units in the first task, including: performing secondary grouping processing on the first grouping result according to the number and / or capacity of the target execution devices corresponding to each group of task units to obtain the target grouping result.
[0054] The method for determining the target execution device includes:
[0055] Determine the execution device corresponding to any group of task units; match the operating parameters of the execution device corresponding to the group of task units with the configuration parameters of the group of task units, and determine the execution device that successfully matches as the target execution device corresponding to the group of task units.
[0056] Exemplarily, the operating parameters of the execution device may include but are not limited to at least one of the following: temperature, speed, rotation speed, frequency, duration, accuracy, power, etc. Specifically, for any group of task units, first determine all possible execution devices for executing the group of task units, then match the operating parameters of these execution devices with the configuration parameters of each task unit in the group of task units, and the execution device that successfully matches is used as the target execution device for executing the group of task units. Preferably, the operating parameters of the execution device can be matched with the task unit execution parameters of each task unit in the group of task units to determine one or more target execution devices that meet the execution conditions. For example, a group of oscillation task units requires an oscillation temperature of 150 degrees, and there are two oscillation devices. The operating temperature range of oscillation device 1 is 0-120 degrees, and the operating temperature range of oscillation device 2 is -20-180 degrees. Then, the group of oscillation task units can only run on oscillation device 2 and cannot run on oscillation device 1. Therefore, oscillation device 2 is the target execution device corresponding to the group of oscillation task units. In this way, the devices for executing each task unit can be accurately and intelligently found.
[0057] Optionally, taking into account the number and capacity of target execution devices, performing secondary grouping processing on the first grouping result according to the number and capacity of target execution devices corresponding to each group of task units to obtain the target grouping result includes:
[0058] performing secondary grouping processing on the first grouping result according to the capacity of the target execution device corresponding to each group of task units to obtain a third grouping result; wherein the number of task unit groups included in the third grouping result is greater than or equal to the number of task unit groups included in the first grouping result;
[0059] The third grouping result is grouped again according to the number of target execution devices corresponding to each group of task units to obtain the target grouping result; wherein the number of task unit groups included in the target grouping result is less than or equal to the number of task unit groups included in the third grouping result.
[0060] Exemplarily, after determining the target execution device corresponding to each group of task units (i.e., the first grouping result), the capacity of the target execution device is determined, and the capacity of the target execution device is compared with the number of task units in the group of task units. If the capacity of the target execution device can accommodate all the task units in the group of task units, then the group of task units is still regarded as a group in the third grouping result. If the capacity of the target execution device cannot accommodate all the task units in the group of task units, then the group of task units needs to be regrouped according to the capacity of the target execution device, and the group of task units is divided into multiple groups. For example, a group of oscillation task units consisting of 16 test tubes, and an oscillation device can only hold 4 test tubes at the same time, then the group of oscillation task units needs to be further divided into 4 groups of oscillation task units, that is, a group of oscillation task units included in the first grouping result is transformed into 4 groups of oscillation task units included in the third grouping result through secondary grouping.
[0061] If there are multiple target execution devices, and all of the target execution devices are idle and can run simultaneously, after obtaining multiple groups of task units based on the capacity of the target execution devices, the multiple groups of task units can be grouped and packaged using the number of target execution devices to obtain a target grouping result. Specifically, the number of groups of task units obtained based on the capacity of the target execution devices is determined, and the multiple groups of task units are grouped and packaged based on the number of groups and the number of target execution devices to obtain a target grouping result. If there is only one target execution device, the target grouping result is the same as the third grouping result; if there is more than one target execution device, the number of task unit groups in the target grouping result will be less than the number of task unit groups in the third grouping result.
[0062] Still taking the oscillation task unit of the above-mentioned 16 test tubes as an example, a group of 16 test tubes of oscillation task units is divided into 4 groups of 4 test tubes of oscillation task units through the capacity of the oscillation device. If there are two oscillation devices in the workstation, assuming that the oscillation conditions are the same and both meet the configuration parameters of the group of oscillation task units, and the two oscillation devices can work at the same time, then the oscillation task units of the two groups of 4 test tubes can be executed on the two oscillation devices at the same time (one group of oscillation task units is executed on one oscillation device). The above-mentioned 4 groups of oscillation task units need to be executed twice, that is, the above-mentioned 4 groups of oscillation task units can be grouped and packaged into 2 groups of oscillation task units. In other words, the 4 groups of oscillation task units contained in the third grouping result are grouped and packaged into 2 groups of oscillation task units contained in the target grouping result.
[0063] In this way, the configuration parameters of each task unit included in the first task to be executed are obtained; the configuration parameters are used to group the task units in the first task to determine a first grouping result, wherein the first grouping result includes at least one group of task units; the resource information corresponding to each group of task units is used to perform a second grouping on the first grouping result to determine a target grouping result for the task units in the first task. In this way, before the task is executed, the task units in the different subtasks of the task are grouped and packaged so that the task units in the same group can be executed in batches later, thereby improving the execution efficiency of the task.
[0064] In one embodiment, the configuration parameters include at least a task unit type. The task units in the first task are grouped using the configuration parameters of the task units included in the first task, and determining a first grouping result includes:
[0065] Grouping the task units of the subtasks of the first task that have matching task unit types into a group to obtain a type grouping result, wherein the type grouping result includes multiple groups of task units of different types;
[0066] The first grouping result is determined according to the type grouping result.
[0067] Exemplarily, the task unit type indicates the type corresponding to the task unit, and each task unit has only one type. In the type grouping results, the types of the task units in the same group are the same, while the types of the task units in different groups are different. Task unit types may include, but are not limited to, liquid addition, powder addition, oscillation, centrifugation, filtration, extraction, and detection. Accordingly, the type grouping results may include: liquid addition task unit group, powder addition task unit group, oscillation task unit group, and so on.
[0068] Specifically, after obtaining each task unit, extract the type corresponding to the task unit. The task units of the type belonging to the liquid addition type are divided into a group to obtain a liquid addition task unit group, the task units of the type belonging to the powder addition type are divided into a group to obtain a powder addition task unit group, and the task units of the type belonging to the oscillation type are divided into a group to obtain an oscillation task unit group. In this way, the task units are grouped and packaged according to the task unit type to obtain a type grouping result containing different types of task unit groups. Determine the first grouping result based on the type grouping result, which can be directly used as the first grouping result, that is, the first grouping result contains multiple groups of different types of task units. In this way, it is convenient for subsequent batch execution of task units of the same type to improve task execution efficiency. For example, a task contains preparation experiments corresponding to 12 test tubes (i.e., 12 preparation experiments), and each preparation experiment contains a powder addition task unit and a liquid addition task unit. Then, these 12 test tubes can be packaged into the same powder addition task unit group and the same liquid addition task unit group. That is, the first grouping result includes 2 groups of the powder addition task unit group of 12 test tubes and the liquid addition task unit group of these 12 test tubes. According to the task unit execution logic, the powder adding task unit of 12 test tubes is executed in batches first, and then the liquid adding task unit of these 12 test tubes that have completed the powder adding step is executed in batches.
[0069] In one embodiment, the configuration parameters further include: task unit execution parameters and / or task unit location information. Determining the first grouping result based on the type grouping result includes:
[0070] Perform task unit execution parameter matching and / or task unit position information matching on each group of task units in the type grouping result, and determine the first grouping result according to the matching result.
[0071] For example, the task unit execution parameters may include, but are not limited to, at least one of the following: required execution temperature, required execution speed, rotation speed, frequency, duration, accuracy, power, added reactants, and the amount of added reactants. Task unit location information indicates the location of the entity corresponding to the task unit (e.g., a container or reactants contained in the container).
[0072] Optionally, when the configuration parameters also include task unit location information, the task units are first grouped according to the task unit type to obtain a type grouping result, and then the location information of each task unit in each group of task units is obtained, that is, whether the task unit location information in each group of task units meets the preset distribution conditions is determined, and the task units that meet the preset distribution conditions are grouped into one group to obtain a first grouping result. Among them, the preset distribution condition indicates that the entity corresponding to the task unit is within a preset range, and the preset range is determined based on the location information of the entity corresponding to the task unit. Still taking the above-mentioned 12 preparation experiments as an example, if the 12 test tubes are distributed on the same test tube rack, the location information of the powder adding task units of these 12 test tubes are all matched, and the location information of the liquid adding task units of the 12 test tubes are also all matched. At this time, the first grouping result is the same as the type grouping result. If 6 of the 12 test tubes are distributed on test tube rack 1 and the other 6 test tubes are distributed on test tube rack 2, then the powder adding task units of the 6 test tubes on test tube rack 1 are matched into one group, and the powder adding task units of the 6 test tubes on test tube rack 2 are matched into one group. The liquid adding task units of the 6 test tubes on test tube rack 1 are matched into one group, and the liquid adding task units of the 6 test tubes on test tube rack 2 are matched into one group. At this time, the 2 groups of task units in the type grouping result are further divided into 4 groups of task units through position matching, that is, the first grouping result includes the above 4 groups of task units.
[0073] Optionally, when the configuration parameters also include task unit execution parameters, the task units are first grouped according to the task unit type to obtain a type grouping result, and then the task unit execution parameters of each task unit in each group of task units are obtained, and it is determined whether the task unit execution parameters of the task units in each group of task units match, and the task units whose task unit execution parameters match are grouped together to obtain a first grouping result. Among them, the matching rule of the parameters can be exact matching, approximate matching, fuzzy matching, etc., and the appropriate matching rule can be selected according to actual needs. If the matching rule is exact matching, the execution parameters of the two task units must be the same. If the matching rule is approximate matching, the difference in the execution parameters of the two task units is allowed to be within a certain error. For example, it is determined whether the task unit execution parameters of the task units in each group of task units meet the preset error value, and the task units that meet the preset error value are grouped together to obtain a first grouping result. Among them, the preset error value can represent the maximum deviation allowed between the numerical value of the execution parameter of the task unit and the mean or median value of the execution parameter of the task units in the group. The preset error value can also be set based on experience and is not limited here. Taking the above 12 preparation experiments as an example, if 4 of the 12 test tubes' liquid-adding task units need to add 1 ml of solution A, and the other 8 test tubes need to add 1 ml of solution B, then the 12 test tubes' liquid-adding task units are divided into 2 groups. At this time, the 2 groups of task units in the type grouping results are further divided into 3 groups of task units through parameter matching, that is, the first grouping result includes 3 groups of task units, namely, one group of 12 test tubes' powder-adding task units, one group of 4 test tubes' liquid-adding task units, and one group of 8 test tubes' liquid-adding task units.
[0074] Optionally, when the configuration parameters further include task unit execution parameters and task unit location information, performing task unit execution parameter matching and task unit location information matching on each group of task units in the type grouping result, and determining the first grouping result based on the matching results, includes:
[0075] Assigning the task units whose execution parameters match those of the task units in the type grouping result into a group to obtain an execution parameter grouping result;
[0076] In the case where the task unit position information of the task unit in the execution parameter grouping result cannot meet the preset distribution condition, the task units in the execution parameter grouping result are grouped using the preset distribution condition to obtain a position grouping result;
[0077] A first grouping result is determined according to the position grouping result.
[0078] Specifically, the task units are first grouped according to the task unit type to obtain a type grouping result. The i-th group of task units in the type grouping result is used as an example for explanation. The task unit execution parameters of each task unit in the i-th group of task units are obtained, and it is determined whether the task unit execution parameters of each task unit match. The task units whose task unit execution parameters match are grouped together. In this way, the i-th group of task units is divided into one or more groups. The groups of task units in the type grouping result are grouped based on the above grouping rules to obtain an execution parameter grouping result. For any group of task units in the execution parameter grouping result, the position information of each task unit therein is obtained, and the task units whose position information matches are grouped together, thereby dividing the group of task units into one or more groups. The groups of task units in the execution parameter grouping result are grouped based on the above grouping rules to obtain a position grouping result, and the position grouping result is used as the first grouping result. In this way, the task units are grouped from multiple aspects such as type, parameter and position to ensure that the grouped task units can meet the requirements of batch execution.
[0079] Optionally, taking the i-th group of task units in the type grouping result as an example, it is also possible to first group them according to the location information of each task unit to obtain a location grouping result, and then group the task units in the location grouping result according to the task unit execution parameters to obtain the final first grouping result.
[0080] For example, Figure 5 As shown (the dotted box is the first grouping result, and the solid box is the target grouping result), there are 16 test tubes corresponding to the preparation experiment. A test tube rack can hold at most 12 test tubes, so at most 12 test tubes can be packed into the same powder adding and liquid adding group. Assume that 12 of the test tubes are placed in test tube rack 1, and the other 4 test tubes are placed in test tube rack 2. The 12 test tubes on test tube rack 1 can be packed into the same group of powder adding task units and the same group of liquid adding task units, and the 4 test tubes on test tube rack 2 can be packed into the same group of powder adding task units and the same group of liquid adding task units. Furthermore, whether the powder adding and liquid adding grouping is established can be determined based on the number and capacity of the target execution devices corresponding to the powder adding and liquid adding. The oscillation task unit first performs the first grouping according to the speed and temperature (i.e., the task unit execution parameters), and then performs the second grouping of the first grouping results according to the capacity and quantity of the oscillation equipment to obtain the target grouping results.
[0081] In one embodiment, step S120 batch-executes each group of task units in the target grouping result according to the execution order of the task units in the subtasks until all task units in the target grouping result are executed, including:
[0082] Determining the execution order of task units in each subtask of the first task according to the task execution logic;
[0083] Corresponding resource information is allocated to each group of task units in the target grouping result, and each group of task units is batch-executed according to the above execution order using the resource information.
[0084] Exemplarily, resource information includes static resource information and dynamic resource information, among which static resource information includes relevant information of the execution device, and dynamic resource information includes medium information such as test tube racks, test tubes, powder buckets, and TIP heads. Determine the required resource information based on the task unit execution parameters of each group of task units and the target execution device, prepare the above resource information for each group of task units, and distribute the resource information to each group of task units. After determining that the resource information is ready, a prompt message can be sent to prompt that the resources are ready. Determine whether a group of task units are all on the target execution device. If so, use the resource information to batch execute each task unit in the group. If not, do not execute. In this way, executing task units in groups can effectively improve the execution efficiency of task units.
[0085] In one embodiment, batch executing any group of task units in the target grouping results includes:
[0086] Execute the experimental preparation operations of the task unit in sequence;
[0087] When the experiment preparation operation of the last task unit in the group of task units is completed, the experiment execution operation of the group of task units is executed in batches;
[0088] In response to the experiment termination instruction, post-processing operations of the group of task units are executed.
[0089] Exemplarily, each task unit can include multiple operations, and the operation corresponding to the task unit can be divided into experimental preparation operation, experimental execution operation and post-processing operation. Experimental preparation operation represents the preparation operation of the resources (such as functional modules, media, etc.) required for the execution task unit. For example, when starting to execute the oscillation task unit, if the test tube rack where the test tube is located is not on the designated work position, the test tube rack is moved to the designated work position, then the test tube is taken out from the test tube rack and the test tube is moved to the target position of the oscillation device. It can be seen that moving the test tube rack to the designated work position and moving the test tube to the target position of the oscillation device can be regarded as experimental preparation operation. Experimental execution operation represents the necessary operation for executing the task unit. For example, the corresponding experimental execution operation of the powder adding task unit is the powder adding operation, and the corresponding experimental execution operation of the oscillation task unit is the oscillation operation. Post-processing operation represents the operation required for resource restoration after the task unit executes. For example, various resources are moved back to their original positions or returned to the initial state, etc. The experiment termination instruction can be triggered by the completion of the experimental execution operation, or it can be issued by the staff according to actual needs, which is not limited here.
[0090] Specifically, after determining the target grouping result, the task units in the same group can be executed in batches. The task units in different groups can be sorted according to the execution order of the tasks. Taking the execution of the jth group of task units as an example, j is a positive integer. First, the experimental preparation operation of each task unit in the jth group of task units is executed until the experimental preparation operation of the last task unit in the jth group is completed, so that the resources required by each task unit are in the corresponding target position. Then, the experimental execution operation of each task unit in the jth group of task units is executed. If the last task unit in the jth group of task units has completed the experimental execution operation, it means that the experimental execution is completed, the experiment termination instruction is triggered, and the post-processing operation of each task unit in the jth group of task units is executed to place the resources corresponding to each task unit in place. And so on, the j+1th group of task units is executed until each group of task units in the target grouping result is completed. In this way, batch processing of task units is achieved.
[0091] In one embodiment, after sequentially executing the experimental preparation operations of the group of task units, the method further includes:
[0092] Control the task unit group to enter a waiting state to wait for the experiment start instruction;
[0093] The batch execution of the experiment execution operation of the group of task units includes:
[0094] In response to the experiment start instruction, the experiment execution operation of the group of task units is executed in batches.
[0095] For example, the experiment start instruction may be triggered by the completion of the experiment preparation operation, or may be issued by a staff member according to actual needs, which is not limited here.
[0096] Specifically, if Figure 6As shown, receive the first task, each task unit in the first task is grouped, and the target grouping result is obtained. Take the execution j-th group of task units as an example, first execute the experimental preparation operation of each task unit in the j-th group of task units, the task unit that has completed the experimental preparation operation enters a waiting state to wait for the experiment start instruction, and after the experimental preparation operation of the last task unit of the j-th group is completed, trigger the experiment start instruction. In response to the experiment start instruction, the j-th group of task units releases the waiting state, and executes the experimental execution operation (such as oscillation operation) of each task unit in the j-th group of task units. If the experimental execution operation is a long-term operation, each task unit can enter a sleeping state (oscillation operation is still being executed). If the last task unit in the j-th group of task units executes the experimental execution operation and finishes or all task units in the j-th group of task units are synchronously executed and finished, then the experiment execution ends, triggers the experiment termination instruction, executes the post-processing operation of each task unit in the j-th group of task units, so that the resources corresponding to each task unit are placed in place. By analogy, the j+1-th group of task units is executed until each group of task units in the target grouping result is completed. In this way, batch processing of task units is achieved.
[0097] In one embodiment, the method further comprises:
[0098] When executing a specific task unit in the first task, executing the acquired second task at the same time; the specific task unit refers to a task unit whose execution time exceeds a preset time threshold;
[0099] When a specific task unit in the first task is completed and the second task is not in a task-locked state, the remaining groups of task units in the first task continue to be executed.
[0100] For example, when executing the first task, each group of task units in the first task is executed in batches in sequence according to the task execution logic. In the case of executing a specific task unit, since the time required is relatively long, the second task after the first task can be obtained during this period of time, and the execution of the second task can be controlled. The second task can be a task that is adjacent to the first task in the task execution logic, or it can be a non-adjacent task, and there is no resource conflict between the first task and the second task in the task units that are executed at the same time. The preset time threshold can be set according to the experimental requirements, such as 10 minutes, 20 minutes, 30 minutes, 60 minutes or other values.
[0101] Since the time for executing the operation of the specific task unit exceeds the preset time threshold, when the specific task unit of the first task is executed, the specific task unit of the first task and the second task are executed at the same time. If the specific task unit in the first task is completed, it is determined whether the second task is in the task lock state. If the second task is not in the task lock state, that is, it is not only the second task that is executed, then the remaining task units of the first task continue to be executed. In this way, when the processing time of any step in the current experimental task is too long, other experimental tasks can be processed in parallel in a timely manner, while ensuring that the current experimental task can be completed in time, thereby improving the processing efficiency of experimental tasks in the workstation.
[0102] Preferably, the method for determining the task lock state includes: determining that the task is in the task lock state when a task occupies the lock identifier; and determining that the task is not in the task lock state when the task releases the lock identifier.
[0103] Exemplarily, the lock identifier can be a pre-introduced global lock, which is a heavyweight lock, also known as a mutex lock. It is an exclusive lock, that is, only one thread (task) can obtain the lock at the same time. The thread that obtains the global lock can safely access shared resources, and other threads must wait for the lock to be released before continuing to execute. Specifically, if task A occupies the global lock, task A is in the task lock state, task A can be executed, and other tasks will be blocked and cannot be executed when they are started. If task A releases the global lock, task A is no longer in the task lock state, and other tasks can be executed after obtaining the global lock.
[0104] Furthermore, the task releases the lock identifier, including: releasing the lock identifier occupied by the task when the task meets preset conditions; wherein the preset conditions include: all task units in the task are executed; and / or the task executes a specific task unit.
[0105] Specifically, the completion of all task units in a task indicates that the operations corresponding to each group of task units in the task have been completed. Taking the first task as an example, a determination is made as to whether all task units in the first task have been completed. If so, the global lock is released; otherwise, the first task still holds the global lock. Alternatively, a determination is made as to whether the currently executing or next executing task unit is a specific task unit. If so, the global lock is released; otherwise, the first task still holds the global lock.
[0106] Alternatively, first determine whether all task units in the first task have been completed. If not, determine whether the currently executed or next executed task unit is a specific task unit. If so, release the global lock; if not, the first task still holds the global lock. In this way, the lock flag (i.e., the global lock) is used to determine the task status and control the safe parallel execution of multiple tasks.
[0107] Specifically, after a specific task unit in the first task completes, it determines whether the second task meets a preset condition. If so, the lock flag occupied by the second task is released. The second task is no longer in a task lock state, indicating that it can run in parallel with other tasks. After reacquiring the global lock, the first task continues to execute the remaining task units in the first task.
[0108] Furthermore, the method further comprises:
[0109] When a specific task unit in the first task is completed and the second task is in a task-locked state, the second task continues to be executed.
[0110] For example, after a specific task unit in the first task is executed, it is determined whether the second task meets the preset conditions (i.e., all task units in the second task are executed; or, the second task executes a specific task unit). If not, the second task still occupies the lock flag, i.e., the second task is in the task lock state. At this time, other tasks cannot obtain the lock flag to start execution. Therefore, the task units in the second task continue to execute. In this way, based on the task lock state, it is effective to determine whether tasks can be safely run in parallel.
[0111] In one embodiment, when the specific task unit in the first task is completed and the second task is in a task-locked state, continuing to execute the second task includes:
[0112] determining whether a specific task unit in the first task is the last task unit in the first task;
[0113] If not, when the specific task unit in the first task is completed and the second task is in the task-locked state, the second task continues to be executed and the first task is controlled to enter the waiting state.
[0114] Specifically, when it is determined that a specific task unit in the first task is not the last task unit in the first task, it means that there are still unexecuted task units in the first task. Therefore, it is necessary to determine whether the task can be executed in parallel with the second task. If the second task does not meet the preset conditions (i.e., the second task occupies the lock mark), the second task is in the task lock state and continues to execute the second task. It can be seen that the second task cannot be executed in parallel with other tasks, and the first task is controlled to enter the waiting state until the second task is no longer in the task lock state (i.e., the lock mark is released), and then the remaining task units in the first task are executed.
[0115] Furthermore, if it is determined that the specific task unit in the first task is the last task unit in the first task, the first task is terminated. If the second task is in the task lock state, other tasks in the task execution logic are controlled to enter a waiting state.
[0116] In one embodiment, the step of simultaneously executing the second task while executing a specific task unit in the first task includes:
[0117] When a specific task unit in the first task is executed and the first task is not in a task-locked state, if the second task is in a task-locked state, the second task is executed simultaneously.
[0118] For example, when a first task executes a specific task unit, since the specific task unit is a long-term operation, the first task is set to not be in a task lock state (i.e., the lock flag occupied by the first task is released), that is, the first task can be executed in parallel with other tasks. Then, a second task in the task execution logic is obtained and its state is set to a task lock state (i.e., a lock flag is assigned to the second task), thereby starting the second task, so that the specific task unit of the first task can be executed in parallel with the second task.
[0119] Furthermore, the batch execution of each group of task units in the target grouping result includes:
[0120] According to the task execution logic, a lock identifier is assigned to the first task, and each group of task units in the target grouping result is executed in batches;
[0121] The step of simultaneously executing the acquired second task while executing the specific task unit in the first task includes:
[0122] When a specific task unit in the first task is executed, the lock identifier is released from the first task, and the lock identifier is allocated to a second task, and the second task is executed in parallel.
[0123] Specifically, when execution begins according to the task execution logic, in order to ensure the sequential execution of tasks, the first unexecuted task in the task execution logic (i.e., the first task) acquires a global lock, and the first task begins to execute the task units therein. Before each task unit is executed, it is necessary to determine whether it is a specific task unit. If so, it means that the first task requires a long operation, and the global lock is released. The global lock is then assigned to the next task after the first task (i.e., the second task) according to the task execution logic. At this time, the specific task unit of the first task can be executed in parallel with the second task.
[0124] Furthermore, when the specific task unit in the first task is completed and the second task is not in the task-locked state, continuing to execute the remaining groups of task units in the first task includes:
[0125] When the second task is completed or a specific task unit in the second task is executed, releasing the locking identifier from the second task;
[0126] After the specific task unit in the first task is executed, the locking identifier is reallocated to the first task, and the remaining task units in the first task continue to be executed.
[0127] Specifically, if the second task has been completed or has entered the specific task unit of the second task, the second task releases the global lock. Then determine whether the specific task unit in the first task has been executed. If it has been executed, the global lock is assigned to the first task so that the first task continues to batch execute the remaining groups of task units in the first task. Furthermore, after determining that the specific task unit of the first task has been executed, it is also necessary to determine whether the specific task unit is the last task unit of the first task. If not, the global lock is assigned to the first task so that the first task continues to execute the remaining task units in the first task. If so, the first task is terminated. Then, according to the task execution logic, the global lock is assigned to the third task after the second task, and the third task is executed.
[0128] Furthermore, after releasing the lock identifier from the second task, the method further includes:
[0129] If the specific task unit in the first task has not been completed, assigning the lock identifier to a third task and executing the third task in parallel;
[0130] When the third task is completed or a specific task unit in the third task is executed, the locking identifier is released from the third task.
[0131] Specifically, if the second task has completed or entered a specific task unit of the second task, the second task releases the global lock. It is determined whether the specific task unit in the first task has been completed. If not, the global lock is assigned to a third task following the second task according to the task execution logic, so that the third task and the specific task unit in the first task are executed in parallel.
[0132] If the third task has not released the global lock and the specific task unit of the first task has completed execution, the first task is controlled to enter a waiting state. If the third task has completed or entered the specific task unit of the third task, the third task releases the global lock. When the specific task unit of the first task has completed execution, the global lock is assigned to the first task, allowing the remaining task units in the first task to continue execution, thus achieving safe parallelism between the tasks.
[0133] In one embodiment, when executing a specific task unit in the first task, releasing the lock identifier from the first task, assigning the lock identifier to a second task, and executing the second task in parallel includes:
[0134] When executing a specific operation in a specific task unit of the first task, releasing the lock identifier from the first task, assigning the lock identifier to a second task, and executing the second task in parallel; wherein a task unit includes at least one operation, and the specific operation represents an operation whose execution time exceeds a preset time threshold;
[0135] The step of continuing to execute the remaining groups of task units in the first task when the specific task unit in the first task is completed and the second task is not in a task-locked state includes:
[0136] When the specific operation in the specific task unit of the first task is completed and the second task is not in the task-locked state, the remaining operations in the specific task unit of the first task continue to be executed until all task units in the first task are completed.
[0137] Specifically, before or at the start of a specific operation, the first task releases the global lock and assigns the global lock to the second task according to the task execution logic. At this time, the specific task unit of the first task can be executed in parallel with the task unit in the second task.
[0138] After the specific operation of a specific task unit in the first task is completed, if the second task has completed or entered the specific operation of the second task, the second task releases the global lock. The first task can acquire the global lock to enable the first task to execute the remaining operations in the specific task unit until all task units in the first task are completed. It is understood that if the specific operation is the last operation of the specific task unit in the first task, the next group of task units in the specific task unit in the first task will continue to be executed until all groups of task units are completed.
[0139] In one embodiment, after executing the acquired second task while executing the specific task unit in the first task, the method further includes:
[0140] When the specific task unit in the first task is not completely executed, if the second task needs to use the resources used by the specific task unit in the first task during execution, execution of the second task is stopped.
[0141] For example, when executing a specific task unit in the first task, the first task releases the global lock and assigns the global lock to the second task, and the second task is executed at this time. If the resources (such as functional modules, containers, etc.) required for the execution of the second task are occupied by the specific task unit, it means that there is a conflict between the first task and the second task, and the execution of the second task is stopped. In this way, the safe execution of the first task is guaranteed, and the conflict between the first task and the second task is avoided during execution. At this time, the global lock occupied by the second task can be released and assigned to the subsequent task so that the subsequent task is executed in parallel with the first task. It is understandable that before assigning a global lock to the next task of the first task, it is also possible to first determine whether the resources required by the next task conflict with the resources currently occupied by the first task. If there is no conflict, the next task is determined as the second task and assigned a global lock; if there is a conflict, it is further determined whether the resources required by the next task conflict with the resources currently occupied by the first task. If there is no conflict, the next task is determined as the second task and assigned a global lock.
[0142] In order to facilitate the understanding of the above technical solution, the following examples are given:
[0143] Because the order of experimental steps cannot be changed, tasks must be executed sequentially to ensure sequential order, resulting in low utilization of execution equipment. For example, if a batch of experimental tasks includes a oscillation step (task unit) that lasts for hours or even days, other tasks cannot be executed until the oscillation is complete. If a batch of experimental tasks does not require oscillation, then theoretically, the non-oscillation-requiring tasks should be able to safely run in parallel with the oscillation task. This requirement can be met through the aforementioned task parallelization method. The user can manually or automatically split the two batches of experiments (oscillation and non-oscillation) into two tasks, parallelizing them at the task level and ensuring parallel safety using a "task reentrant global lock" mechanism. "Task reentrant global lock" means that if a task has already acquired the lock, reacquiring the same lock by other logic within the task (other task units) will not affect the task. However, acquiring the lock by other tasks will block the other tasks. If the lock has already been released by the task, reacquiring the same lock by other logic within the task (other task units) will not affect the task.
[0144] like Figure 7 As shown, Task A and Task B are retrieved from the task queue. Task A executes slightly before Task B (in multithreaded parallelism, Task A and Task B execute in different threads). Task A first acquires the global lock and enters the normal task execution process. However, because the global lock is already occupied, Task B is blocked upon startup. Before executing a long operation, Task A releases the global lock (while the long operation is still in progress), allowing Task B to execute. After Task A completes its long operation, if Task B has already completed or entered a long operation and released the global lock, Task A can acquire the global lock and continue execution. Otherwise, Task A will wait until it acquires the global lock before continuing. The global lock ensures that only when the current task enters a long operation can other tasks execute. If other tasks also use the same device (i.e., hardware resources) as the long operation, this indicates a conflict between the tasks and prevents safe parallel execution. In this case, resource status can be determined during resource allocation, and if the device is unavailable, the task can exit parallel execution or block. Alternatively, the device status can be determined within the task unit, leading to blocking or exit processing. Therefore, the safety of task parallelism is guaranteed. It can be understood that there may be one or more specific task units (long-time operations) in a task. If there are multiple specific task units, the global lock may be released each time a long-time operation is entered.
[0145] Compared to single-task serial logic, the experimental execution system incorporates queues, allowing for the acceptance of multiple tasks. For the task executor, the only additional steps are acquiring and releasing the global lock before and after task execution. For the task unit, the only requirement is to release the global lock before executing a long operation and acquire it afterward, without adding significant overhead to task unit development.
[0146] Exemplary devices
[0147] Accordingly, Figure 8 FIG. 1 is a schematic diagram of a task execution device according to an embodiment of the present application. In an exemplary embodiment, a task execution device is provided, comprising:
[0148] A grouping module 810 is configured to group multiple task units in a first task and determine a target grouping result; wherein the first task includes at least two subtasks, each subtask includes at least one task unit; and the target grouping result includes at least one group of task units;
[0149] The first execution module 820 is configured to execute each group of task units in the target grouping result in batches according to the execution order of the task units in the subtasks until all task units in the target grouping result are executed.
[0150] In one embodiment, the first execution module 820 batch executes any group of task units in the target grouping result, including:
[0151] Execute the experimental preparation operations of the task unit in sequence;
[0152] When the experiment preparation operation of the last task unit in the group of task units is completed, the experiment execution operation of the group of task units is executed in batches;
[0153] In response to the experiment termination instruction, post-processing operations of the group of task units are executed.
[0154] In one embodiment, the grouping module 810 includes:
[0155] a configuration module, configured to group the task units in the first task using configuration parameters of the task units included in the first task, and determine a first grouping result, wherein the first grouping result includes at least one group of task units;
[0156] A determination module is used to determine the target grouping result according to the first grouping result.
[0157] In one embodiment, the determining module includes:
[0158] The resource grouping module is used to perform secondary grouping on the first grouping result by using the resource information corresponding to each group of task units, and determine the target grouping result of the task units in the first task.
[0159] In one embodiment, the configuration parameters include at least: a task unit type, and the configuration module is specifically configured to:
[0160] Grouping the task units of the subtasks of the first task that have matching task unit types into a group to obtain a type grouping result, wherein the type grouping result includes multiple groups of task units of different types;
[0161] The first grouping result is determined according to the type grouping result.
[0162] In one embodiment, the configuration parameters further include: task unit execution parameters and / or task unit location information, and the configuration module determines the first grouping result based on the type grouping result, including:
[0163] Perform task unit execution parameter matching and / or task unit position information matching on each group of task units in the type grouping result, and determine the first grouping result according to the matching result.
[0164] In one embodiment, the resource grouping module is specifically configured to:
[0165] According to the number and / or capacity of target execution devices corresponding to each group of task units, the first grouping result is subjected to secondary grouping processing to obtain the target grouping result.
[0166] In one embodiment, the resource grouping module performs secondary grouping processing on the first grouping result according to the number and capacity of target execution devices corresponding to each group of task units to obtain the target grouping result, including:
[0167] performing secondary grouping processing on the first grouping result according to the capacity of the target execution device corresponding to each group of task units to obtain a third grouping result; wherein the number of task unit groups included in the third grouping result is greater than or equal to the number of task unit groups included in the first grouping result;
[0168] The third grouping result is grouped again according to the number of target execution devices corresponding to each group of task units to obtain the target grouping result; wherein the number of task unit groups included in the target grouping result is less than or equal to the number of task unit groups included in the third grouping result.
[0169] In one embodiment, the method for determining the target execution device includes:
[0170] Determine the execution device corresponding to any group of task units;
[0171] The operating parameters of the execution devices corresponding to the group of task units are matched with the configuration parameters of the group of task units, and the execution devices that are successfully matched are determined as the target execution devices corresponding to the group of task units.
[0172] In one embodiment, the apparatus further comprises:
[0173] a second execution module, configured to simultaneously execute the acquired second task while executing a specific task unit in the first task; the specific task unit being a task unit requiring an execution time exceeding a preset time threshold;
[0174] a third execution module, configured to, when a specific task unit in the first task is completed and the second task is not in a task-locked state, continue to execute the remaining groups of task units in the first task;
[0175] The fourth execution module is configured to continue executing the second task when a specific task unit in the first task is completed and the second task is in a task-locked state.
[0176] In one embodiment, the method for determining the task lock state includes:
[0177] If there is a task occupying a lock flag, determine that the task is in a task lock state;
[0178] When the task releases the lock flag, it is determined that the task is not in the task lock state.
[0179] The task release lock flag includes:
[0180] When the task meets the preset conditions, the lock identifier occupied by the task is released;
[0181] The preset conditions include: all task units in the task are completed; and / or the task executes a specific task unit.
[0182] In one embodiment, the first execution module 820 batch executes each group of task units in the target grouping result, including:
[0183] According to the task execution logic, a lock identifier is assigned to the first task, and each group of task units in the target grouping result is executed in batches;
[0184] The second execution module executes the acquired second task while executing the specific task unit in the first task, including:
[0185] When a specific task unit in the first task is executed, the lock identifier is released from the first task, and the lock identifier is allocated to a second task, and the second task is executed in parallel.
[0186] In one embodiment, the second execution module, when executing a specific task unit in the first task, releases the lock identifier from the first task, assigns the lock identifier to a second task, and executes the second task in parallel, including:
[0187] When executing a specific operation in a specific task unit of the first task, releasing the lock identifier from the first task, assigning the lock identifier to a second task, and executing the second task in parallel; wherein a task unit includes at least one operation, and the specific operation represents an operation whose execution time exceeds a preset time threshold;
[0188] The third execution module continues to execute the remaining groups of task units in the first task when the specific task unit in the first task is completed and the second task is not in the task-locked state, including:
[0189] When the specific operation in the specific task unit of the first task is completed and the second task is not in the task-locked state, the remaining operations in the specific task unit of the first task continue to be executed until all task units in the first task are completed.
[0190] In one embodiment, when a specific task unit in the first task is completed and the second task is not in a task-locked state, the third execution module continues to execute the remaining groups of task units in the first task, including:
[0191] When the second task is completed or a specific task unit in the second task is executed, releasing the locking identifier from the second task;
[0192] After the specific task unit in the first task is executed, the locking identifier is reallocated to the first task, and the remaining task units in the first task continue to be executed.
[0193] In one embodiment, after releasing the lock identifier from the second task, the third execution module is further configured to:
[0194] If the specific task unit in the first task has not been completed, assigning the lock identifier to a third task and executing the third task in parallel;
[0195] When the third task is completed or a specific task unit in the third task is executed, the locking identifier is released from the third task.
[0196] In one embodiment, the apparatus further comprises:
[0197] The fifth execution module is configured to stop executing the second task if the specific task unit in the first task has not been completed and the second task needs to use resources used by the specific task unit in the first task.
[0198] The device provided in this embodiment is based on the same concept as the method provided in the above embodiments of this application, can execute the method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the specific processing content of the method provided in the above embodiments of this application, and will not be repeated here.
[0199] Exemplary electronic devices
[0200] Another embodiment of the present application further provides an electronic device, see Figure 9 As shown, the electronic equipment includes:
[0201] Memory 900 and processor 910;
[0202] The memory 900 is connected to the processor 910 and is used to store programs;
[0203] The processor 910 is configured to implement the method for executing the task disclosed in any of the above embodiments by running the program stored in the memory 900 .
[0204] Specifically, the electronic device may further include: a bus, a communication interface 920 , an input device 930 and an output device 940 .
[0205] The processor 910, the memory 900, the communication interface 920, the input device 930 and the output device 940 are interconnected via a bus.
[0206] A bus may include a pathway that transfers information between components of a computer system.
[0207] Processor 910 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, or the like, or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. Alternatively, it can be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
[0208] The processor 910 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0209] The memory 900 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include program code, which may include computer operating instructions. More specifically, the memory 900 may include read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash, etc.
[0210] The input device 930 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0211] Output device 940 may include devices that allow information to be output to a user, such as a display screen, printer, speakers, etc.
[0212] The communication interface 920 may include any transceiver or similar device for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0213] The processor 910 executes the program stored in the memory 900 and calls other devices, which can be used to implement the various steps of the execution method of any task provided in the above embodiments of the present application.
[0214] Exemplary computer program products and storage media
[0215] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to perform the steps in the method for executing tasks according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0216] The computer program product may be written in any combination of one or more programming languages to implement the program code for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0217] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by the processor to execute the steps in the method for executing tasks according to various embodiments of the present application described in the above "Exemplary Method" section of this specification. The specific working content of the above-mentioned electronic device, as well as the specific working content of the above-mentioned computer program product and the computer program on the storage medium when being executed by the processor, can all be found in the contents of the above-mentioned method embodiments and will not be repeated here.
[0218] For the sake of simplicity, the aforementioned method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0219] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similarities between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simple, and for relevant details, reference can be made to the description of the method embodiments.
[0220] The steps in the methods of each embodiment of the present application can be adjusted in sequence, merged, and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0221] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be merged, divided, and deleted according to actual needs.
[0222] In the several embodiments provided in this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the terminal embodiments described above are merely illustrative. For example, the division of modules or submodules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0223] The modules or submodules described as separate components may or may not be physically separate, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules may be selected to achieve the purpose of this embodiment according to actual needs.
[0224] In addition, each functional module or submodule in each embodiment of the present application may be integrated into a processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into a single module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or software functional modules or submodules.
[0225] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0226] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, software units executed by a processor, or a combination of the two. The software units may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0227] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0228] The above description of the disclosed embodiments will enable those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is to be construed in the widest manner consistent with the principles and novel features disclosed herein.
Claims
1. A method for executing a task, characterized in that: include: Grouping multiple task units in a first task to determine a target grouping result; wherein the first task includes at least two subtasks, each subtask includes at least one task unit; and the target grouping result includes at least one group of task units; The task units of each group in the target grouping result are executed in batches according to the execution order of the task units in the subtasks until all the task units in the target grouping result are completed.
2. The method according to claim 1, characterized in that Batch executing any group of task units in the target grouping results, including: Execute the experimental preparation operations of the task unit in sequence; When the experiment preparation operation of the last task unit in the group of task units is completed, the experiment execution operation of the group of task units is executed in batches; In response to the experiment termination instruction, post-processing operations of the group of task units are executed.
3. The method according to claim 1, characterized in that The grouping of the plurality of task units in the first task and determining a target grouping result includes: grouping the task units in the first task using configuration parameters of the task units included in the first task to determine a first grouping result, wherein the first grouping result includes at least one group of task units; The target grouping result is determined according to the first grouping result.
4. The method according to claim 3, characterized in that The determining the target grouping result according to the first grouping result includes: The first grouping result is grouped again using the resource information corresponding to each group of task units to determine a target grouping result of the task units in the first task.
5. The method according to claim 3, characterized in that The configuration parameters include at least a task unit type. The grouping of the task units in the first task using the configuration parameters of the task units included in the first task to determine a first grouping result includes: Grouping the task units of the subtasks of the first task that have matching task unit types into a group to obtain a type grouping result, wherein the type grouping result includes multiple groups of task units of different types; The first grouping result is determined according to the type grouping result.
6. The method according to claim 5, characterized in that The configuration parameters further include: task unit execution parameters and / or task unit location information. The determining of the first grouping result according to the type grouping result includes: Perform task unit execution parameter matching and / or task unit position information matching on each group of task units in the type grouping result, and determine the first grouping result according to the matching result.
7. The method according to claim 4, characterized in that The performing secondary grouping on the first grouping result by utilizing the resource information corresponding to each group of task units to determine a target grouping result of the task units in the first task includes: According to the number and / or capacity of target execution devices corresponding to each group of task units, the first grouping result is subjected to secondary grouping processing to obtain the target grouping result.
8. The method according to claim 7, characterized in that Performing secondary grouping processing on the first grouping result according to the number and capacity of target execution devices corresponding to each group of task units to obtain the target grouping result includes: performing secondary grouping processing on the first grouping result according to the capacity of the target execution device corresponding to each group of task units to obtain a third grouping result; wherein the number of task unit groups included in the third grouping result is greater than or equal to the number of task unit groups included in the first grouping result; The third grouping result is grouped again according to the number of target execution devices corresponding to each group of task units to obtain the target grouping result; wherein the number of task unit groups included in the target grouping result is less than or equal to the number of task unit groups included in the third grouping result.
9. The method according to claim 7, characterized in that The method for determining the target execution device includes: Determine the execution device corresponding to any group of task units; The operating parameters of the execution devices corresponding to the group of task units are matched with the configuration parameters of the group of task units, and the execution devices that are successfully matched are determined as the target execution devices corresponding to the group of task units.
10. The method according to any one of claims 1 to 9, characterized in that The method further comprises: When executing a specific task unit in the first task, executing the acquired second task at the same time; the specific task unit refers to a task unit whose execution time exceeds a preset time threshold; When a specific task unit in the first task is completed and the second task is not in a task-locked state, continue to execute the remaining groups of task units in the first task; When a specific task unit in the first task is completed and the second task is in a task-locked state, the second task continues to be executed.
11. The method according to claim 10, characterized in that The method for determining the task locking state includes: If there is a task occupying a lock flag, determine that the task is in a task lock state; When the task releases the lock flag, determining that the task is not in a task lock state; The task release lock flag includes: When the task meets the preset conditions, the lock identifier occupied by the task is released; The preset conditions include: all task units in the task are completed; and / or the task executes a specific task unit.
12. The method according to claim 11, characterized in that The batch execution of each group of task units in the target grouping result includes: According to the task execution logic, a lock identifier is assigned to the first task, and each group of task units in the target grouping result is executed in batches; The step of simultaneously executing the acquired second task while executing the specific task unit in the first task includes: When a specific task unit in the first task is executed, the lock identifier is released from the first task, and the lock identifier is allocated to a second task, and the second task is executed in parallel.
13. The method according to claim 12, characterized in that The method of releasing the lock identifier from the first task when executing a specific task unit in the first task, allocating the lock identifier to a second task, and executing the second task in parallel includes: When executing a specific operation in a specific task unit of the first task, releasing the lock identifier from the first task, assigning the lock identifier to a second task, and executing the second task in parallel; wherein a task unit includes at least one operation, and the specific operation represents an operation whose execution time exceeds a preset time threshold; The step of continuing to execute the remaining groups of task units in the first task when the specific task unit in the first task is completed and the second task is not in a task-locked state includes: When the specific operation in the specific task unit of the first task is completed and the second task is not in the task-locked state, the remaining operations in the specific task unit of the first task continue to be executed until all task units in the first task are completed.
14. The method according to claim 12, characterized in that The step of continuing to execute the remaining groups of task units in the first task when the specific task unit in the first task is completed and the second task is not in a task-locked state includes: When the second task is completed or a specific task unit in the second task is executed, releasing the locking identifier from the second task; After the specific task unit in the first task is executed, the locking identifier is reallocated to the first task, and the remaining task units in the first task continue to be executed.
15. The method according to claim 14, characterized in that After releasing the lock identifier from the second task, the method further includes: If the specific task unit in the first task has not been completed, assigning the lock identifier to a third task and executing the third task in parallel; When the third task is completed or a specific task unit in the third task is executed, the locking identifier is released from the third task.
16. The method according to claim 10, characterized in that After executing the acquired second task while executing the specific task unit in the first task, the method further includes: When the specific task unit in the first task is not completely executed, if the second task needs to use the resources used by the specific task unit in the first task during execution, execution of the second task is stopped.
17. A task execution device, characterized in that: include: a grouping module, configured to group multiple task units in a first task and determine a target grouping result; wherein the first task includes at least two subtasks, each subtask includes at least one task unit; and the target grouping result includes at least one group of task units; The execution module is used to batch execute each group of task units in the target grouping result according to the execution order of the task units in the subtasks until all task units in the target grouping result are executed.
18. An electronic device, characterized in that: include: memory and processor; The memory is connected to the processor and is used to store programs; The processor implements the method for executing the task according to any one of claims 1 to 16 by running the program in the memory.
19. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method for executing the task according to any one of claims 1 to 16 is implemented.