CN113722055A - Data processing method and device, electronic equipment and computer readable medium - Google Patents

Data processing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113722055A
CN113722055A CN202011354721.4A CN202011354721A CN113722055A CN 113722055 A CN113722055 A CN 113722055A CN 202011354721 A CN202011354721 A CN 202011354721A CN 113722055 A CN113722055 A CN 113722055A
Authority
CN
China
Prior art keywords
task
processed
tasks
tree
task queue
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
CN202011354721.4A
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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011354721.4A priority Critical patent/CN113722055A/en
Publication of CN113722055A publication Critical patent/CN113722055A/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/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the disclosure discloses a data processing method, a data processing device, an electronic device and a computer readable medium. One embodiment of the method comprises: acquiring a set number of tasks to be processed from a task queue; responding to at least two target tasks to be processed with dependency relationship in the set number of tasks to be processed, and constructing a task tree through the at least two target tasks to be processed; sequencing the set number of tasks to be processed based on the task tree to obtain a corrected task queue; and processing data of the tasks to be processed in the correction task queue. The implementation method realizes the orderly execution of the tasks to be processed with the dependency relationship according to the task tree, and further improves the data processing efficiency.

Description

Data processing method and device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer-readable medium.
Background
With the development of information technology, electronic devices can process data of various applications. Accordingly, the amount of data that the electronic device needs to process is increasing. Generally, an electronic device performs data processing by processing tasks, and a processor of the electronic device can simultaneously process a plurality of processing tasks.
In practice, the electronic device may perform data interaction with other devices, and data interaction may also be performed between multiple applications on the electronic device, and there is a dependency relationship between processing tasks in the data interaction process. For example, processing task B may need to be executed after processing task a is completed before data processing can occur. In the conventional data processing method, data processing is generally performed on processing tasks according to the ordering of the processing tasks in a task queue. When a plurality of processing tasks with mutual dependency relationship exist, the existing data processing method cannot process the processing tasks in order according to the dependency relationship among the processing tasks, and further, the processing tasks can be executed after other processing tasks with dependency relationship are completed in the process of executing the processing tasks. Thus, data processing efficiency is not high.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose data processing methods, apparatuses, electronic devices, and computer readable media to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a data processing method, including: acquiring a set number of tasks to be processed from a task queue; responding to at least two target tasks to be processed with dependency relationship in the set number of tasks to be processed, and constructing a task tree through the at least two target tasks to be processed; sequencing the set number of tasks to be processed based on the task tree to obtain a corrected task queue; and processing data of the tasks to be processed in the correction task queue.
In a second aspect, some embodiments of the present disclosure provide a data processing apparatus comprising: a to-be-processed task obtaining unit configured to obtain a set number of to-be-processed tasks from the task queue; the task tree building unit is configured to respond to the at least two target tasks to be processed with dependency relationship in the set number of tasks to be processed, and build a task tree through the at least two target tasks to be processed; a modified task queue constructing unit configured to sort the set number of tasks to be processed based on the task tree to obtain a modified task queue; and the data processing unit is configured to perform data processing on the tasks to be processed in the correction task queue.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: the data processing method of some embodiments of the disclosure is used for processing data, so that the data processing efficiency of the to-be-processed task with the incidence relation is improved. Specifically, the inventors found that the reason why the processing efficiency of the task to be processed is not high is that: the tasks to be processed with dependency relationships cannot be processed in order. Based on this, the data processing method of some embodiments of the present disclosure constructs a task tree from the to-be-processed tasks having the dependency relationship, and then obtains a modified task queue including the task tree. And then, processing data of the tasks to be processed in the correction task queue. And the to-be-processed tasks in the corrected task queue are subjected to data processing, so that the sequence of the to-be-processed tasks is adjusted, the to-be-processed tasks with the dependency relationship can be sequentially executed according to the task tree, and the data processing efficiency is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of an application scenario of a data processing method of some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a data processing method according to the present disclosure;
FIG. 3 is a flow diagram of further embodiments of a data processing method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of data processing methods according to the present disclosure;
FIG. 5 is a schematic block diagram of some embodiments of a data processing apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present 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 are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of a data processing method according to some embodiments of the present disclosure.
The execution main body 101 first acquires A, B, C, D, E, F, G a set number of pending tasks from the task queue 102. The executing agent 101 detects that there is a dependency between the pending tasks A, B, C, D, E, F, G: the task C to be processed can be executed only after the task B to be processed is completed, and the task B to be processed can be executed only after the task A to be processed is completed. The tasks F and G to be processed can be executed only after the task E to be processed is completed. Based on this, the execution body 101 can construct two task trees. The first task tree 103 is a series of trees A → B → C; the second task tree 104 is: e → F and E → G. To improve the data processing efficiency, the execution main body 101 may rearrange the tasks to be processed according to the first task tree 103 and the second task tree 104 to obtain the modified task queue 105. And finally, processing the data of the tasks to be processed in the correction task queue 105. Therefore, the tasks to be processed with the dependency relationship can be processed preferentially, and the problems of waiting or information processing congestion and the like caused by the dependency relationship and the failure of orderly processing the tasks to be processed according to the task tree are avoided. Therefore, the data processing efficiency of the tasks to be processed is improved.
It should be understood that the number of execution bodies 101 in fig. 1 is merely illustrative. There may be any number of execution entities 101, as desired for implementation.
With continued reference to fig. 2, fig. 2 illustrates a flow 200 of some embodiments of a data processing method according to the present disclosure. The data processing method comprises the following steps:
step 201, a set number of tasks to be processed are obtained from the task queue.
In some embodiments, an execution main body of the data processing method (for example, the execution main body 101 shown in fig. 1) may obtain a set number of to-be-processed tasks from the task queue by a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
To execute the pending tasks, the execution principal may first retrieve a set number of pending tasks from the task queue. The task queue stores a plurality of tasks to be processed, and the tasks to be processed are usually arranged in the task queue according to the generated time.
Step 202, in response to that at least two target tasks to be processed with dependency relationship exist in the set number of tasks to be processed, a task tree is constructed through the at least two target tasks to be processed.
In some embodiments, the execution subject may first detect whether there is a pending task having a dependency relationship among a set number of pending tasks. And if not, sequentially processing the data according to the current sequence of the set number of the tasks to be processed. And if so, constructing a task tree through the at least two target tasks to be processed. The task tree may include one root node pending task (i.e., a pending task corresponding to a root node of the task tree) and a plurality of child node pending tasks (i.e., pending tasks corresponding to child nodes of the task tree). According to the actual situation, the structure of the task tree and the number of the tasks to be processed can be different.
Step 203, sorting the set number of tasks to be processed based on the task tree to obtain a modified task queue.
In some embodiments, as can be seen from the above description, the target tasks to be processed included in the task tree have a dependency relationship therebetween, and constructing the task tree can enable a plurality of target tasks to be processed having a dependency relationship to be executed in order, which is beneficial to improving data processing efficiency. In order to further improve the data processing efficiency, the execution main body may sort the set number of tasks to be processed based on the task tree, so as to obtain a modified task queue. The execution agent may arrange the task tree at a front position in the modified task queue, and preferentially execute the task tree. Therefore, the tasks to be processed with the dependency relationship can be processed in the limited threads as much as possible, and the data processing efficiency is improved. For example, the total number of threads is 8, and there are 10 pending tasks, where the task tree includes 7 pending tasks. If the task tree is placed in a later position, 3 of the 8 threads can independently process 3 independent tasks to be processed. The remaining 5 threads cannot process a task tree containing 7 pending tasks at once. Thus, the remaining 5 threads can process other pending tasks, and the task tree requires deferred processing. If the task tree is arranged in front of the revised task queue. Then 8 threads can process 7 pending tasks of the task tree at once and the remaining threads can process other pending tasks individually.
And step 204, performing data processing on the to-be-processed tasks in the correction task queue.
After the correction task queue is obtained, the execution main body can sequentially perform data processing according to the sequence of the tasks to be processed in the correction task queue.
According to the data processing method disclosed by some embodiments of the disclosure, data processing is performed by the data processing method disclosed by some embodiments of the disclosure, so that the data processing efficiency of the to-be-processed task with the incidence relation is improved. Specifically, the inventors found that the reason why the processing efficiency of the task to be processed is not high is that: the tasks to be processed with dependency relationships cannot be processed in order. Based on this, the data processing method of some embodiments of the present disclosure constructs a task tree from the to-be-processed tasks having the dependency relationship, and then obtains a modified task queue including the task tree. And then, processing data of the tasks to be processed in the correction task queue. And the to-be-processed tasks in the corrected task queue are subjected to data processing, so that the sequence of the to-be-processed tasks is adjusted, the to-be-processed tasks with the dependency relationship can be sequentially executed according to the task tree, and the data processing efficiency is improved.
With continued reference to fig. 3, fig. 3 illustrates a flow 300 of some embodiments of a data processing method according to the present disclosure. The data processing method comprises the following steps:
step 301, a set number of tasks to be processed are obtained from a task queue.
The content of step 301 is the same as that of step 201, and is not described in detail here.
Step 302, in response to that at least two target tasks to be processed with dependency relationships exist in the set number of tasks to be processed, determining a call relationship between the at least two target tasks to be processed.
When there are a plurality of target to-be-processed tasks having a dependency relationship, the execution principal may first determine a call relationship between the plurality of target to-be-processed tasks. The calling relationship may be: the execution of the target task C to be processed can be executed only after the target task B to be processed is completed; the execution of the target to-be-processed task B requires the completion of the target to-be-processed task a before execution.
Step 303, constructing a task tree based on the calling relationship.
After the call relationship is obtained, the execution subject can construct a task tree according to the call relationship. For example, the above-mentioned calling relationship may be: the execution of the target task C to be processed can be executed only after the target task B to be processed is completed; the execution of the target to-be-processed task B requires the completion of the target to-be-processed task a before execution. The corresponding task tree may be: a → B → C.
And 304, sequencing the set number of tasks to be processed based on the task tree to obtain a corrected task queue.
In some optional implementation manners of some embodiments, the sorting the set number of tasks to be processed based on the task tree to obtain a modified task queue may include: and responding to one task tree, setting the task tree at the head of the task queue to obtain the corrected task queue.
When only one task tree exists, the execution main body can directly set the task tree at the head of the task queue and preferentially process the task tree so as to improve the data processing efficiency.
In some optional implementation manners of some embodiments, the sorting the set number of tasks to be processed based on the task tree to obtain a modified task queue may include the following steps:
the method comprises the first step of responding to a plurality of task trees, and determining the number of the hierarchies of each task tree in the plurality of task trees.
When there are multiple task trees, the multiple task trees may differ in structural complexity, number of pending tasks involved, and the like. To do this, the execution agent needs to determine the number of levels per task tree. The number of levels is used to characterize the "depth" of the task tree. For example, when the task tree includes a root node to-be-processed task and a child node to-be-processed task, the number of the levels of the task tree may be considered to be 2; when the task tree includes a root node to-be-processed task and a child node to-be-processed task, and the child node to-be-processed task is connected to a leaf node to-be-processed task, the number of the levels of the task tree may be considered to be 3.
And secondly, sequencing a plurality of task trees according to the sequence of the number of the hierarchies from large to small to obtain a task tree group, and setting the task tree group at the head of the task queue to obtain the correction task queue.
Generally, the larger the number of levels, the more complex the degree of dependency between the tasks to be processed contained in the task tree. For this purpose, the execution subject may sort the plurality of task trees in order of decreasing number of hierarchies to obtain a task tree group. Namely, the task trees in the task tree group are arranged according to the order of the number of the hierarchies from large to small. Then, the task tree group is set at the head of the task queue to obtain the modified task queue. In this manner, the tasks to be processed in the task tree group may be processed first. In the task tree group, task trees with large number of hierarchies can be processed preferentially. The data processing efficiency is improved.
And 305, performing data processing on the to-be-processed tasks in the correction task queue.
After the correction task queue is obtained, the execution main body can sequentially perform data processing according to the sequence of the tasks to be processed in the correction task queue.
The content of step 305 is the same as that of step 204, and is not described in detail here.
With further reference to FIG. 4, a flow 400 of further embodiments of a data processing method is shown. The flow 400 of the data processing method includes the following steps:
step 401, obtaining a set number of to-be-processed tasks from a task queue.
Step 402, in response to that at least two target tasks to be processed with dependency relationship exist in the set number of tasks to be processed, a task tree is constructed through the at least two target tasks to be processed.
Step 403, sorting the set number of tasks to be processed based on the task tree to obtain a modified task queue.
The contents of steps 401 to 403 are the same as those of steps 201 to 203, and are not described in detail here.
Step 404, extracting the task tree from the correction task queue.
In order to improve the data processing efficiency, the execution main body may extract the task tree from the modified task queue, and perform data processing on the task tree first.
Step 405, setting threads according to the hierarchical relation of the task tree.
The tasks to be processed contained in the task tree have dependency relationship, and the execution main body can set threads according to the hierarchical relationship of the task tree. Therefore, a plurality of tasks to be processed with dependency relationship can be executed in order, and the data processing efficiency can be greatly improved.
In some optional implementation manners of some embodiments, the setting the thread according to the hierarchical relationship of the task tree may include: and responding to the hierarchical relation that the hierarchical relation is a serial structure, and sequentially setting threads for the target tasks to be processed in the task tree according to the serial structure.
When the hierarchical relationship is a serial structure, the execution subject may set threads for the target to-be-processed tasks in the task tree in sequence according to the serial structure. Therefore, the same thread can process the data of the target tasks to be processed one by one, and the data processing efficiency is improved.
In some optional implementation manners of some embodiments, the setting the thread according to the hierarchical relationship of the task tree may include: and responding to the hierarchical relationship being a parallel structure, and setting threads for at least one target task to be processed corresponding to the parallel structure.
When the hierarchical relationship is a parallel structure, it is common that the task tree includes a root node to-be-processed task and a plurality of parallel child node to-be-processed tasks. After the execution of the to-be-processed task of the root node is completed, threads can be simultaneously allocated to the to-be-processed tasks of the plurality of parallel child nodes. Therefore, the data processing efficiency of the tasks to be processed of the plurality of child nodes can be improved.
And step 406, in response to that no task tree exists in the correction task queue, setting threads for other to-be-processed tasks in the correction task queue.
When the task tree does not exist in the correction task queue, the execution main body may set threads for other tasks to be processed in the correction task queue.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a data processing apparatus, which correspond to those shown in fig. 2, and which may be applied in particular to various electronic devices.
As shown in fig. 5, the data processing apparatus 500 of some embodiments includes: a to-be-processed task obtaining unit 501, a task tree building unit 502, a modified task queue building unit 503, and a data processing unit 504. The to-be-processed task obtaining unit 501 is configured to obtain a set number of to-be-processed tasks from a task queue; a task tree construction unit 502 configured to, in response to at least two target tasks to be processed having a dependency relationship among the set number of tasks to be processed, construct a task tree by the at least two target tasks to be processed; a modified task queue constructing unit 503 configured to sort the set number of tasks to be processed based on the task tree to obtain a modified task queue; and a data processing unit 504 configured to perform data processing on the to-be-processed task in the modified task queue.
In an optional implementation manner of some embodiments, the task tree building unit 502 may include: a call relation determination subunit (not shown in the figure) and a task tree construction subunit (not shown in the figure). The calling relation determining subunit is configured to determine a calling relation between the at least two target tasks to be processed; and the task tree construction subunit is configured to construct a task tree based on the calling relation.
In an optional implementation manner of some embodiments, the modified task queue building unit 503 may include: a first modified task queue building subunit (not shown in the figure) configured to, in response to the task tree being one, set the task tree at the head of the task queue to obtain the modified task queue.
In an optional implementation manner of some embodiments, the modified task queue building unit 503 may include: a hierarchy number determination subunit (not shown) and a second modified task queue building subunit (not shown). Wherein, the hierarchy number determining subunit is configured to determine the hierarchy number of each task tree in a plurality of task trees in response to the task trees being a plurality; and the second correction task queue constructing subunit is configured to obtain a task tree group by sequencing the task trees according to the sequence of the hierarchy number from large to small, and arrange the task tree group at the head of the task queue to obtain the correction task queue.
In an optional implementation manner of some embodiments, the data processing unit 504 may include: a task tree extraction subunit (not shown in the figure) and a first data processing subunit (not shown in the figure). Wherein, the task tree extraction subunit is configured to extract the task tree from the correction task queue; and the first data processing subunit is configured to set threads according to the hierarchical relation of the task tree.
In an optional implementation manner of some embodiments, the first data processing subunit may include: and a first thread setting module (not shown) configured to, in response to the hierarchical relationship being a serial structure, sequentially set threads for the target to-be-processed task in the task tree according to the serial structure.
In an optional implementation manner of some embodiments, the first data processing subunit may include: and a second thread setting module (not shown) configured to set a thread for at least one target to-be-processed task corresponding to the parallel structure in response to the hierarchy being the parallel structure.
In an optional implementation manner of some embodiments, the data processing unit 504 may include: and the second data processing subunit (not shown in the figure) is configured to respond to the task tree not existing in the correction task queue and set threads for other tasks to be processed in the correction task queue.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 some embodiments of the 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 some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications 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 network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled 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: acquiring a set number of tasks to be processed from a task queue; responding to at least two target tasks to be processed with dependency relationship in the set number of tasks to be processed, and constructing a task tree through the at least two target tasks to be processed; sequencing the set number of tasks to be processed based on the task tree to obtain a corrected task queue; and processing data of the tasks to be processed in the correction task queue.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a to-be-processed task obtaining unit, a task tree construction unit, a modified task queue construction unit, and a data processing unit. The names of these units do not in some cases constitute a limitation of the unit itself, for example, a data processing unit may also be described as a "unit for processing a task to be processed".
The functions described herein above 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: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (11)

