CN116149822A - Task execution method, device, electronic equipment and storage medium - Google Patents

Task execution method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116149822A
CN116149822A CN202310153825.6A CN202310153825A CN116149822A CN 116149822 A CN116149822 A CN 116149822A CN 202310153825 A CN202310153825 A CN 202310153825A CN 116149822 A CN116149822 A CN 116149822A
Authority
CN
China
Prior art keywords
batch
task
tasks
data item
target data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310153825.6A
Other languages
Chinese (zh)
Inventor
杨晓军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202310153825.6A priority Critical patent/CN116149822A/en
Publication of CN116149822A publication Critical patent/CN116149822A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the disclosure provides a task execution method, a task execution device, electronic equipment and a storage medium. The task execution method comprises the following steps: for a target data item comprising a plurality of sub-data items, performing a first batch of tasks in response to a first update operation for the target data item, wherein the first batch of tasks comprises a plurality of sub-tasks for updating an attribute value of each sub-data item in the target data item based on the first update operation; in response to a second update operation for the target data item, a second batch of tasks is created and execution of the first batch of tasks is stopped, beginning execution of the second batch of tasks, wherein the second batch of tasks includes a plurality of sub-tasks for updating the attribute value of each sub-data item in the target data item based on the second update operation. By the technical scheme of the embodiment of the disclosure, under the condition of guaranteeing the final consistency of batch tasks, resources consumed by task execution are effectively saved, and task execution efficiency is improved.

Description

