CN111124648A - Multitask execution method and device - Google Patents

Multitask execution method and device Download PDF

Info

Publication number
CN111124648A
CN111124648A CN201911361298.8A CN201911361298A CN111124648A CN 111124648 A CN111124648 A CN 111124648A CN 201911361298 A CN201911361298 A CN 201911361298A CN 111124648 A CN111124648 A CN 111124648A
Authority
CN
China
Prior art keywords
task
executed
acquisition
execution
service
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.)
Granted
Application number
CN201911361298.8A
Other languages
Chinese (zh)
Other versions
CN111124648B (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.)
Ningbo Sanxing Electric Co Ltd
Original Assignee
Ningbo Sanxing Electric 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 Ningbo Sanxing Electric Co Ltd filed Critical Ningbo Sanxing Electric Co Ltd
Priority to CN201911361298.8A priority Critical patent/CN111124648B/en
Publication of CN111124648A publication Critical patent/CN111124648A/en
Application granted granted Critical
Publication of CN111124648B publication Critical patent/CN111124648B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The invention provides a multitask execution method and a multitask execution device, relates to the technical field of power acquisition, is applied to a power acquisition terminal, and comprises the following steps: acquiring a task to be executed and a power utilization acquisition service corresponding to the task to be executed; identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed; if the service type is the acquisition type, the task to be executed and the current task are packaged and executed simultaneously, and the multi-task packaging and processing are performed simultaneously, so that the situation of occupation, suspension and interruption of the tasks is avoided, the real-time performance of the execution of a plurality of tasks is ensured, and the efficiency is improved.

Description