1. A method of data processing, comprising:
acquiring a set number of tasks to be processed from a task queue;
responding to at least two target tasks to be processed with dependency relationship in the set number of tasks to be processed, and constructing a task tree through the at least two target tasks to be processed;
sequencing the set number of tasks to be processed based on the task tree to obtain a corrected task queue;
and carrying out data processing on the tasks to be processed in the correction task queue.
2. The method of claim 1, wherein the building a task tree from the at least two target pending tasks comprises:
determining a calling relationship between the at least two target tasks to be processed;
and constructing a task tree based on the calling relation.
3. The method of claim 1, wherein said sorting said set number of tasks to be processed based on said task tree to obtain a revised task queue comprises:
and responding to one task tree, and setting the task tree at the head of the task queue to obtain the corrected task queue.
4. The method of claim 1, wherein said sorting said set number of tasks to be processed based on said task tree to obtain a revised task queue comprises:
in response to the task tree being multiple, determining a number of levels for each of the plurality of task trees;
and sequencing the task trees according to the sequence of the level quantity from large to small to obtain a task tree group, and setting the task tree group at the head of the task queue to obtain the corrected task queue.
5. The method of claim 1, wherein the processing data of the pending tasks within the rework task queue comprises:
extracting the task tree from the revised task queue;
and setting threads according to the hierarchical relation of the task tree.
6. The method of claim 5, wherein said setting up threads according to a hierarchical relationship of the task tree comprises:
and responding to the fact that the hierarchical relation is a serial structure, and sequentially setting threads for the target tasks to be processed in the task tree according to the serial structure.
7. The method of claim 5, wherein said setting up threads according to a hierarchical relationship of the task tree comprises:
and responding to the hierarchical relationship that the hierarchical relationship is a parallel structure, and setting threads for at least one target task to be processed corresponding to the parallel structure.
8. The method of claim 1, wherein the processing data of the pending tasks within the rework task queue comprises:
and setting threads for other tasks to be processed in the correction task queue in response to the fact that no task tree exists in the correction task queue.
9. A data processing apparatus comprising:
a to-be-processed task obtaining unit configured to obtain a set number of to-be-processed tasks from the task queue;
the task tree building unit is configured to respond to the at least two target tasks to be processed with dependency relationship in the set number of tasks to be processed, and build a task tree through the at least two target tasks to be processed;
the correction task queue construction unit is configured to sort the set number of tasks to be processed based on the task tree to obtain a correction task queue;
and the data processing unit is configured to perform data processing on the tasks to be processed in the correction task queue.
10. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1 to 8.
CN202011354721.4A 2020-11-26 2020-11-26 Data processing method and device, electronic equipment and computer readable medium Pending CN113722055A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011354721.4A CN113722055A (en) 2020-11-26 2020-11-26 Data processing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011354721.4A CN113722055A (en) 2020-11-26 2020-11-26 Data processing method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113722055A true CN113722055A (en) 2021-11-30