Task execution method, device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to a computer application technology, in particular to a task execution method, a task execution device, electronic equipment and a storage medium.
Background
In a project development and management scenario, one or more projects may be carefully managed by project management software. Typically, for items managed in the item management software, one or more work items will be set in the item space for each item. Each work item may be provided with one or more sub-work items, each sub-work item often including a plurality of data items.
In the related art, if a change is made to a certain data item, a batch task needs to be created, and each subtask in the throughput task changes the attribute value of the data item under each subtask item one by one. If the determination mode of the attribute value corresponding to the data item is changed for multiple times, a plurality of batch tasks are continuously created, the time for obtaining the execution result of the latest batch task is long, and the execution efficiency of the batch task is affected.
Disclosure of Invention
The disclosure provides a task execution method, a task execution device, electronic equipment and a storage medium, so as to optimize related task execution logic.
In a first aspect, an embodiment of the present disclosure provides a task execution method, including:
for a target data item comprising a plurality of sub-data items, performing a first batch of tasks in response to a first update operation for the target data item, wherein the first batch of tasks comprises a plurality of sub-tasks for updating an attribute value of each of the sub-data items in the target data item based on the first update operation;
In response to a second update operation for the target data item, a second batch of tasks is created and execution of the first batch of tasks is stopped, and execution of the second batch of tasks is started, wherein the second batch of tasks includes a plurality of sub-tasks for updating the attribute value of each of the sub-data items in the target data item based on the second update operation.
In a second aspect, an embodiment of the present disclosure further provides a task execution device, including:
a task execution module to execute a first batch of tasks for a target data item comprising a plurality of sub-data items in response to a first update operation for the target data item, wherein the first batch of tasks includes a plurality of sub-tasks to update an attribute value of each of the sub-data items in the target data item based on the first update operation;
and a task updating module, configured to create a second batch of tasks in response to a second updating operation for the target data item, and stop executing the first batch of tasks, and start executing the second batch of tasks, where the second batch of tasks includes a plurality of subtasks for updating the attribute value of each of the sub data items in the target data item based on the second updating operation.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the task execution method as described in any of the embodiments of the present disclosure.
In a fourth aspect, the presently disclosed embodiments also provide a storage medium containing computer-executable instructions for performing the task execution method of any of the presently disclosed embodiments when executed by a computer processor.
According to the technical scheme, a first batch task is executed in response to a first updating operation for a target data item, wherein the target data item comprises a plurality of sub data items, so that the attribute value of each sub data item in the target data item is updated through the sub task for executing the first batch task; then under the condition that a second updating operation aiming at the target data item is received, a second batch task is created and the execution of the first batch task is stopped in response to the second updating operation aiming at the target data item, so that the attribute value of each sub-data item in the target data item is updated based on the second updating operation, the batch task being executed can be discarded under the condition that a new batch task is generated, the execution of the new batch task can be quickly started, the calculation force is saved, the execution time of the second batch task is shortened, the technical problems that the time consumption for obtaining the execution result of the latest batch task is long and the execution efficiency of the batch task is low are solved, the resources consumed by the task execution are effectively saved under the condition that the final consistency of the batch task is ensured, the execution efficiency of the batch task is improved, and the technical effect of user experience is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1A is a flow chart of a task execution method according to an embodiment of the disclosure;
FIG. 1B is a schematic diagram of an interface display of a requirement work item page for applying the task execution method according to the embodiments of the present disclosure;
FIG. 2 is a flowchart of another task execution method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of another task execution method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a task execution device according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
It will be appreciated that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the corresponding legal regulations and the requirements of the relevant regulations.
Fig. 1A is a schematic flow chart of a task execution method provided by an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a case of executing a batch task including multiple sub-tasks, and is particularly applicable to a case of changing an update manner of an attribute value of a sub-data item for the same target data item, where the method may be executed by a task execution device, and the device may be implemented in a form of software and/or hardware, optionally, by an electronic device, where the electronic device may be a mobile terminal, a PC side, a server, or the like.
As shown in fig. 1A, the method of this embodiment may specifically include:
s110, responding to a first updating operation for a target data item containing a plurality of sub data items, and executing a first batch task.
Wherein a target data item may be understood as a data item comprising a plurality of sub-data items. In a work item management scenario, the target data item may be an entry in the work item for structurally managing information of a plurality of sub-work items. The target data item may be used to characterize the type of information contained by the child work item. For example, the target data item may be used to characterize information such as the name, length, authorized role, status, and quantity of each sub-work item. A child data item may be understood as a target data item corresponding to a single child work item. The attribute value of a sub-data item may be understood as the specific content to which the sub-data item corresponds. The attribute value of the child data item may be determined by the corresponding attribute field of the target data item.
In the embodiments of the present disclosure, a batch task may be understood as a task including a plurality of subtasks, i.e., a task set including a plurality of subtasks, which needs to be performed with the computing resources and the storage resources of the system. The subtasks are components in the batch tasks, each batch task is composed of a plurality of subtasks, and if all the subtasks are executed, the execution of the whole batch task is considered to be completed. The plurality of subtasks in the batch task can be independent tasks or tasks with association relations. Wherein the first batch task includes a plurality of sub-tasks for updating the attribute value of each sub-data item in the target data item based on the first update operation. Alternatively, a subtask may be understood as a task that updates the attribute values of individual sub-items.
Specifically, in response to a first update operation for a target data item, a first batch task for the target data item is created, and in turn, the first batch task is executed. Alternatively, the first update operation for the target data item may be an operation of modifying an attribute field corresponding to the target data item or an operation of adding the target data item.
Taking the management page of the requirement work item as an example, as shown in fig. 1B, a plurality of requirements may be included in the requirement work item, for example, a row corresponding to each of the sequence numbers 1-12 may be a requirement item (i.e., a sub-work item). The target data item may be data item a, data item B, data item C, data item D, data item E, data item F, data item G, or data item H, etc. in the first row. Each target data item is correspondingly provided with one or more attribute fields. The attribute value of each sub-work item relative to the target work item may be determined from the corresponding attribute field of the target data item. For example, for data item a, the attribute value corresponding to child work item 1 is attribute value A1. In response to adding or altering the attribute field of data item A, a first batch task is created for updating the attribute value of each child work item relative to data item A. The first batch task is used to update the attribute values A1, A2, A3, A4, A5, A6, … … one by one. Each update of the attribute value may correspond to a subtask. For example, sub-task 1 executing the first batch of tasks created for data item A may update attribute value A1, execution sub-task 2 may update attribute value A2, and so on. And under the condition that the first batch of tasks are executed, all the attribute values corresponding to all the sub data items under the data item A are updated.
S120, responding to a second updating operation aiming at the target data item, creating a second batch task, stopping executing the first batch task, and starting executing the second batch task.
Wherein the second batch of tasks includes a plurality of sub-tasks for updating the attribute value of each sub-data item in the target data item based on the second update operation.
Similarly, the second update operation for the target data item may be an operation of modifying an attribute field corresponding to the target data item or an operation of adding the target data item. It should be noted that, the update manner (e.g., update order and/or calculation manner, etc.) of the attribute value of each sub-data item in the target data item by the first update operation and the second update operation may be the same or different. The attribute field corresponding to the target data item may include a calculation field. Optionally, the first update operation and/or the second update operation comprises at least a modification operation for a corresponding computation field of the target data item. The calculation field may be a field for indicating a calculation manner of the attribute value of the child data item.
In the disclosed embodiment, performing the batch task requires a complete recalculation of the attribute fields associated with the target data item for all instances within the space. Specifically, in response to a second update operation for the target data item, a second batch of tasks corresponding to the second update operation is created, and execution of the first batch of tasks is stopped, and execution of the second batch of tasks is started. Optionally, stopping executing the first batch task and starting executing the second batch task includes: stopping executing the sub-tasks which are not executed in the first batch of tasks, and starting executing the sub-tasks of the second batch of tasks one by one. It will be appreciated that the update objects of the first batch of tasks and the second batch of tasks are the same, and are all attribute values of each sub-data item in the target data item.
In the related art, if the attribute values of a plurality of sub-data items corresponding to the target data item need to be updated, the batch task needs to be created, however, the time for executing one batch task is variable, and if the operation amount of the batch task is large, the execution time may need to be in the order of minutes. If the update mode of the attribute value corresponding to the sub data item is changed for multiple times, the creation of multiple batch tasks is continuously triggered. After continuously generating the batch tasks, in order to ensure the final consistency, the batch tasks generated later need to wait for the execution of the front batch tasks to be started after the execution of the front batch tasks is completed.
By adopting the processing mode, in order to ensure that the batch tasks generated after the final consistency cannot be executed first, otherwise, the final inconsistency situation can occur. Because batch tasks need to be executed in a queuing way, users need to wait for a period of time to wait for the users to really start to execute the last updating operation, so that user experience is affected.
In the embodiment of the present disclosure, in response to the second update operation for the target data item, the second batch task is created, and the execution of the first batch task is stopped, and the execution of the second batch task is started, particularly, only for such repeatedly appended batch tasks to be executed, but only in the case where the task result of the batch task created last time is desired, the execution of the last batch task can be quickly started and the batch task being executed is discarded, which has been solved.
According to the technical scheme, a first batch task is executed in response to a first updating operation for a target data item, wherein the target data item comprises a plurality of sub data items, so that the attribute value of each sub data item in the target data item is updated through the sub task for executing the first batch task; then under the condition that a second updating operation aiming at the target data item is received, a second batch task is created and the execution of the first batch task is stopped in response to the second updating operation aiming at the target data item, so that the attribute value of each sub-data item in the target data item is updated based on the second updating operation, the batch task being executed can be discarded under the condition that a new batch task is generated, the execution of the new batch task can be quickly started, the calculation force is saved, the execution time of the second batch task is shortened, the technical problems that the time consumption for obtaining the execution result of the latest batch task is long and the execution efficiency of the batch task is low are solved, the resources consumed by the task execution are effectively saved under the condition that the final consistency of the batch task is ensured, the execution efficiency of the batch task is improved, and the technical effect of user experience is improved.
Fig. 2 is a flowchart of another task execution method according to an embodiment of the disclosure. Technical solution of the present embodiment, on the basis of the above embodiment, a technical description of how to determine that the second update operation for the target data item is received is added. Optionally, the task execution method further includes: under the condition that the preset task detection condition is detected to be reached, determining a second batch of tasks corresponding to the first batch of tasks; and determining that a second updating operation aiming at the target data item is received under the condition that the creation time of the second batch of tasks is later than that of the first batch of tasks. Reference is made to the description of this example for a specific implementation. The technical features that are the same as or similar to those of the foregoing embodiments are not described herein.
As shown in fig. 2, the method of this embodiment may specifically include:
s210, responding to a first updating operation for a target data item containing a plurality of sub data items, and executing a first batch task.
S220, responding to a second updating operation for the target data item, and creating a second batch task.
And S230, determining a second batch of tasks corresponding to the first batch of tasks under the condition that the preset task detection condition is detected to be reached.
The task detection conditions may be set according to actual requirements, for example, may be detected in real time or may be detected in response to a preset trigger event, and in the embodiment of the present disclosure, specific content of the task detection conditions is not limited.
Illustratively, the preset task detection conditions may include, but are not limited to, at least one of the following:
for each sub-task in the first batch of tasks, before each sub-task is executed;
the time interval from the last task detection time reaches a preset time interval;
the current time point is a preset task detection time point;
when creating the second batch of tasks.
The second batch task is the latest batch task corresponding to the target data item. In other words, the second batch task is a batch task whose creation time is closest to the current time.
Optionally, determining a second batch task corresponding to the first batch task includes: and determining a second batch task corresponding to the first batch task through the attribute field of the target data item corresponding to the first batch task and the creation time of the batch task corresponding to the attribute field. Or determining the second batch task through a second task identifier corresponding to the second batch task stored in the preset storage space. The preset storage space may be a preset space capable of storing the second task identifier. For example, the preset memory space may be a global memory space, such as Redis or other memory space.
S240, stopping executing the first batch task and starting executing the second batch task when the creation time of the second batch task is later than the creation time of the first batch task.
It should be noted that, in the embodiment of the present disclosure, the first batch task and the second batch task may be the same batch task or different batch tasks. Specifically, it may be determined whether the first batch task and the second batch task are the same batch task by the creation time of the second batch task and the first batch task. It may also be determined if the second batch task is the most recent batch task corresponding to the target data item in the event that the first batch task and the second batch task are not the same.
It will be appreciated that the creation time of the second batch task is later than the creation time of the first batch task, which means that the second batch task is a different batch task from the first batch task, and the second batch task is newer than the first batch task, i.e. there is a continuous update of the batch task currently being executed, and the first batch task currently being executed is not the latest batch task, and may be discarded in the final consistency scenario, and the second batch task is a later created batch task, i.e. a batch task that is more focused by the user, at this time, the execution of the first batch task may be stopped, and the execution of the second batch task may be started.
On the basis of any optional technical scheme of the embodiment of the disclosure, the task execution method further comprises the following steps: and continuing to execute the first batch task when the creation time of the second batch task is the same as the creation time of the first batch task. It can be understood that the creation time of the second batch task is the same as the creation time of the first batch task, which means that the second batch task is the same as the first batch task, that is, the first batch task currently executed is the latest batch task, so that the first batch task can be continuously executed, and the execution efficiency of the batch task is ensured on the premise of ensuring the final consistency.
On the basis of any optional technical scheme of the embodiment of the disclosure, the task execution method further comprises the following steps: and under the condition that the creation time of the second batch of tasks is earlier than that of the first batch of tasks, continuing to execute the first batch of tasks and generating alarm information for prompting business logic abnormality.
It should be noted that, in theory, the creation time of the first batch task being executed or already executed is later than the creation time of the batch task newly created, and at this time, an alarm is needed to check whether a logic problem exists or not by the user, so as to eliminate the vulnerability.
According to the technical scheme, under the condition that the preset task detection condition is detected to be reached, the second batch task corresponding to the first batch task is determined, so that the detection of the new batch task can be automatically realized, and a guarantee is provided for timely execution of the new batch task. Further, in the case that the creation time of the second batch task is later than the creation time of the first batch task, it is determined that the second update operation for the target data item is received, whether the first batch task being executed is the latest batch task or not can be determined by the creation time of the second batch task and the creation time of the first batch task, and thus, the final consistency of task execution is ensured, so that the final data must coincide with the last task instruction regardless of how many times the batch task is created and concurrently executed.
Fig. 3 is a flowchart of another task execution method according to an embodiment of the disclosure. The technical scheme of the embodiment adds the technical description of how to determine the creation time of the second batch task and the first batch task based on the embodiment. Optionally, the task execution method further includes: acquiring a first task identifier corresponding to the first batch task and a second task identifier corresponding to the second batch task, wherein the second batch task is the latest batch task corresponding to the target data item; determining whether the creation time of the second batch of tasks is later than the creation time of the first batch of tasks based on the first task identification and the second task identification. Reference is made to the description of this example for a specific implementation. The technical features that are the same as or similar to those of the foregoing embodiments are not described herein.
As shown in fig. 3, the method of this embodiment may specifically include:
s310, for a target data item comprising a plurality of sub-data items, executing a first batch task in response to a first update operation for the target data item.
Specifically, in response to a first update operation for a target data item, a first batch of tasks for the target data item is created, and a first task identification corresponding to the first task is recorded. Optionally, a first task identifier corresponding to the first batch task is generated based on the creation time of the first batch task. Illustratively, the first task identification may be a timestamp generated based on the creation time of the first batch of tasks, or a version number generated based on the creation time of the first batch of tasks, or the like. The version number may include one of information such as numerals, characters, symbols, etc., or a combination of information including a plurality of kinds of information.
S320, responding to a second updating operation for the target data item, and creating a second batch task.
S330, determining a second batch of tasks corresponding to the first batch of tasks under the condition that the preset task detection condition is detected to be reached.
It should be noted that, it is determined that the second batch task corresponding to the first batch task is not executed. The purpose of determining the second batch task is to determine the most current batch task for further verifying whether the first batch task is the most current batch task.
S340, acquiring a first task identifier corresponding to the first batch of tasks and a second task identifier corresponding to the second batch of tasks.
Optionally, after creating the second batch task, further comprising: generating a second task identifier of the second batch task based on the creation time of the second batch task, and storing the second task identifier into a preset storage space.
The second task identifier is a task identifier corresponding to a second batch of tasks. In order to facilitate subsequent application of the first task identity and the second task identity, the second task identity may be generated in the same manner as the first task identity. Similarly, the second task identification may be a timestamp generated based on the creation time of the second batch of tasks, or a version number generated based on the creation time of the second batch of tasks, or the like. The version number may include one of information such as numerals, characters, symbols, etc., or a combination of information including a plurality of kinds of information.
In the embodiment of the disclosure, for a first batch task being executed, a second task identifier corresponding to a second batch task corresponding to the first batch task may be acquired in advance before each subtask of the first batch task is executed. And determining a first task identifier of a first batch of tasks corresponding to the subtasks to be executed, and further determining which task of the first batch of tasks and the second batch of tasks is the latest batch of tasks based on the first task identifier and the second task identifier.
S350, determining whether the creation time of the second batch of tasks is later than the creation time of the first batch of tasks based on the first task identification and the second task identification.
Specifically, the first task identifier and the second task identifier may be compared, and whether the creation time of the second batch of tasks is later than the creation time of the first batch of tasks is determined based on the comparison result.
S360, stopping executing the first batch task and starting executing the second batch task under the condition that the creation time of the second batch task is later than that of the first batch task.
On the basis of any optional technical scheme of the embodiment of the disclosure, the task execution method further comprises the following steps: and continuing to execute the first batch of tasks under the condition that the second task identification is not acquired. Further, the method can also be used for prompting that the prompting information for generating the second task identifier is not acquired for the user to check.
According to the technical scheme, the early and late times of the creation time of the first batch task at the creation time of the second batch task are determined based on the first task identifier corresponding to the first batch task and the second task identifier corresponding to the second batch task, and a complex processing process is not needed, so that whether the second batch task is a batch task newer than the first batch task can be simply and quickly determined, and the execution efficiency of the latest batch task is fully ensured.
Fig. 4 is a schematic structural diagram of a task execution device according to an embodiment of the present disclosure, as shown in fig. 4, where the device includes: a task execution module 410 and a task update module 420.
Wherein the task execution module 410 is configured to execute, for a target data item including a plurality of sub-data items, a first batch task in response to a first update operation for the target data item, where the first batch task includes a plurality of sub-tasks for updating an attribute value of each of the sub-data items in the target data item based on the first update operation; a task update module 420, configured to create a second batch of tasks in response to a second update operation for the target data item, and stop executing the first batch of tasks, and start executing the second batch of tasks, where the second batch of tasks includes a plurality of subtasks for updating the attribute value of each of the sub data items in the target data item based on the second update operation.
According to the technical scheme, a first batch task is executed in response to a first updating operation for a target data item, wherein the target data item comprises a plurality of sub data items, so that the attribute value of each sub data item in the target data item is updated through the sub task for executing the first batch task; then under the condition that a second updating operation aiming at the target data item is received, a second batch task is created and the execution of the first batch task is stopped in response to the second updating operation aiming at the target data item, so that the attribute value of each sub-data item in the target data item is updated based on the second updating operation, the batch task being executed can be discarded under the condition that a new batch task is generated, the execution of the new batch task can be quickly started, the calculation force is saved, the execution time of the second batch task is shortened, the technical problems that the time consumption for obtaining the execution result of the latest batch task is long and the execution efficiency of the batch task is low are solved, the resources consumed by the task execution are effectively saved under the condition that the final consistency of the batch task is ensured, the execution efficiency of the batch task is improved, and the technical effect of user experience is improved.
On the basis of any optional technical solution of the embodiments of the present disclosure, optionally, the task execution device further includes: and detecting a trigger module and an operation updating module. The detection triggering module is used for determining a second batch of tasks corresponding to the first batch of tasks under the condition that a preset task detection condition is detected to be met before the first batch of tasks are stopped to be executed and the second batch of tasks are started to be executed; the operation updating module is used for executing the operation of stopping executing the first batch task and starting executing the second batch task under the condition that the creation time of the second batch task is later than the creation time of the first batch task. .
On the basis of any optional technical solution of the embodiments of the present disclosure, optionally, the task execution device further includes: the task identification acquisition module and the creation time determination module. The task identifier obtaining module is configured to obtain a first task identifier corresponding to the first batch of tasks and a second task identifier corresponding to the second batch of tasks, where the second batch of tasks is the latest batch of tasks corresponding to the target data item; the creation time determining module is used for determining whether the creation time of the second batch of tasks is later than the creation time of the first batch of tasks based on the first task identification and the second task identification.
On the basis of any optional technical scheme of the embodiments of the present disclosure, optionally, the task execution device further includes an identifier creation module, configured to, after creating a second batch of tasks, generate a second task identifier of the second batch of tasks based on a creation time of the second batch of tasks, and store the second task identifier in a preset storage space.
Optionally, on the basis of any optional technical solution of the embodiments of the present disclosure, the task execution device further includes a continue execution module. And the continuous execution module is used for continuously executing the first batch task under the condition that the creation time of the second batch task is the same as the creation time of the first batch task or the second task identification is not acquired.
On the basis of any optional technical scheme of the embodiments of the present disclosure, optionally, the task execution device further includes an alarm module. The alarm module is used for continuously executing the first batch task and generating alarm information for prompting abnormal business logic under the condition that the creation time of the second batch task is earlier than that of the first batch task.
On the basis of any optional technical solution of the embodiments of the present disclosure, optionally, the task update module is specifically configured to:
stopping executing the sub-tasks which are not executed in the first batch of tasks, and starting executing the sub-tasks of the second batch of tasks one by one.
Optionally, on the basis of any optional technical solution of the embodiments of the present disclosure, the first updating operation and/or the second updating operation at least includes a modification operation for a computation field corresponding to the target data item.
The task execution device provided by the embodiment of the disclosure can execute the task execution method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of executing the task execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring now to fig. 5, a schematic diagram of an electronic device (e.g., a terminal device or server in fig. 5) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 5, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The electronic device provided by the embodiment of the present disclosure and the task execution method provided by the foregoing embodiment belong to the same inventive concept, and technical details not described in detail in the present embodiment may be referred to the foregoing embodiment, and the present embodiment has the same beneficial effects as the foregoing embodiment.
The present disclosure provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the task execution method provided by the above embodiments.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: for a target data item comprising a plurality of sub-data items, performing a first batch of tasks in response to a first update operation for the target data item, wherein the first batch of tasks comprises a plurality of sub-tasks for updating an attribute value of each of the sub-data items in the target data item based on the first update operation; in response to a second update operation for the target data item, a second batch of tasks is created and execution of the first batch of tasks is stopped, and execution of the second batch of tasks is started, wherein the second batch of tasks includes a plurality of sub-tasks for updating the attribute value of each of the sub-data items in the target data item based on the second update operation.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a task execution method, including:
for a target data item comprising a plurality of sub-data items, performing a first batch of tasks in response to a first update operation for the target data item, wherein the first batch of tasks comprises a plurality of sub-tasks for updating an attribute value of each of the sub-data items in the target data item based on the first update operation;
in response to a second update operation for the target data item, a second batch of tasks is created and execution of the first batch of tasks is stopped, and execution of the second batch of tasks is started, wherein the second batch of tasks includes a plurality of sub-tasks for updating the attribute value of each of the sub-data items in the target data item based on the second update operation.
According to one or more embodiments of the present disclosure, there is provided a method of example one, further comprising:
optionally, before stopping executing the first batch task and starting executing the second batch task, the method further comprises:
under the condition that the preset task detection condition is detected to be reached, determining a second batch of tasks corresponding to the first batch of tasks;
And determining that a second updating operation aiming at the target data item is received under the condition that the creation time of the second batch of tasks is later than that of the first batch of tasks.
According to one or more embodiments of the present disclosure, there is provided a method of example two, further comprising:
optionally, acquiring a first task identifier corresponding to the first batch task and a second task identifier corresponding to the second batch task, where the second batch task is the latest batch task corresponding to the target data item;
determining whether the creation time of the second batch of tasks is later than the creation time of the first batch of tasks based on the first task identification and the second task identification.
According to one or more embodiments of the present disclosure, there is provided a method of example three, further comprising:
optionally, after the creating the second batch task, the method further includes:
generating a second task identifier of the second batch task based on the creation time of the second batch task, and storing the second task identifier into a preset storage space.
According to one or more embodiments of the present disclosure, there is provided a method of example two, further comprising:
Optionally, if the creation time of the second batch task is the same as the creation time of the first batch task, or the second task identifier is not acquired, continuing to execute the first batch task.
According to one or more embodiments of the present disclosure, there is provided a method of example two, further comprising:
optionally, if the creation time of the second batch task is earlier than the creation time of the first batch task, continuing to execute the first batch task, and generating alarm information for prompting business logic abnormality.
According to one or more embodiments of the present disclosure, there is provided a method of example one [ example seven ], further comprising:
optionally, the stopping executing the first batch task and starting executing the second batch task include:
stopping executing the sub-tasks which are not executed in the first batch of tasks, and starting executing the sub-tasks of the second batch of tasks one by one.
According to one or more embodiments of the present disclosure, there is provided a method of example one, further comprising:
optionally, the first updating operation and/or the second updating operation at least includes a modification operation for a computation field corresponding to the target data item.
According to one or more embodiments of the present disclosure, there is provided a task execution device, including:
a task execution module to execute a first batch of tasks for a target data item comprising a plurality of sub-data items in response to a first update operation for the target data item, wherein the first batch of tasks includes a plurality of sub-tasks to update an attribute value of each of the sub-data items in the target data item based on the first update operation;
and a task updating module, configured to create a second batch of tasks in response to a second updating operation for the target data item, and stop executing the first batch of tasks, and start executing the second batch of tasks, where the second batch of tasks includes a plurality of subtasks for updating the attribute value of each of the sub data items in the target data item based on the second updating operation.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (11)