Multitask execution method and device
Technical Field
The invention relates to the technical field of power acquisition, in particular to a multitask execution method and a multitask execution device.
Background
The current object-oriented terminal is gradually popularized, and the traditional terminal has reached the acquisition bottleneck in the aspect of data acquisition, so that the real-time property, the authenticity and the high efficiency of a large amount of data acquisition cannot be broken through.
However, in a large platform area scene, namely under the condition that multiple data acquisition tasks are performed, especially the task execution frequency is relatively frequent, the user terminal can only execute a single task at the same time, and the phenomena of delayed execution or shelving of other tasks exist, so that the execution efficiency is low, and the user experience is not good. The real-time performance and the high efficiency of data acquisition still face great challenges, timely monitoring and real-time acquisition cannot be achieved fundamentally, and the current power utilization terminal acquisition strategy is low in efficiency.
Disclosure of Invention
The invention aims to provide a multitask execution method and a multitask execution device, which are used for simultaneously processing multitask packages, avoiding the situation of task preemption and suspension interruption, ensuring the real-time performance of the execution of a plurality of tasks and improving the efficiency.
In a first aspect, an embodiment provides a multitask execution method applied to a power consumption acquisition terminal, including:
acquiring a task to be executed and a power utilization acquisition service corresponding to the task to be executed;
identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed;
and if the service type is the acquisition type, packaging the task to be executed and the current execution task, and executing simultaneously.
In an alternative embodiment, the method further comprises:
and if the service type is the reporting type, simultaneously and parallelly processing the current execution task and the task to be executed through two service threads.
In an optional embodiment, the to-be-executed task includes a plurality of tasks, and before the step of packaging the to-be-executed task and the current execution task, the method further includes:
acquiring task starting time of each task to be executed according to the power consumption acquisition service corresponding to the task to be executed;
and merging and packaging the plurality of tasks to be executed with the same task starting time.
In an optional embodiment, if the service type is an acquisition type, the step of packing the task to be executed and the currently executed task and executing the tasks at the same time includes:
if the service type of the task to be executed is the acquisition type, stopping executing the current execution task;
setting the executed progress of the current execution task;
merging and packaging the task to be executed and the current execution task to obtain a packaged task;
and simultaneously executing the unexecuted parts in the packaging task according to the set flags.
In an alternative embodiment, the method further comprises:
and if the execution task is interrupted, recovering the execution progress of the execution task according to the set mark.
In an optional embodiment, the task to be executed corresponds to the electricity collection service one by one through a task ID, the electricity collection service includes at least one data item, and the data item includes a uniquely corresponding data ID.
In an alternative embodiment, the method further comprises:
setting a storage time scale for the data item in the electricity collection service corresponding to the currently executed task, wherein the storage time scale is used for the time point when the data item is collected;
and continuing the acquisition progress of the data item according to the storage time scale.
In a second aspect, an embodiment provides a multitask execution device, which is applied to a power consumption acquisition terminal, and includes:
the acquisition module is used for acquiring the task to be executed and the power utilization acquisition service corresponding to the task to be executed;
the identification module is used for identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed;
and the execution module is used for packing the task to be executed and the current task to be executed under the condition that the service type is the acquisition type and executing the tasks at the same time.
In a third aspect, an embodiment provides an electronic device, including a memory, a processor, and a program stored on the memory and capable of running on the processor, where the processor executes the program to implement the multitask execution method according to any one of the foregoing embodiments.
In a fourth aspect, an embodiment provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed, implements the multitask execution method according to any one of the foregoing embodiments.
The embodiment of the invention provides a multitask execution method and a multitask execution device, wherein any service type of a task to be executed is obtained according to a power utilization acquisition service of the task to be executed, if the task to be executed is the acquisition type, the task to be executed and a current execution task are packed and combined, multitask execution is realized, the acquisition efficiency of acquisition equipment in a multitask execution state can be fully exerted, meanwhile, the investment of a large amount of manpower and financial resources is saved, and the application of a data interaction function of high-efficiency running electrified equipment is really realized.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart of a multitask execution method according to an embodiment of the present invention;
FIG. 2 is a flowchart of another multitask execution method according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a multitasking execution device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, a priority management strategy exists in a user data acquisition task in the field of power consumption acquisition, so that preemption and interruption situations exist, namely a high-priority task is in first-out, a low-priority task is in queuing or is in infinite delay, in addition, the high-priority task is possibly preempted in the execution process, under the very common scene that multiple tasks are executed at multiple frequencies, the high-priority task and the low-priority task are frequently preempted and interrupted, and the worst situation exists, if the user data acquisition amount in a region is too large, the high-priority task always preempts a meter reading thread, so that other tasks are all followed, or cannot be executed on the day.
In addition, the task is frequently switched, so that the progress of each executed task is not well processed, the current task acquisition progress which is not executed is repeatedly cleared, namely, the task needs to be executed again, so that the efficiency is low, or the current task acquisition progress which is not executed is not accurately loaded, and the situation of point missing of acquisition, namely data missing reading, occurs.
Based on this, the method and the device for executing multiple tasks provided by the embodiments of the present invention can perform simultaneous processing through multiple task packaging, avoid the situation of preempting and suspending interruption of tasks, ensure the real-time performance of executing multiple tasks, and improve the efficiency.
For the convenience of understanding the embodiment, a multitask execution method disclosed by the embodiment of the invention is first described in detail.
Fig. 1 is a flowchart of a multitask execution method according to an embodiment of the present invention.
The multitask execution method is applied to the power utilization acquisition terminal and comprises the following steps:
step S102, acquiring the task to be executed and the power utilization acquisition service corresponding to the task to be executed.
Here, the power consumption collecting device (power consumption collecting terminal) waits for the power master station to put in the corresponding tasks to be executed (Task1, Task2, Task3 … Task) and the corresponding power consumption collecting services, and synchronizes the tasks to be executed and the corresponding power consumption collecting services to the power consumption collecting device (target terminal for mining), and is ready.
And step S104, identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed.
Here, the tasks to be executed are loaded into the corresponding task scheduling policy by setting operation in the electricity master station or the background, and the electricity acquisition service of each task to be executed is analyzed to obtain parameters such as execution frequency, execution start time, execution end time, execution delay time, task execution level and the like.
This scheduling policy refers to the execution master interface that controls all tasks to be executed, i.e. the execution master interface can execute which task or tasks are to be executed at what point in time according to the above parameters, i.e. the task scheduling brain.
And step S106, if the service type is the acquisition type, packaging the task to be executed and the current execution task, and executing simultaneously.
In the preferred embodiment of practical application, the arbitrary service type of the task to be executed is obtained according to the electricity collection service of the task to be executed, if the task to be executed is the collection type, the task to be executed and the current execution task are packed and combined, multi-task execution is realized, collection efficiency of the collection equipment in a multi-task state to be executed can be fully improved, meanwhile, investment of a large amount of manpower and financial resources is saved, and application of a data interaction function of the electrified equipment with high efficiency is really realized.
The task to be executed may include: the method comprises the following steps of ammeter real-time data acquisition task, daily freezing data acquisition task, curve freezing data acquisition task, monthly freezing data acquisition task, settlement daily data acquisition task, full-event data acquisition task, active reporting task, transparent forwarding task and the like.
In an alternative embodiment, the method further comprises the steps of:
step 1.1), if the service type is a reporting type, the current execution task and the task to be executed are processed simultaneously and parallelly through two service threads.
Here, the CPU utilization rate of the conventional power acquisition device is high, and the conventional power acquisition device is always in a high-speed operation state, so that the Nandflash is in a read-write state for a long time, the data write-in efficiency is low, and the storage service life of a data area is seriously influenced. According to the method, under the condition that the collection scheduling task and the report scheduling task exist at the same time, the collection scheduling task and the report scheduling task are divided into two threads to be independently scheduled, the collection scheduling task and the report scheduling task are processed in a serial mode in the traditional processing mode, namely, an output sequence exists, the collection scheduling task and the report scheduling task are divided into two threads to be processed in a parallel mode in the current method, namely, an asynchronous mode does not exist, and a first-in first-out waiting mode does not exist.
In an optional embodiment, the to-be-executed task may include a plurality of tasks, and before the step of packaging the to-be-executed task and the currently executed task in step S106, the method further includes the following steps:
step 2.1), obtaining task starting time of each task to be executed according to the power utilization acquisition service corresponding to the task to be executed;
and 2.2) merging and packaging a plurality of tasks to be executed with the same task starting time.
If the tasks to be executed only have the collection class, but the tasks to be executed of the collection class can also be divided into task types such as REAL-time [ REAL ], frozen [ FRE ], event [ EVT ], and the like, the tasks to be executed of the types can be uniformly packed, and the power consumption collection service IDs (power consumption collection service contents specified by the corresponding tasks) corresponding to the tasks to be executed are uniformly stored. It should be noted that, when the tasks to be executed are packed, the electricity collection services corresponding to the tasks to be executed are also packed.
Here, under the condition that multiple tasks are to be executed (multiple tasks Task1, Task2 … Task need to be scheduled and executed), if the same starting time point and the same priority are met, multiple tasks which need to be executed at the moment can be merged, packed and executed, and corresponding data acquisition is performed at the same time, so that real-time and high-efficiency are really achieved, and the condition that each Task is not delayed or even not put aside is ensured.
In an alternative embodiment, step S106 further includes the steps of:
step 2.1), if the service type of the task to be executed is the acquisition type, stopping executing the current execution task;
step 2.2), setting the executed progress of the current execution task;
step 2.3), merging and packaging the task to be executed and the current execution task to obtain a packaged task;
and 2.4) simultaneously executing the unexecuted parts in the packaging task according to the set marks.
Here, the corresponding task is executed and set, a corresponding flag is set (that is, the task at the current time point is executed), the current task scheduling progress is saved, and the next execution time point of the current packed task is recalculated.
As an alternative embodiment, if the currently executing task and the loaded new task are executed completely, a setting operation is performed, and the corresponding flag bit is set.
Wherein, the next execution time is the latest execution time of each task + execution frequency TM1+ delay time TM 2.
In an optional embodiment, the execution efficiency of executing the task is low, the user experience is not good, and if the task execution fails, the integrity of the collected data cannot be guaranteed, in order to solve the above problem, the method further includes the following steps:
and 3.1) if the execution task is interrupted, restoring the execution progress of the execution task according to the set mark.
As an optional real-time, when an exception handling condition occurs, such as a collection device restart or other high-priority task preemption condition occurs halfway:
in the power-on process, the last execution of the acquisition point (corresponding zone bit) and the corresponding service flow are recovered from the task scheduling process, and the earlier-stage service is continuously executed;
if a high-priority task needs to be executed, the current packaging service acquisition progress is reserved, the high-level service to be executed is loaded into a packaging service pool, the task is packaged again, the previous-stage service is continuously executed, the data of the current high-level task is acquired, and the task is allocated uniformly.
For example, task A is currently executing and high priority task B to be executed, i.e., will be merged into C (containing AB), concurrently.
In an optional embodiment, the task to be executed corresponds to the electricity collection service one by one through a task ID, the electricity collection service includes at least one data item, and the data item includes a uniquely corresponding data ID.
The task scheduling module comprises a meter reading module, a data reporting module, an event acquisition module, a transparent agent module and the like.
In an alternative embodiment, the method further comprises:
step 4.1), setting a storage time scale for the data item in the electricity collection service corresponding to the currently executed task, wherein the storage time scale is used for the time point when the data item is collected;
and 4.2) continuing the acquisition progress of the data item according to the storage time scale.
The data item ID is stored according to a corresponding acquisition task (Taskn), and the storage key field comprises a task ID, a data ID, a storage time mark TM and the like. TM refers to the storage time at which the data item ID was collected, and subsequent reading of data requires looking up the data ID from the designated TM.
Compared with the traditional strategy, the task execution efficiency of the embodiment of the invention is greatly improved, and the embodiment of the invention is characterized by high acquisition efficiency, complete data, real-time accuracy and no laying aside after the task is not executed. The data storage rate and the utilization rate of the power acquisition equipment are high, and the situation that the service life of a data chip is seriously influenced due to the fact that the Nandflash storage area is erased and written back and forth can be effectively avoided. In actual scene use, the problem that the user experience is poor, such as slow data acquisition, multi-task cross execution crosstalk and the like, and finally the phenomenon of instability of data acquisition of the acquisition terminal is often caused is solved efficiently. In addition, the CPU of the power acquisition equipment is released, so that the situation that resources cannot be released due to the fact that the acquisition module thread is occupied for a long time is avoided, and the problems that resources of other modules are in shortage and the operation efficiency is slow are solved.
Fig. 2 is a flowchart of another multitask execution method according to an embodiment of the present invention.
As shown in fig. 2, the multitask execution method further includes:
step 5.1), after the acquisition terminal system is started, setting task parameters, loading the task parameters, scheduling task strategies, analyzing background parameters such as the task parameters and the like;
step 5.2), analyzing the plurality of tasks to obtain the execution time period of each task;
step 5.3), judging whether the current task belongs to a single task execution stage, if so, executing step 5.4), and if not, executing step 5.5);
and 5.4) identifying the power utilization acquisition service (acquisition scheme) corresponding to the current single task to be executed, storing according to the acquired data, and sequentially searching the tasks until the acquisition task is executed.
Step 5.5), loading a task list to be executed, and judging the service type of a service to be executed in the task list;
step 5.6), if the service to be executed belongs to the electricity acquisition service and the electricity acquisition service comprises service types such as REAL-time [ REAL ], frozen [ FRE ] and event [ EVT ], filtering task priorities, packaging the tasks, recording the current task execution progress and setting marks, and eliminating the tasks (executed tasks) which have already been executed in the execution time period;
step 5.7), when the task to be executed is reloaded, the task is repackaged, whether the electric terminal is restarted or not is judged, if the electric terminal is restarted, the step 5.8) is executed, and if the electric terminal is not restarted, the step 5.9) is executed;
step 5.8), loading the execution progress of the last task after starting, searching and judging whether a new task is added, if so, interrupting the current task, reloading the task, and executing the step 5.4); if not, directly executing the step 5.4);
step 5.9), searching and judging whether a new task is added, if so, interrupting the current task, reloading the task, and executing the step 5.4); if not, directly executing the step 5.4);
and 5.9) if the service to be executed belongs to the reporting service, processing the reported data until the reporting task is executed.
It should be noted that the embodiment of the present invention may also be used for single task execution, that is, at this time, there is no task currently being executed, that is, there is a task to be executed, or there is only a task currently being executed and there is no task to be executed. And if only a single task (task) needs to be executed at the moment, executing the current task, scheduling the corresponding power consumption acquisition service, finding the power consumption acquisition service corresponding to the current task according to the task ID, and acquiring corresponding data.
In the current terminal-oriented use scenario, multi-task acquisition is generally performed, for example, more than 30 tasks are alternately executed, and the embodiment of the invention has great advantages in the current terminal-oriented acquisition strategy. Specifically, the embodiment of the invention can avoid preemption, and the multiple tasks are packed at the same time point, namely the multiple tasks are combined to acquire user data, so that the real-time performance of the multiple tasks is ensured, and the data acquisition integrity is also ensured. The interruption of the current task can be avoided, the multitask progress pool is relieved, the execution of the current task is not influenced, and the execution of other tasks is met. In addition, the storage efficiency can be improved, multitask packaging is realized, collected data are processed in a unified mode, data are prevented from being processed in a scattered mode, the storage efficiency of a data chip is improved, and the service life of the Nandflash chip is prolonged.
As shown in fig. 3, an embodiment of the present invention provides a multitask executing device, which is applied to a power consumption acquisition terminal, and includes:
the acquisition module is used for acquiring the task to be executed and the power utilization acquisition service corresponding to the task to be executed;
the identification module is used for identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed;
and the execution module is used for packing the task to be executed and the current task to be executed under the condition that the service type is the acquisition type and executing the tasks at the same time.
In an optional embodiment, if the service type is a reporting type, the identification module is further configured to process the current execution task and the task to be executed simultaneously and in parallel through two service threads.
In an optional embodiment, the to-be-executed tasks include a plurality of tasks, and the execution module is further configured to obtain a task start time of each to-be-executed task according to the power consumption acquisition service corresponding to the to-be-executed task; and merging and packaging the plurality of tasks to be executed with the same task starting time.
In an optional embodiment, if the service type of the task to be executed is the acquisition type, the execution module is further configured to suspend execution of the currently executed task; setting the executed progress of the current execution task; merging and packaging the task to be executed and the current execution task to obtain a packaged task; and simultaneously executing the unexecuted parts in the packaging task according to the set flags.
In an optional embodiment, if the execution task is interrupted, the execution module is further configured to resume the execution progress of the execution task according to the set flag.
In an optional embodiment, the task to be executed corresponds to the electricity collection service one by one through a task ID, the electricity collection service includes at least one data item, and the data item includes a uniquely corresponding data ID.
In an optional embodiment, the execution module is further configured to set a storage time scale for the data item in the electricity collection service corresponding to the currently executed task, where the storage time scale is used for a time point when the data item is collected; and continuing the acquisition progress of the data item according to the storage time scale.
The embodiment of the invention can combine and pack multiple tasks, improve the efficiency strategy, process according to the classification of the service class, detect abnormal conditions, and reserve the current task scheduling progress when the abnormal conditions occur so as to directly position to the last task execution step next time. Meanwhile, the data storage efficiency is improved, the data retrieval efficiency is optimized, retrieval is carried out according to key fields, and the query time is shortened. In addition, under the multi-service (reporting and collecting) state, multiple threads are executed asynchronously without mutual influence. When the service class subdivides the acquisition types (real-time, daily freezing, events and the like), the same type of merging and packaging can be achieved. The method and the device achieve the purposes of accelerating execution efficiency, improving storage writing efficiency, preventing frequent erasing and writing of the data storage chip and prolonging the service life of the storage chip.
Further, as shown in fig. 4, it is a schematic diagram of an electronic device 300 for implementing the multitask execution method according to the embodiment of the present invention. In this embodiment, the electronic device 300 may be, but is not limited to, a computer device with analysis and processing capabilities, such as a Personal Computer (PC), a notebook computer, a monitoring device, and a server. As an alternative embodiment, the electronic device 300 may be a power consumption collecting terminal.
Fig. 4 is a schematic hardware architecture diagram of an electronic device 300 according to an embodiment of the present invention. Referring to fig. 4, the computer apparatus includes: a machine-readable storage medium 301 and a processor 302, and may further include a non-volatile storage medium 303, a communication interface 304, and a bus 305; among other things, the machine-readable storage medium 301, the processor 302, the non-volatile storage medium 303, and the communication interface 304 communicate with each other via a bus 305. The processor 302 may perform the multitask execution method described in the above embodiments by reading and executing the machine executable instructions of the multitask execution method in the machine readable storage medium 301.
A machine-readable storage medium as referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The non-volatile medium may be non-volatile memory, flash memory, a storage drive (e.g., a hard drive), any type of storage disk (e.g., an optical disk, dvd, etc.), or similar non-volatile storage medium, or a combination thereof.
It can be understood that, for the specific operation method of each functional module in this embodiment, reference may be made to the detailed description of the corresponding step in the foregoing method embodiment, and no repeated description is provided herein.
The computer-readable storage medium provided in the embodiments of the present invention stores a computer program, and when executed, the computer program code may implement the multitask execution method described in any of the above embodiments, and specific implementation may refer to method embodiments, which are not described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A multitask execution method is applied to a power utilization acquisition terminal and comprises the following steps:
acquiring a task to be executed and a power utilization acquisition service corresponding to the task to be executed;
identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed;
and if the service type is the acquisition type, packaging the task to be executed and the current execution task, and executing simultaneously.
2. The method of claim 1, further comprising:
and if the service type is the reporting type, simultaneously and parallelly processing the current execution task and the task to be executed through two service threads.
3. The method according to claim 1, wherein the task to be executed comprises a plurality of tasks, and before the step of packaging the task to be executed with the currently executed task, the method further comprises:
acquiring task starting time of each task to be executed according to the power consumption acquisition service corresponding to the task to be executed;
and merging and packaging the plurality of tasks to be executed with the same task starting time.
4. The method according to claim 1, wherein if the service type is an acquisition type, the step of packing and simultaneously executing the task to be executed and the current execution task comprises:
if the service type of the task to be executed is the acquisition type, stopping executing the current execution task;
setting the executed progress of the current execution task;
merging and packaging the task to be executed and the current execution task to obtain a packaged task;
and simultaneously executing the unexecuted parts in the packaging task according to the set flags.
5. The method of claim 4, further comprising:
and if the execution task is interrupted, recovering the execution progress of the execution task according to the set mark.
6. The method according to claim 1, wherein the tasks to be executed are in one-to-one correspondence with the electricity collection service through task IDs, the electricity collection service comprises at least one data item, and the data item comprises a uniquely corresponding data ID.
7. The method of claim 6, further comprising:
setting a storage time scale for the data item in the electricity collection service corresponding to the currently executed task, wherein the storage time scale is used for the time point when the data item is collected;
and continuing the acquisition progress of the data item according to the storage time scale.
8. The multitask execution device is applied to a power utilization acquisition terminal and comprises:
the acquisition module is used for acquiring the task to be executed and the power utilization acquisition service corresponding to the task to be executed;
the identification module is used for identifying the service type of the task to be executed according to the power utilization acquisition service of the task to be executed;
and the execution module is used for packing the task to be executed and the current task to be executed under the condition that the service type is the acquisition type and executing the tasks at the same time.
9. An electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the multitasking execution method according to any one of claims 1-7 when executing the program.
10. A computer-readable storage medium, in which a computer program is stored which, when executed, implements a multitasking execution method according to any one of claims 1-7.
CN201911361298.8A 2019-12-24 2019-12-24 Multitasking method and device Active CN111124648B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911361298.8A CN111124648B (en) 2019-12-24 2019-12-24 Multitasking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911361298.8A CN111124648B (en) 2019-12-24 2019-12-24 Multitasking method and device