Family

ID=78672465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011354721.4A Pending CN113722055A (en) 2020-11-26 2020-11-26 Data processing method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113722055A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115391019A (en) * 2022-10-26 2022-11-25 小米汽车科技有限公司 Data acquisition method and device, readable storage medium and chip
CN115658325A (en) * 2022-11-18 2023-01-31 北京市大数据中心 Data processing method, data processing device, multi-core processor, electronic device, and medium
CN116244324A (en) * 2023-03-15 2023-06-09 上海擎创信息技术有限公司 Task data relation mining method and device, electronic equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115391019A (en) * 2022-10-26 2022-11-25 小米汽车科技有限公司 Data acquisition method and device, readable storage medium and chip
CN115391019B (en) * 2022-10-26 2022-12-27 小米汽车科技有限公司 Data acquisition method and device, readable storage medium and chip
CN115658325A (en) * 2022-11-18 2023-01-31 北京市大数据中心 Data processing method, data processing device, multi-core processor, electronic device, and medium
CN115658325B (en) * 2022-11-18 2024-01-23 北京市大数据中心 Data processing method, device, multi-core processor, electronic equipment and medium
CN116244324A (en) * 2023-03-15 2023-06-09 上海擎创信息技术有限公司 Task data relation mining method and device, electronic equipment and storage medium
CN116244324B (en) * 2023-03-15 2023-12-08 上海擎创信息技术有限公司 Task data relation mining method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113722055A (en) Data processing method and device, electronic equipment and computer readable medium
CN111580974B (en) GPU instance allocation method, device, electronic equipment and computer readable medium
CN111857720A (en) Method and device for generating user interface state information, electronic equipment and medium
CN115357350A (en) Task configuration method and device, electronic equipment and computer readable medium
CN113419841B (en) Message scheduling method and device, electronic equipment and computer readable medium
CN112699111B (en) Report generation method and device, electronic equipment and computer readable medium
CN111612434B (en) Method, apparatus, electronic device and medium for generating processing flow
CN111324470B (en) Method and device for generating information
CN116302271A (en) Page display method and device and electronic equipment
CN112507676B (en) Method and device for generating energy report, electronic equipment and computer readable medium
CN112732979B (en) Information writing method, information writing device, electronic equipment and computer readable medium
CN110830427A (en) Method and device for message encoding and message decoding in netty environment
CN114035861A (en) Cluster configuration method and device, electronic equipment and computer readable medium
CN112464039A (en) Data display method and device of tree structure, electronic equipment and medium
CN112527454A (en) Container group scheduling method and device, electronic equipment and computer readable medium
CN111625692B (en) Feature extraction method, device, electronic equipment and computer readable medium
CN113472565B (en) Method, apparatus, device and computer readable medium for expanding server function
CN116760717B (en) Communication path query method, device, electronic equipment and computer readable medium
CN112311833B (en) Data updating method and device
CN113722634A (en) Data processing method and device, electronic equipment and computer readable medium
CN110908867B (en) Task completion judging method and device, storage medium and electronic equipment
CN117130786A (en) Resource allocation method, device, equipment and readable medium
CN113779315A (en) Information generation method and device, electronic equipment and computer readable medium
CN114398437A (en) User information processing method and device, electronic equipment and computer readable medium
CN115756636A (en) Process instance configuration method, device, electronic equipment, 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