1. A method of performing a task, comprising:
for a target data item comprising a plurality of sub-data items, performing a first batch of tasks in response to a first update operation for the target data item, wherein the first batch of tasks comprises a plurality of sub-tasks for updating an attribute value of each of the sub-data items in the target data item based on the first update operation;
In response to a second update operation for the target data item, a second batch of tasks is created and execution of the first batch of tasks is stopped, and execution of the second batch of tasks is started, wherein the second batch of tasks includes a plurality of sub-tasks for updating the attribute value of each of the sub-data items in the target data item based on the second update operation.
2. The task execution method according to claim 1, further comprising, before the stopping the execution of the first batch task and starting the execution of the second batch task:
under the condition that the preset task detection condition is detected to be reached, determining a second batch of tasks corresponding to the first batch of tasks;
and executing the operation of stopping executing the first batch task and starting executing the second batch task under the condition that the creation time of the second batch task is later than the creation time of the first batch task.
3. The task execution method according to claim 2, characterized by further comprising:
acquiring a first task identifier corresponding to the first batch task and a second task identifier corresponding to the second batch task, wherein the second batch task is the latest batch task corresponding to the target data item;
Determining whether the creation time of the second batch of tasks is later than the creation time of the first batch of tasks based on the first task identification and the second task identification.
4. A task execution method according to claim 3, further comprising, after said creating the second batch of tasks:
generating a second task identifier of the second batch task based on the creation time of the second batch task, and storing the second task identifier into a preset storage space.
5. A task execution method according to claim 3, further comprising:
and continuing to execute the first batch task under the condition that the creation time of the second batch task is the same as the creation time of the first batch task or the second task identification is not acquired.
6. The task execution method according to claim 2, characterized by further comprising:
and under the condition that the creation time of the second batch of tasks is earlier than the creation time of the first batch of tasks, continuing to execute the first batch of tasks, and generating alarm information for prompting business logic abnormality.
7. The task execution method according to claim 1, wherein stopping execution of the first batch task and starting execution of the second batch task comprise:
Stopping executing the sub-tasks which are not executed in the first batch of tasks, and starting executing the sub-tasks of the second batch of tasks one by one.
8. Task execution method according to claim 1, characterized in that said first updating operation and/or said second updating operation comprise at least a modifying operation for a calculation field corresponding to said target data item.
9. A task execution device, characterized by comprising:
a task execution module to execute a first batch of tasks for a target data item comprising a plurality of sub-data items in response to a first update operation for the target data item, wherein the first batch of tasks includes a plurality of sub-tasks to update an attribute value of each of the sub-data items in the target data item based on the first update operation;
and a task updating module, configured to create a second batch of tasks in response to a second updating operation for the target data item, and stop executing the first batch of tasks, and start executing the second batch of tasks, where the second batch of tasks includes a plurality of subtasks for updating the attribute value of each of the sub data items in the target data item based on the second updating operation.
10. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the task execution method of any one of claims 1-8.
11. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the task execution method of any one of claims 1-8.
CN202310153825.6A 2023-02-17 2023-02-17 Task execution method, device, electronic equipment and storage medium Pending CN116149822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310153825.6A CN116149822A (en) 2023-02-17 2023-02-17 Task execution method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310153825.6A CN116149822A (en) 2023-02-17 2023-02-17 Task execution method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116149822A true CN116149822A (en) 2023-05-23