Publications (2)

Publication Number Publication Date
CN111124648A true CN111124648A (en) 2020-05-08
CN111124648B CN111124648B (en) 2023-08-22

Family

ID=70502622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911361298.8A Active CN111124648B (en) 2019-12-24 2019-12-24 Multitasking method and device

Country Status (1)

Country Link
CN (1) CN111124648B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065797A (en) * 2021-04-22 2021-07-02 平安国际智慧城市科技股份有限公司 Multitask execution deadline optimization method, multitask execution deadline optimization device, terminal equipment and medium
CN113238820A (en) * 2021-05-12 2021-08-10 北京达佳互联信息技术有限公司 Task processing method, device, server and storage medium
CN115114028A (en) * 2022-07-05 2022-09-27 南方电网科学研究院有限责任公司 Task allocation method and device for electric power simulation secondary control

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514277A (en) * 2013-09-24 2014-01-15 国家电网公司 Task parallel processing method for electricity utilization information collection system
CN106875662A (en) * 2017-04-07 2017-06-20 广东电网有限责任公司电力科学研究院 A kind of data acquisition for electric energy method and device
CN109725993A (en) * 2018-06-01 2019-05-07 中国平安人寿保险股份有限公司 Task executing method, device, equipment and computer readable storage medium
CN109769016A (en) * 2018-12-26 2019-05-17 重庆世纪之光科技实业有限公司 A kind of the Multi-task Concurrency meter register method and device, system of intelligent meter data recording system
US20190163184A1 (en) * 2017-11-24 2019-05-30 Autel Robotics Co., Ltd. Task execution method and device, moveable object and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514277A (en) * 2013-09-24 2014-01-15 国家电网公司 Task parallel processing method for electricity utilization information collection system
CN106875662A (en) * 2017-04-07 2017-06-20 广东电网有限责任公司电力科学研究院 A kind of data acquisition for electric energy method and device
US20190163184A1 (en) * 2017-11-24 2019-05-30 Autel Robotics Co., Ltd. Task execution method and device, moveable object and computer readable storage medium
CN109725993A (en) * 2018-06-01 2019-05-07 中国平安人寿保险股份有限公司 Task executing method, device, equipment and computer readable storage medium
CN109769016A (en) * 2018-12-26 2019-05-17 重庆世纪之光科技实业有限公司 A kind of the Multi-task Concurrency meter register method and device, system of intelligent meter data recording system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065797A (en) * 2021-04-22 2021-07-02 平安国际智慧城市科技股份有限公司 Multitask execution deadline optimization method, multitask execution deadline optimization device, terminal equipment and medium
CN113238820A (en) * 2021-05-12 2021-08-10 北京达佳互联信息技术有限公司 Task processing method, device, server and storage medium
CN115114028A (en) * 2022-07-05 2022-09-27 南方电网科学研究院有限责任公司 Task allocation method and device for electric power simulation secondary control
CN115114028B (en) * 2022-07-05 2023-04-28 南方电网科学研究院有限责任公司 Task allocation method and device for secondary control of electric power simulation

Also Published As

Publication number Publication date
CN111124648B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN111124648A (en) Multitask execution method and device
US6411982B2 (en) Thread based governor for time scheduled process execution
CN110780998A (en) Kubernetes-based dynamic load balancing resource scheduling method
US8959515B2 (en) Task scheduling policy for limited memory systems
CN104011680B (en) The virtual center processing unit of scheduling virtual machine in physical processing unit
CN101996098B (en) Managing message queues
CN111522636B (en) Application container adjusting method, application container adjusting system, computer readable medium and terminal device
US20090276781A1 (en) System and method for multi-level preemption scheduling in high performance processing
US11132294B2 (en) Real-time replicating garbage collection
US20140157278A1 (en) Thread folding tool
CN112612523B (en) Embedded equipment driving system and method
CN107515781B (en) Deterministic task scheduling and load balancing system based on multiple processors
CN110941495B (en) Container collaborative arrangement method based on graph coloring
CN111767199A (en) Resource management method, device, equipment and system based on batch processing operation
US7840725B2 (en) Capture of data in a computer network
CN109240831A (en) A kind of operation requests processing method, device, equipment and readable storage medium storing program for executing
CN112363812B (en) Database connection queue management method based on task classification and storage medium
CN114297002A (en) Mass data backup method and system based on object storage
US8914417B2 (en) Apparatus, system, and method for maintaining a context stack
CN112579271A (en) Real-time task scheduling method, module, terminal and storage medium for non-real-time operating system
CN114124643B (en) PaaS-based network equipment flow collection method and device
CN116244085A (en) Kubernetes cluster container group scheduling method, device and medium
CN106997304B (en) Input and output event processing method and device
JPH1027167A (en) Method for distributing load of parallel computer
CN109947798A (en) A kind of processing method and processing device of stream event

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