CN111831422B - Task processing method and device - Google Patents

Task processing method and device Download PDF

Info

Publication number
CN111831422B
CN111831422B CN201910300649.8A CN201910300649A CN111831422B CN 111831422 B CN111831422 B CN 111831422B CN 201910300649 A CN201910300649 A CN 201910300649A CN 111831422 B CN111831422 B CN 111831422B
Authority
CN
China
Prior art keywords
subtask
task
processing
processed
ith
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.)
Active
Application number
CN201910300649.8A
Other languages
Chinese (zh)
Other versions
CN111831422A (en
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.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment 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 Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CN201910300649.8A priority Critical patent/CN111831422B/en
Publication of CN111831422A publication Critical patent/CN111831422A/en
Application granted granted Critical
Publication of CN111831422B publication Critical patent/CN111831422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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

Landscapes

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

Abstract

The invention provides a task processing method and device. The method comprises the following steps: creating an ith subtask corresponding to the task to be processed; i is a positive integer greater than or equal to 1; processing the ith subtask; under the condition that the ith subtask is successfully processed, creating an (i+1) th subtask corresponding to the task to be processed; the processing sequence of the ith subtask is prior to the (i+1) th subtask; and processing the (i+1) th subtask. According to the invention, the complete task is dynamically divided into a plurality of subtasks for processing, so that the consumption of memory in the instantaneous processing process can be effectively reduced, and the execution time of the task is greatly reduced.

Description

Task processing method and device
Technical Field
The present invention relates to the field of task processing technologies, and in particular, to a task processing method and device.
Background
An eNB (Evolved NodeB)/RRU (Radio Remote Unit, remote radio unit) in an LTE (Long Term Evolution ) communication network requires an irregular software version upgrade to meet the requirements of providing new functions and features and repairing the previous version problems. The number of eNBs/RRUs in a large LTE communication network is in ten thousand units, and the requirement on upgrading efficiency is high.
When the eNB and the RRU need to be upgraded, an OMC (Operation MAINTANCE CENTER, operation maintenance center) imports the existing version upgrade package into an FTP Server (FILE TRANSFER Protocol Server), and downloads the version upgrade package from the FTP Server to the eNB and the RRU side and takes effect by issuing an upgrade command to the eNB/the RRU so as to achieve the purpose of upgrading the equipment version.
In the software upgrading process, all processes from the beginning of the upgrading to the end of the upgrading are linear processes, and verification before command issuing, process monitoring and result processing are treated as an integral process, so that the process cannot jump out in the middle of the process unless the process exits in a failure. Upgrading of device software is a time-consuming operation that typically takes at least 10 minutes or more, and longer under typical network conditions. In this case, in order to improve the upgrade efficiency of the software version of the full-network device, only the number of concurrent threads is increased, but increasing the number of concurrent threads increases the consumption of memory and also wastes the execution time of tasks.
Disclosure of Invention
The embodiment of the invention provides a task processing method and device, which are used for solving the problems that the concurrent thread number needs to be increased and the task execution time needs to be increased when the software version upgrading efficiency is improved in the prior art.
In order to solve the above problems, an embodiment of the present invention discloses a task processing method, including: creating an ith subtask corresponding to the task to be processed; i is a positive integer greater than or equal to 1; processing the ith subtask; under the condition that the ith subtask is successfully processed, creating an (i+1) th subtask corresponding to the task to be processed; the processing sequence of the ith subtask is prior to the (i+1) th subtask; and processing the (i+1) th subtask.
Preferably, the step of creating an ith subtask corresponding to the task to be processed includes: calling a first idle thread in a thread pool, and creating the ith subtask; the step of processing the ith subtask includes: invoking the first idle thread to process the ith subtask; the step of creating the (i+1) th subtask corresponding to the task to be processed comprises the following steps: invoking a second idle thread in the thread pool to create the (i+1) th subtask; the step of processing the (i+1) th subtask includes: and calling the second idle thread to process the (i+1) th subtask.
Preferably, after the step of processing the ith subtask, the method further includes: and ending the processing operation of the task to be processed under the condition that the processing of the ith subtask fails.
Preferably, after the step of processing the (i+1) th subtask, the method further includes: judging whether the (i+1) th subtask is the last subtask of the task to be processed; if yes, ending the processing operation of the task to be processed.
Preferably, the first idle thread and the second idle thread are the same idle thread; or the first idle thread and the second idle thread are different idle threads.
In order to solve the above problems, an embodiment of the present invention discloses a task processing device, including: the first subtask creation module is used for creating an ith subtask corresponding to the task to be processed; i is a positive integer greater than or equal to 1; the first subtask processing module is used for processing the ith subtask; the second subtask creation module is used for creating an (i+1) th subtask corresponding to the task to be processed under the condition that the processing of the (i) th subtask is successful; the processing sequence of the ith subtask is prior to the (i+1) th subtask; and the second subtask processing module is used for processing the (i+1) th subtask.
Preferably, the first subtask creation module includes: a first subtask creation sub-module for calling a first idle thread in a thread pool to create the ith subtask; the first subtask processing module includes: the first subtask processing sub-module is used for calling the first idle thread and processing the ith subtask; the second subtask creation module includes: a second subtask creation sub-module for calling a second idle thread in the thread pool to create the (i+1) th subtask; the second subtask processing module includes: and the second sub-task processing sub-module is used for calling the second idle thread and processing the (i+1) th sub-task.
Preferably, the method further comprises: and the first processing operation ending module is used for ending the processing operation of the task to be processed under the condition that the processing of the ith subtask fails.
Preferably, the method further comprises: the final subtask judging module is used for judging whether the (i+1) th subtask is the last subtask of the task to be processed; and the second processing operation ending module is used for ending the processing operation of the task to be processed when the (i+1) th subtask is the last subtask.
Preferably, the first idle thread and the second idle thread are the same idle thread; or the first idle thread and the second idle thread are different idle threads.
Compared with the prior art, the embodiment of the invention has the following advantages:
The embodiment of the invention provides a task processing method and device, which are used for processing an ith subtask by creating the ith subtask corresponding to a task to be processed, wherein i is a positive integer greater than or equal to 1, and under the condition that the treatment of the ith subtask is successful, an (i+1) th subtask corresponding to the task to be processed is created, the treatment sequence of the ith subtask is prior to the (i+1) th subtask, and the (i+1) th subtask is treated. According to the embodiment of the invention, the complete task is dynamically divided into the plurality of subtasks for processing, so that the consumption of memory in the instantaneous processing process can be effectively reduced, and the execution time of the task is greatly reduced.
Drawings
FIG. 1 shows a step flow diagram of a task processing method provided by an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a task processing method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a task processing device according to an embodiment of the present invention;
fig. 4 shows a schematic structural diagram of a task processing device according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Example 1
Referring to fig. 1, a step flowchart of a task processing method provided by an embodiment of the present invention may specifically include the following steps:
step 101: creating an ith subtask corresponding to the task to be processed; i is a positive integer of 1 or more.
In the embodiment of the present invention, the task to be processed refers to a task that can be divided into a plurality of sub-tasks executed by threads, for example, the task to be processed may be a software upgrade task, such as an upgrade of an RRU software version, or an upgrade of an eNB software version, etc., and specifically, the task to be processed may be determined according to a service requirement, which is not limited in the embodiment of the present invention.
I is a positive integer greater than or equal to the positive integer, i can be 1, 2, 3, etc., specifically, i can be 1, 2, 3, 4, etc. when the task to be processed can be divided into 5 subtasks, for example, the creation time and execution time of the subtasks obtained by dividing the task to be processed are sequential, that is, after the first subtask is created and completed and processed successfully, the second subtask is created and executed, and after the second subtask is processed successfully, the third subtask is created again.
The above process will be described in detail in the following steps, and the embodiments of the present invention are not described herein.
After creating the ith subtask corresponding to the task to be processed, step 102 is performed.
Step 102: and processing the ith subtask.
After creating the ith subtask corresponding to the task to be processed, the ith subtask may be processed.
Specifically, a thread pool may be preset, in which the states of the respective threads created in advance are recorded, including: the idle state and the non-idle state, when the ith subtask needs to be processed, a thread in the idle state in the thread pool can be called to process the ith subtask, for example, the software upgrading task comprises: the downloading command issuing subtask, the downloading process monitoring subtask and the synchronous command issuing subtask can call a thread in an idle state in a thread pool when the ith subtask is the downloading command issuing subtask, and execute the downloading command issuing subtask, namely call the idle thread to issue the downloading command.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
After processing the ith subtask, step 103 is performed.
Step 103: under the condition that the ith subtask is successfully processed, creating an (i+1) th subtask corresponding to the task to be processed; the processing sequence of the ith subtask is prior to the (i+1) th subtask.
In the embodiment of the present invention, the multiple subtasks dynamically divided into the tasks to be processed have a corresponding processing sequence, the (i+1) th subtask is the subtask whose processing sequence is located only after the (i) th subtask, for example, the task to be processed a may be divided into four subtasks, which are a, b, c, d respectively, and the processing sequence of the divided subtasks is a, b, c, d in sequence, and when the (i) th subtask is a, the (i+1) th subtask is b; and when the ith subtask is b, the (i+1) th subtask is c; and when the ith subtask is c, the (i+1) th subtask is d, etc.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
For a plurality of subtasks which can be divided into tasks to be processed, besides the corresponding processing sequence, the creation and processing process of the next subtask can be executed after the subtask with the front processing sequence is processed.
And when the processing of the ith subtask fails, the (i+1) th subtask is not created any more, namely, no subsequent processing procedure exists.
And when the processing of the ith subtask is successful, creating the (i+1) th subtask.
After creating the (i+1) th subtask corresponding to the task to be processed, step 104 is performed.
Step 104: and processing the (i+1) th subtask.
After creating the (i+1) th sub-task corresponding to the task to be processed, the (i+1) th sub-task may be processed, and specifically, an idle thread in the thread pool may be invoked to process the (i+1) th sub-task.
After the i+1 subtasks are processed, whether the i+1 subtask is the last subtask of the task to be processed or not can be judged, and if yes, the processing operation of the task to be processed is finished.
In this process, it is not necessary to determine whether the i+1th subtask is successfully processed.
And when the (i+1) th subtask is not the last subtask, judging whether the (i+1) th subtask is successfully processed, and when the (i+1) th subtask is failed to be processed, ending the processing operation of the task to be processed. And when the processing of the (i+1) th subtask is successful, the (i+2) th subtask can be created, then the (i+2) th subtask is processed … and so on until the processing operation of the task to be processed is completed.
According to the embodiment of the invention, the complete task is dynamically divided into the plurality of subtasks, and after the subtasks with the front processing sequence are processed, the next subtask is triggered to be created and processed, so that the consumption of the instantaneous processing process to the memory can be effectively reduced, and the execution time of the task is greatly reduced.
According to the task processing method provided by the embodiment of the invention, the ith subtask corresponding to the task to be processed is created, i is a positive integer greater than or equal to 1, the ith subtask is processed, and under the condition that the treatment of the ith subtask is successful, the (i+1) th subtask corresponding to the task to be processed is created, and the treatment sequence of the ith subtask is prior to the (i+1) th subtask, and the (i+1) th subtask is treated. According to the embodiment of the invention, the complete task is dynamically divided into the plurality of subtasks for processing, so that the consumption of memory in the instantaneous processing process can be effectively reduced, and the execution time of the task is greatly reduced.
Example two
Referring to fig. 2, a step flowchart of a task processing method provided by an embodiment of the present invention may specifically include the following steps:
step 201: and calling a first idle thread in a thread pool, and creating the ith subtask.
In the embodiment of the present invention, the task to be processed refers to a task that can be divided into a plurality of sub-tasks executed by threads, for example, the task to be processed may be a software upgrade task, such as an upgrade of an RRU software version, or an upgrade of an eNB software version, etc., and specifically, the task to be processed may be determined according to a service requirement, which is not limited in the embodiment of the present invention.
I is a positive integer greater than or equal to the positive integer, i can be 1, 2, 3, etc., specifically, i can be 1, 2, 3, 4, etc. when the task to be processed can be divided into 5 subtasks, for example, the creation time and execution time of the subtasks obtained by dividing the task to be processed are sequential, that is, after the first subtask is created and completed and processed successfully, the second subtask is created and executed, and after the second subtask is processed successfully, the third subtask is created again.
The thread pool refers to a memory space created in advance in the system for storing threads.
The threads stored in the thread pool may include two states, an idle state and a non-idle state.
The first idle thread is a thread in an idle state in the thread pool, for example, the thread pool includes a thread 1, a thread 2 and a thread 3, the thread 2 and the thread 3 are idle threads, and the thread 1 is a non-idle thread, and then the thread 2 can be used as the first idle thread or the thread 3 can be used as the first idle thread.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
When there are multiple idle threads in the thread pool, those skilled in the art may select the thread in the idle state as the first idle thread according to actual needs, and in particular, may depend on actual situations, which is not limited by the embodiment of the present invention.
When an ith subtask corresponding to a task to be processed needs to be created, a first idle thread in the thread pool can be called to create the ith subtask.
After invoking the first idle thread to create the ith subtask, step 202 is performed.
Step 202: and calling the first idle thread to process the ith subtask.
After the ith subtask is created, the first idle thread may be invoked to process the ith subtask, that is, after the first idle thread is invoked to create the ith subtask, the first idle thread may be continuously utilized to process the ith subtask, for example, the software upgrading task includes: the downloading command issuing subtask, the downloading process monitoring subtask and the synchronous command issuing subtask can call a first idle thread when the ith subtask is the downloading command issuing subtask, execute the creation of the downloading command issuing subtask and then call the first idle thread to issue the downloading command.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
After invoking the first idle thread to process the ith subtask, step 203 is performed.
Step 203: and ending the processing operation of the task to be processed under the condition that the processing of the ith subtask fails.
After the first idle thread is called to process the ith subtask, whether the ith subtask is successfully processed or not can be judged. For example, when the ith subtask is a download command issuing subtask, whether the download command issuing subtask is successfully processed or not can be judged by monitoring whether the download command issuing subtask is successful or not, namely when the download command issuing is successful, the download command issuing subtask is successfully processed; and when the download command fails to be issued, the download command fails to issue the subtask.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
When the processing of the ith subtask fails, the processing operation of the task to be processed is ended, namely, when the processing of the ith subtask fails, the (i+1) th subtask corresponding to the task to be processed is not created any more, and the processing of the task to be processed is ended.
Step 204: and calling a second idle thread in the thread pool under the condition that the ith subtask is successfully processed, and creating the (i+1) th subtask.
In the embodiment of the present invention, the multiple subtasks dynamically divided into the tasks to be processed have a corresponding processing sequence, the (i+1) th subtask is the subtask whose processing sequence is located only after the (i) th subtask, for example, the task to be processed a may be divided into four subtasks, which are a, b, c, d respectively, and the processing sequence of the divided subtasks is a, b, c, d in sequence, and when the (i) th subtask is a, the (i+1) th subtask is b; and when the ith subtask is b, the (i+1) th subtask is c; and when the ith subtask is c, the (i+1) th subtask is d, etc.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
For a plurality of subtasks which can be divided into tasks to be processed, besides the corresponding processing sequence, the creation and processing process of the next subtask can be executed after the subtask with the front processing sequence is processed.
The second idle thread is the thread in idle state in the thread pool.
The second idle thread and the first idle thread may be the same idle thread, or may be two different threads in a thread pool, and in particular, may be determined according to practical situations, which is not limited in the embodiment of the present invention.
After the ith subtask is successfully processed, a second idle thread in the thread pool may be invoked to create an ith+1th subtask corresponding to the task to be processed, and step 205 is performed.
Step 205: and calling the second idle thread to process the (i+1) th subtask.
After the i+1th subtask is created, the second idle thread may be invoked to process the i+1th subtask, that is, after the second idle thread is invoked to create the i+1th subtask, the second idle thread may be continuously utilized to process the i+1th subtask, for example, the software upgrade task includes: when the (i+1) th subtask is the download process monitoring subtask, a second idle thread can be called to execute the creation of the download process monitoring subtask, and then the second idle thread is called to execute the download process monitoring subtask so as to monitor the software download process.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
After invoking the second idle thread to process the (i+1) th sub-task, step 206 is performed.
Step 206: and judging whether the (i+1) th subtask is the last subtask of the task to be processed.
After the second idle thread is called to process the (i+1) th subtask, whether the (i+1) th subtask is the last subtask corresponding to the task to be processed or not can be judged, for example, the subtask corresponding to the task to be processed comprises a subtask 1, a subtask 2 and a subtask 3, the processing sequence of the subtask is the subtask 1, the subtask 2 and the subtask 3 in sequence, and when the (i+1) th subtask is the subtask 2, the (i+1) th subtask is not the last subtask of the task to be processed; and when the (i+1) th subtask is the subtask 3, the (i+1) th subtask is the last subtask of the task to be processed.
It will be appreciated that the above examples are only examples listed for better understanding of the technical solution of the embodiments of the present invention, and are not to be construed as the only limitation of the embodiments of the present invention.
After determining whether the (i+1) th sub-task is the last sub-task of the task to be processed, step 207 is performed.
Step 207: and ending the processing operation of the task to be processed.
When the i+1th subtask is not the last subtask of the task to be processed, a thread in an idle state in the thread pool can be called, the i+2th subtask corresponding to the task to be processed is created, and then the thread in the idle state is called to process the i+2th subtask, and the specific processing process can refer to the processing process of the i+1th subtask, and the embodiment of the invention is not repeated herein.
And when the (i+1) th subtask is the last subtask of the task to be processed, ending the processing operation of the task to be processed.
When the (i+1) th subtask is the last subtask of the task to be processed, whether the processing of the (i+1) th subtask is successful or not is not needed, namely whether the processing of the (i+1) th subtask is successful or not, the processing operation of the subtask corresponding to the task to be processed is ended.
Next, the above-described process of the present invention will be described in detail in connection with a software upgrade task.
The software upgrading task can be divided into a downloading command issuing subtask, a downloading process monitoring subtask, a synchronous command issuing subtask, a synchronous process monitoring subtask, an activating command issuing subtask and an activating process monitoring subtask, and the processing sequence of the subtasks is as follows: the method comprises the steps of downloading a command issuing subtask, downloading a process monitoring subtask, synchronizing the command issuing subtask, synchronizing the process monitoring subtask, activating the command issuing subtask and activating the process monitoring subtask.
When software (such as eNB or RRU software) needs to be upgraded, a thread in an idle state of a thread pool can be called to create a downloading command issuing sub-task, and then the idle thread is called to process the downloading command issuing sub-task.
After the download command issuing subtask is processed, whether the download command issuing subtask is successfully processed or not can be judged, and when the download command issuing subtask is failed to be processed, the task of software upgrading is ended.
When the download command issues the subtask to be successfully processed, one thread in an idle state in the thread pool can be called again, the download process monitoring subtask is created, and then the thread in the idle state is called to process the download process monitoring subtask.
After the download process monitoring subtask is processed, whether the download process monitoring subtask is processed successfully or not can be judged, and when the download process monitoring subtask is processed unsuccessfully, the task of software upgrading is ended.
And when the download process monitoring subtask is successfully processed, one thread in an idle state in the thread pool can be called again, the synchronous command issuing subtask is created, and then the thread in the idle state is called to process the synchronous command issuing subtask.
After the synchronous command issuing subtask processing is completed, whether the synchronous command issuing subtask processing is successful or not can be judged, and when the synchronous command issuing subtask processing fails, the task of software upgrading is ended.
When the synchronous command issuing subtask is successfully processed, one idle-state thread in the thread pool can be called again, the synchronous process monitoring subtask is created, and then the idle-state thread is called again to process the synchronous command issuing subtask.
After the synchronous process monitoring subtask is processed, whether the synchronous process monitoring subtask is processed successfully or not can be judged, and when the synchronous process monitoring subtask is processed successfully, the task of software upgrading is ended.
When the synchronous process monitoring subtask is successfully processed, one idle-state thread in the thread pool can be called again, an activation command issuing subtask is created, and then the idle-state thread is called again to process the activation command issuing subtask.
After the processing of the activating command issuing subtask is completed, whether the activating command issuing subtask is successfully processed or not can be judged, and when the activating command issuing subtask is failed in processing, the task of software upgrading is ended.
When the process of issuing the activating command to the subtasks is successful, one idle thread in the thread pool can be called again, the activating process monitoring subtask is created, and then the idle thread is called again to process the activating process monitoring subtask.
After the activation process monitoring subtask is processed, whether the activation process monitoring subtask is processed successfully or not can be judged, and when the activation process monitoring subtask is processed failure or success, the task of software upgrading is ended.
In practical application, after each subtask is processed, whether the subtask processed is the last subtask of the task to be processed needs to be judged, and when the subtask processed is the last subtask of the task to be processed, the processing operation of the task to be processed is finished.
In the embodiment of the invention, whether the software task of the next flow is newly built is dynamically determined according to the result of processing one task in the process of upgrading the software. The method for dynamically creating the task effectively avoids the problem of scheduling confusion and the problem of extra consumption of the memory caused by the task in all initial creation processes, simplifies the complexity of task scheduling, and reduces the consumption of the task to the memory in the instant.
And, change the way that a linear multi-step time-consuming task monopolizes a thread to the way that a plurality of tasks with logic relationship share a thread. The dormancy time in the previous flow is used for processing the upgrade tasks of other network elements, and the cumulative effect of a plurality of network element tasks (the software upgrade is performed on a plurality of network elements) is overlapped, so that the time consumed by task execution is greatly shortened.
According to the task processing method provided by the embodiment of the invention, the ith subtask corresponding to the task to be processed is created, i is a positive integer greater than or equal to 1, the ith subtask is processed, and under the condition that the treatment of the ith subtask is successful, the (i+1) th subtask corresponding to the task to be processed is created, and the treatment sequence of the ith subtask is prior to the (i+1) th subtask, and the (i+1) th subtask is treated. According to the embodiment of the invention, the complete task is dynamically divided into the plurality of subtasks for processing, so that the consumption of memory in the instantaneous processing process can be effectively reduced, and the execution time of the task is greatly reduced.
Example III
Referring to fig. 3, a schematic structural diagram of a task processing device provided in an embodiment of the present invention may specifically include:
a first subtask creation module 310, configured to create an ith subtask corresponding to a task to be processed; i is a positive integer greater than or equal to 1; a first subtask processing module 320, configured to process the ith subtask; a second subtask creation module 330, configured to create an (i+1) th subtask corresponding to the task to be processed, in a case where the processing of the (i) th subtask is successful; the processing sequence of the ith subtask is prior to the (i+1) th subtask; and a second subtask processing module 340, configured to process the (i+1) th subtask.
According to the task processing device provided by the embodiment of the invention, the ith subtask corresponding to the task to be processed is created, i is a positive integer greater than or equal to 1, the ith subtask is processed, and under the condition that the treatment of the ith subtask is successful, the (i+1) th subtask corresponding to the task to be processed is created, and the treatment sequence of the ith subtask is prior to the (i+1) th subtask, and the (i+1) th subtask is treated. According to the embodiment of the invention, the complete task is dynamically divided into the plurality of subtasks for processing, so that the consumption of memory in the instantaneous processing process can be effectively reduced, and the execution time of the task is greatly reduced.
Example IV
Referring to fig. 4, a schematic structural diagram of a task processing device provided in an embodiment of the present invention may specifically include:
A first subtask creation module 410, configured to create an ith subtask corresponding to a task to be processed; i is a positive integer greater than or equal to 1; a first subtask processing module 420, configured to process the ith subtask; a first processing operation ending module 430, configured to end a processing operation for the task to be processed if the processing for the ith subtask fails; a second subtask creation module 440, configured to create an (i+1) th subtask corresponding to the task to be processed, in a case that the processing of the (i) th subtask is successful; the processing sequence of the ith subtask is prior to the (i+1) th subtask; a second subtask processing module 450, configured to process the (i+1) th subtask; a final subtask judging module 460, configured to judge whether the (i+1) th subtask is the last subtask of the task to be processed; a second processing operation ending module 470, configured to end the processing operation for the task to be processed when the (i+1) th sub-task is the last sub-task.
Preferably, the first subtask creation module 410 includes: a first subtask creation sub-module 4101 for invoking a first idle thread in a thread pool to create the ith subtask; the first subtask processing module 420 includes: a first subtask processing sub-module 4201, configured to invoke the first idle thread and process the ith subtask; the second subtask creation module 440 includes: a second sub-task creation sub-module 4401 for calling a second idle thread in the thread pool to create the (i+1) th sub-task; the second subtask processing module 450 includes: and a second subtask processing submodule 4501, configured to call the second idle thread and process the (i+1) th subtask.
Preferably, the first idle thread and the second idle thread are the same idle thread; or the first idle thread and the second idle thread are different idle threads.
According to the task processing device provided by the embodiment of the invention, the ith subtask corresponding to the task to be processed is created, i is a positive integer greater than or equal to 1, the ith subtask is processed, and under the condition that the treatment of the ith subtask is successful, the (i+1) th subtask corresponding to the task to be processed is created, and the treatment sequence of the ith subtask is prior to the (i+1) th subtask, and the (i+1) th subtask is treated. According to the embodiment of the invention, the complete task is dynamically divided into the plurality of subtasks for processing, so that the consumption of memory in the instantaneous processing process can be effectively reduced, and the execution time of the task is greatly reduced.
In particular, for the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present invention is not limited by the order of acts, as some steps may, in accordance with the present invention, occur in other orders or concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The task processing method and the task processing device provided by the invention are described in detail, and specific examples are applied to illustrate the principle and the implementation of the invention, and the description of the examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (8)

1. A method of task processing, comprising:
Creating an ith subtask corresponding to the task to be processed; i is a positive integer greater than or equal to 1; the task to be processed is a software upgrading task;
Processing the ith subtask;
under the condition that the ith subtask is successfully processed, creating an (i+1) th subtask corresponding to the task to be processed; the processing sequence of the ith subtask is prior to the (i+1) th subtask;
Processing the (i+1) th subtask;
ending the processing operation of the task to be processed under the condition that the processing of the ith subtask fails;
The software is any one of eNB software and RRU software, and the subtasks of the software upgrading task are sequentially as follows according to the execution sequence: the method comprises the steps of downloading a command issuing subtask, downloading a process monitoring subtask, synchronizing the command issuing subtask, synchronizing the process monitoring subtask, activating the command issuing subtask and activating the process monitoring subtask, wherein when the subtask is executed, the next subtask is executed only after the current subtask is successfully executed, and when the current subtask is failed to be executed, the software upgrading task is ended.
2. The method of claim 1, wherein the step of creating an ith subtask corresponding to a task to be processed comprises:
calling a first idle thread in a thread pool, and creating the ith subtask;
The step of processing the ith subtask includes:
Invoking the first idle thread to process the ith subtask;
the step of creating the (i+1) th subtask corresponding to the task to be processed comprises the following steps:
Invoking a second idle thread in the thread pool to create the (i+1) th subtask;
the step of processing the (i+1) th subtask includes:
and calling the second idle thread to process the (i+1) th subtask.
3. The method of claim 1, further comprising, after the step of processing the i+1th sub-task:
judging whether the (i+1) th subtask is the last subtask of the task to be processed;
If yes, ending the processing operation of the task to be processed.
4. The method of claim 2, wherein the first idle thread and the second idle thread are the same idle thread; or the first idle thread and the second idle thread are different idle threads.
5. A task processing device, comprising:
The first subtask creation module is used for creating an ith subtask corresponding to the task to be processed; i is a positive integer greater than or equal to 1; the task to be processed is a software upgrading task;
The first subtask processing module is used for processing the ith subtask;
The second subtask creation module is used for creating an (i+1) th subtask corresponding to the task to be processed under the condition that the processing of the (i) th subtask is successful; the processing sequence of the ith subtask is prior to the (i+1) th subtask;
the second subtask processing module is used for processing the (i+1) th subtask;
A first processing operation ending module, configured to end a processing operation for the task to be processed in case of failure in processing the ith subtask;
The software is any one of eNB software and RRU software, and the subtasks of the software upgrading task are sequentially as follows according to the execution sequence: the method comprises the steps of downloading a command issuing subtask, downloading a process monitoring subtask, synchronizing the command issuing subtask, synchronizing the process monitoring subtask, activating the command issuing subtask and activating the process monitoring subtask, wherein when the subtask is executed, the next subtask is executed only after the current subtask is successfully executed, and when the current subtask is failed to be executed, the software upgrading task is ended.
6. The apparatus of claim 5, wherein the first subtask creation module comprises:
A first subtask creation sub-module for calling a first idle thread in a thread pool to create the ith subtask;
the first subtask processing module includes:
The first subtask processing sub-module is used for calling the first idle thread and processing the ith subtask;
The second subtask creation module includes:
A second subtask creation sub-module for calling a second idle thread in the thread pool to create the (i+1) th subtask;
The second subtask processing module includes:
and the second sub-task processing sub-module is used for calling the second idle thread and processing the (i+1) th sub-task.
7. The apparatus as recited in claim 5, further comprising:
The final subtask judging module is used for judging whether the (i+1) th subtask is the last subtask of the task to be processed;
And the second processing operation ending module is used for ending the processing operation of the task to be processed when the (i+1) th subtask is the last subtask.
8. The apparatus of claim 6, wherein the first idle thread and the second idle thread are the same idle thread; or the first idle thread and the second idle thread are different idle threads.
CN201910300649.8A 2019-04-15 2019-04-15 Task processing method and device Active CN111831422B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910300649.8A CN111831422B (en) 2019-04-15 2019-04-15 Task processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910300649.8A CN111831422B (en) 2019-04-15 2019-04-15 Task processing method and device

Publications (2)

Publication Number Publication Date
CN111831422A CN111831422A (en) 2020-10-27
CN111831422B true CN111831422B (en) 2024-04-30

Family

ID=72915333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910300649.8A Active CN111831422B (en) 2019-04-15 2019-04-15 Task processing method and device

Country Status (1)

Country Link
CN (1) CN111831422B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591721A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Method and system for distributing thread execution task
CN104572277A (en) * 2014-12-17 2015-04-29 大唐移动通信设备有限公司 Thread flow control method and thread flow control device
CN108255607A (en) * 2018-01-08 2018-07-06 武汉斗鱼网络科技有限公司 Task processing method, device, electric terminal and readable storage medium storing program for executing
CN108804215A (en) * 2018-06-12 2018-11-13 北京奇艺世纪科技有限公司 A kind of task processing method, device and electronic equipment
WO2018219480A1 (en) * 2017-05-29 2018-12-06 Barcelona Supercomputing Center - Centro Nacional De Supercomputación Managing task dependency
CN109308214A (en) * 2017-07-27 2019-02-05 北京京东尚科信息技术有限公司 Data task processing method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591721A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Method and system for distributing thread execution task
CN104572277A (en) * 2014-12-17 2015-04-29 大唐移动通信设备有限公司 Thread flow control method and thread flow control device
WO2018219480A1 (en) * 2017-05-29 2018-12-06 Barcelona Supercomputing Center - Centro Nacional De Supercomputación Managing task dependency
CN109308214A (en) * 2017-07-27 2019-02-05 北京京东尚科信息技术有限公司 Data task processing method and system
CN108255607A (en) * 2018-01-08 2018-07-06 武汉斗鱼网络科技有限公司 Task processing method, device, electric terminal and readable storage medium storing program for executing
CN108804215A (en) * 2018-06-12 2018-11-13 北京奇艺世纪科技有限公司 A kind of task processing method, device and electronic equipment

Also Published As

Publication number Publication date
CN111831422A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN111897633A (en) Task processing method and device
CN110457197B (en) Service testing method, device, computer equipment and storage medium
CN110750343B (en) Cluster system timing task scheduling control method and cluster system
CN112416969B (en) Parallel task scheduling system in distributed database
CN110611707A (en) Task scheduling method and device
CN104657150A (en) Automatic operation and maintenance method under cluster environment
CN112506624A (en) Timing task scheduling system, method and corresponding computer equipment and storage medium
CN112328372A (en) Kubernetes node self-healing method and system
CN115001990A (en) Cross-region openstack cluster management method and system based on declarative API
CN111831422B (en) Task processing method and device
CN113485812B (en) Partition parallel processing method and system based on large-data-volume task
CN103178974A (en) Fault processing system and method
CN109189415A (en) Device, method, system and the computer readable storage medium of deployment services device
US9032251B2 (en) Re-forming an application control tree without terminating the application
CN110413398B (en) Task scheduling method and device, computer equipment and storage medium
CN112131188A (en) Batch file distribution processing method and device
CN109766131A (en) The system and method for the intelligent automatic upgrading of software is realized based on multithreading
CN111767122A (en) Distributed task scheduling management method and device
CN108880860B (en) Policy management method and device
CN115840642A (en) Edge resource processing method, device, system, equipment and medium
CN104657204A (en) Short task processing method, device and operation system
CN115098255A (en) Design method and system of distributed file asynchronous processing service and electronic equipment
CN106294408A (en) The method and apparatus that the Asynchronous Request of dynamic web page is monitored
CN110134522A (en) A kind of distributed lock realization method and system with heartbeat
CN110716972A (en) Method and device for processing error of high-frequency calling external interface

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
GR01 Patent grant
GR01 Patent grant