Family

ID=86356036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310153825.6A Pending CN116149822A (en) 2023-02-17 2023-02-17 Task execution method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116149822A (en)

Similar Documents

Publication Publication Date Title
CN109523187B (en) Task scheduling method, device and equipment
CN111221550B (en) Rule updating method and device for streaming computing and streaming computing system
US11755337B2 (en) Techniques for managing dependencies of an orchestration service
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN111625422B (en) Thread monitoring method, thread monitoring device, electronic equipment and computer readable storage medium
CN115357350A (en) Task configuration method and device, electronic equipment and computer readable medium
CN111596992B (en) Navigation bar display method and device and electronic equipment
CN116302271A (en) Page display method and device and electronic equipment
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN116149822A (en) Task execution method, device, electronic equipment and storage medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN110941683B (en) Method, device, medium and electronic equipment for acquiring object attribute information in space
CN111274104B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN112083945A (en) NPM installation package update prompting method and device, electronic equipment and storage medium
CN111949528A (en) Memory leak detection method and device, electronic equipment and storage medium
CN111984496A (en) Method, device, medium and electronic equipment for monitoring stack memory leakage
CN111026571B (en) Processor down-conversion processing method and device and electronic equipment
CN114398233B (en) Load abnormality detection method and device, server and storage medium
CN110262756B (en) Method and device for caching data
CN117992204A (en) Memory detection method, device, equipment and storage medium
CN112905167B (en) Application operation method and device and electronic equipment
CN116263718A (en) Process management method and device, storage medium and electronic equipment
CN116069227A (en) Interface interaction method, device, equipment and storage medium
CN116562248A (en) Form processing method, apparatus, device, storage medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination