CN111124648B - Multitasking method and device - Google Patents

Multitasking method and device Download PDF

Info

Publication number
CN111124648B
CN111124648B CN201911361298.8A CN201911361298A CN111124648B CN 111124648 B CN111124648 B CN 111124648B CN 201911361298 A CN201911361298 A CN 201911361298A CN 111124648 B CN111124648 B CN 111124648B
Authority
CN
China
Prior art keywords
task
executed
acquisition
service
execution
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
CN201911361298.8A
Other languages
Chinese (zh)
Other versions
CN111124648A (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 Medical and Electric Co Ltd
Original Assignee
Ningbo Sanxing Medical and 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 Medical and Electric Co Ltd filed Critical Ningbo Sanxing Medical and 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

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 application provides a multitasking execution method and a multitasking execution device, which relate to the technical field of electric power acquisition and are applied to an electric power acquisition terminal and comprise the following steps: acquiring a task to be executed and an electricity acquisition service corresponding to the task to be executed; according to the electricity collection service of the task to be executed, identifying the service type of the task to be executed; if the service type is the acquisition type, the task to be executed and the currently executed task are packaged and executed simultaneously, and the simultaneous processing is carried out through multitask packaging, so that the preemption, shelving and interruption conditions of the tasks are avoided, the real-time performance of executing a plurality of tasks is ensured, and the efficiency is improved.

Description

Multitasking method and device
Technical Field
The present application relates to the field of power acquisition technologies, and in particular, to a method and an apparatus for performing multiple tasks.
Background
Currently, object-oriented terminals are gradually popularized, but the acquisition bottleneck of the traditional terminals in the aspect of data acquisition cannot be achieved, so that the instantaneity, the authenticity and the high efficiency of large-scale data acquisition cannot be broken through.
However, when a large-area scene is encountered, that is, multiple data acquisition tasks, especially under the condition that the task execution frequency is relatively frequent, the user terminal can only execute a single task at the same time, other tasks are delayed to be executed or put aside, the execution efficiency is low, and the user experience is poor. The real-time performance and the high efficiency of data acquisition still face a great challenge, timely monitoring and real-time acquisition cannot be achieved at all, and the current power utilization terminal acquisition strategy has low efficiency.
Disclosure of Invention
The application aims to provide a multi-task execution method and device, which avoid the preemption, shelving and interruption conditions of tasks, ensure the real-time performance of the execution of a plurality of tasks and improve the efficiency through the simultaneous processing of multi-task packaging.
In a first aspect, an embodiment provides a method for performing multiple tasks, which is applied to an electricity collection terminal, including:
acquiring a task to be executed and an electricity acquisition service corresponding to the task to be executed;
according to the electricity collection service of the task to be executed, identifying the service type of the task to be executed;
and if the service type is the acquisition type, packaging the task to be executed and the current executing task, and executing the task simultaneously.
In an alternative embodiment, the method further comprises:
and if the service type is the reporting type, simultaneously processing the current execution task and the task to be executed in parallel through two service threads.
In an alternative embodiment, the task to be executed includes a plurality of tasks, and before the step of packaging the task to be executed with the currently executed task, the method further includes:
obtaining the 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, wherein the starting time of the tasks is the same.
In an optional embodiment, if the service type is an acquisition type, the step of packaging the task to be executed and the currently executed task and executing the task simultaneously includes:
if the service type of the task to be executed is an acquisition type, suspending executing the current execution task;
setting the executed progress of the currently executed task;
combining and packaging the task to be executed and the current executing task to obtain a packaged task;
and simultaneously executing the unexecuted part in the packing task according to the set flag.
In an alternative embodiment, the method further comprises:
and if the interrupt of the execution task occurs, restoring the execution progress of the execution task according to the setting mark.
In an alternative embodiment, the tasks to be executed are in one-to-one correspondence with the electricity collection service through task IDs, the electricity collection service includes at least one data item, and the data item includes a unique corresponding data ID.
In an alternative embodiment, the method further comprises:
setting a storage time scale for the data item in the power utilization acquisition service corresponding to the current execution task, wherein the storage time scale is used for the time point of the acquired data item;
and continuing the acquisition progress of the data item according to the stored time mark.
In a second aspect, an embodiment provides a multitasking execution apparatus applied to an electricity acquisition terminal, including:
the acquisition module is used for acquiring a task to be executed and an electricity 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 electricity acquisition service of the task to be executed;
and the execution module is used for packing the task to be executed and the current execution task and executing the task simultaneously under the condition that the service type is the acquisition type.
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, the processor implementing a multitasking method as in any of the preceding embodiments when executing the program.
In a fourth aspect, embodiments provide a computer readable storage medium having stored therein a computer program which, when executed, implements a multitasking method according to any of the preceding embodiments.
The embodiment of the application provides a multi-task execution method and a multi-task execution device, which acquire any service type of a task to be executed according to electricity acquisition service of the task to be executed, pack and combine the task to be executed with a current task to realize multi-task execution if the task to be executed is the acquisition type, fully exert the acquisition efficiency of an acquisition device in a multi-task to-be-executed state, save a great amount of investment of manpower and financial resources, and really realize the application of the data interaction function of the electrified equipment to be operated with high efficiency.
Additional features and advantages of the application 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 application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and drawings.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for performing multiple tasks according to an embodiment of the present application;
FIG. 2 is a flowchart of another method for performing multiple tasks according to an embodiment of the present application;
FIG. 3 is a schematic functional block diagram of a multi-task execution device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
At present, the user data acquisition task in the electricity acquisition field has a priority management strategy, so that the conditions of preemption and interruption exist, namely, the high priority task is first in first out, the low priority task is queued, or the possibility of infinite delay exists, in addition, the preemption by the high priority task is possible in the execution process, the common scene is that the high and low priority tasks are frequently preempted and frequently interrupted under the multi-task and multi-frequency execution condition, and the worst condition exists, if the data volume of the acquired user data of the platform is too large, the high priority task always preempts meter reading threads, and other tasks cannot be executed after all the tasks are put or on the same day.
In addition, the task is frequently switched, so that the progress of each executed task is not well processed, repeated clearing of the acquisition progress of the currently unexecuted task can occur, namely, the task needs to be re-executed, so that the efficiency is low, or the situation that the loading of the progress of the currently unexecuted task is not accurate, and acquisition lost points occur, namely, data is missed.
Based on the above, the multitask execution method and device provided by the embodiment of the application can be used for simultaneously processing through multitask packaging, so that the situation of preempting, laying and interrupting tasks is avoided, the real-time performance of executing a plurality of tasks is ensured, and the efficiency is improved.
For the convenience of understanding the present embodiment, a detailed description will be first given of a multitasking method disclosed in the embodiment of the present application.
Fig. 1 is a flowchart of a method for performing multiple tasks according to an embodiment of the present application.
The multi-task execution method is applied to the electricity acquisition terminal and comprises the following steps of:
step S102, acquiring a task to be executed and an electricity acquisition service corresponding to the task to be executed.
Here, the electricity collection device (electricity collection terminal) waits for the electric master station to input the corresponding tasks to be executed (Task 1, task2, task3 … Task) and the corresponding electricity collection service, and synchronizes the tasks to be executed and the corresponding electricity collection service to the electricity collection device (electricity collection object terminal) to be ready.
Step S104, according to the electricity collection service of the task to be executed, the service type of the task to be executed is identified.
Here, by setting an operation at the electricity consumption master station or the background, the tasks to be executed are loaded into the corresponding task scheduling strategies, and electricity consumption acquisition services of each task to be executed are analyzed to obtain parameters such as execution frequency, execution starting time, execution ending time, execution delay time, task execution grade and the like.
The scheduling policy refers to an execution master interface controlling all tasks to be executed, i.e. the execution master interface is able to execute which task or tasks to be executed at what time point, i.e. the task scheduling brain, according to the above parameters.
And step S106, if the service type is the acquisition type, packaging the task to be executed and the currently executed task, and executing the tasks simultaneously.
In the preferred embodiment of practical application, any 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 task to be executed are packed and combined, multitask execution is realized, collection efficiency of the collection equipment in the multitask state to be executed can be fully exerted, a great amount of investment of manpower and financial resources is saved, and application of the data interaction function of the electrified equipment is truly realized.
Wherein, the task to be executed may include: the system comprises an ammeter real-time data acquisition task, a daily freezing data acquisition task, a curve freezing data acquisition task, a monthly freezing data acquisition task, a settlement daily data acquisition task, a full event data acquisition task, an active reporting task, a 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 the reporting type, processing the current execution task and the task to be executed simultaneously and in parallel through two service threads.
Here, the CPU utilization rate of the conventional power acquisition device is high, and is always in a high-speed running state, so that Nandflash is in a read-write state for a long time, the data writing efficiency is low, and the storage service life of a data area is seriously affected. Under the condition that the collection type scheduling task and the reporting type scheduling task exist at the same time, the collection type scheduling task and the reporting type scheduling task are divided into two threads to be independently scheduled, the collection type task and the reporting type task are processed in series through the traditional processing, namely, a sequencing exists, and the collection type task and the reporting type task are divided into two threads to be processed in parallel through the current method, namely, an asynchronous mode, and a first-in first-out waiting mode does not exist.
In an alternative embodiment, the task to be executed may include a plurality of tasks, and before the step of packaging the task to be executed with the currently executed task in step S106, the method further includes the following steps:
step 2.1), obtaining the task starting time of each task to be executed according to the power consumption acquisition service corresponding to the task to be executed;
and 2.2) merging and packaging the plurality of tasks to be executed, wherein the starting time of the tasks is the same.
If only the collection type exists in the tasks to be executed, but the tasks to be executed in the collection type can be further divided into task types such as REAL-time [ REAL ], freezing [ FRE ] and event [ EVT ], the tasks of the types to be executed can be uniformly packaged, and the electricity collection service IDs (the electricity collection service contents specified by the corresponding tasks) corresponding to the tasks to be executed are uniformly stored. When the task to be executed is packaged, the electricity acquisition service corresponding to the task to be executed is packaged.
Here, under the condition of multitasking to be executed (multitasking Task1, task2 … Task needs to be scheduled to be executed), if the same starting time point and the same priority are met, a plurality of tasks to be executed at the moment can be combined and packaged to be executed, and corresponding data acquisition is performed at the same time, so that real-time and high-efficiency performance is really achieved, and the situation that each Task is not delayed or even is not put aside is ensured.
In an alternative embodiment, step S106 further comprises the steps of:
step 2.1), if the service type of the task to be executed is an acquisition type, suspending executing the current execution task;
step 2.2), setting the executed progress of the currently executed task;
step 2.3), merging and packaging the task to be executed and the currently executed task to obtain a packaged task;
and 2.4) simultaneously executing the unexecuted part in the packing task according to the set mark.
Here, the corresponding task is finished executing and is set, a corresponding flag is set (i.e. the task indicating the current time point is executed), the current task scheduling progress is saved, and the next execution time point of the current packaged task is recalculated.
As an alternative embodiment, if the task currently being executed and the new task loaded in are executed, a setting operation is performed, and the corresponding flag bit is set.
The next execution time is the last execution time of each task+the execution frequency tm1+the delay time TM2.
In an alternative embodiment, the execution efficiency of executing the task is low, the user experience is poor, if the task execution fails, the integrity of the collected data cannot be guaranteed, and in order to solve the above problem, the method further includes the following steps:
step 3.1), if the interrupt of the execution task occurs, restoring the execution progress of the execution task according to the set mark.
As an alternative real-time, when an exception handling situation occurs, such as an acquisition device restart or other high priority task preemption situation occurs midway:
the restart of the acquisition equipment during the midway may include the situations of active dog feeding reset, equipment power failure and the like, and in the power-on process, the last execution of the acquisition point (corresponding flag bit) and the corresponding service flow are recovered from the task scheduling process, and the early-stage service is continuously executed;
if the task with high priority needs to be executed, the current collection progress of the packing service is reserved, the high-level service to be executed is loaded into a packing service pool, the task is repacked, the pre-stage service is continuously executed, the data of the current high-level task is collected, and unified allocation is performed.
For example, task a is currently executed, i.e., it is executed simultaneously with high priority task B to be executed, i.e., it is combined into C (including AB).
In an alternative embodiment, the tasks to be executed are in one-to-one correspondence with the electricity collection service through task IDs, the electricity collection service includes at least one data item, and the data item includes a unique corresponding data ID.
The task scheduling module comprises a meter reading module, a data reporting module, an event acquisition module, a transparent proxy 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 power utilization acquisition service corresponding to the current execution task, wherein the storage time scale is used for the time point when the data item is acquired;
and 4.2) continuing the acquisition progress of the data item according to the stored time scale.
The data item ID is stored according to a corresponding acquisition task (task), and the storage key fields comprise a task ID, a data ID, a storage time mark TM and the like. TM refers to the time of storage at which the data item ID was collected, and subsequent reads of data require lookup of the data ID according to the assigned TM.
Compared with the traditional strategy, the task execution efficiency of the embodiment of the application is greatly improved, and the application is characterized by high acquisition efficiency, complete data, real-time accuracy and no rest after the task is executed. The power acquisition equipment has high data storage rate and high utilization rate, and can effectively avoid the back and forth erasing of the Nandflash storage area, thereby seriously affecting the service life of the data chip. In actual scene use, the situation that customer experience feel is poor, such as data acquisition is slow, multitasking is performed in an intersecting mode, and the like is effectively solved, and finally the phenomenon that data acquisition is unstable by using a acquisition terminal is frequently generated. In addition, the CPU of the power acquisition equipment is released, so that the situation that the acquisition module threads are occupied for a long time is prevented, resources cannot be released, other module threads are tensed in resources, and the operation efficiency is slow.
Fig. 2 is a flowchart of another method for performing multiple tasks according to an embodiment of the present application.
As shown in fig. 2, the multitasking method further includes:
step 5.1), setting task parameters, loading task parameters, scheduling task strategies, analyzing the task parameters and other background parameters after the acquisition terminal system is started;
step 5.2), analyzing the plurality of tasks to obtain execution time periods of the tasks;
step 5.3), judging whether the current single task execution stage belongs to, 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 single task to be executed currently, and sequentially searching the tasks according to the acquisition data storage until the acquisition task is executed.
Step 5.5), loading a task list to be executed, and judging the service type of the service to be executed in the task list;
step 5.6), if the service to be executed belongs to the electricity collection service, and the electricity collection service comprises REAL-time [ REAL ], freezing [ FRE ] and event [ EVT ] service types, filtering task priority, packaging the tasks, recording the current task execution progress and setting marks, and eliminating the tasks (executing completed tasks) with the execution time period;
step 5.7), when the task to be executed is reloaded, repackaging the task, judging whether the power terminal is restarted at the moment, if so, executing the step 5.8), and if not, executing the step 5.9);
step 5.8), loading the execution progress of the last task after starting, searching and judging whether a new task is added, if yes, 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 yes, 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 reporting data until the reporting task is executed.
It should be noted that, the embodiment of the present application may also be used for single task execution, that is, a task that is not currently being executed at this time, that is, a task that is to be executed, or a task that is currently being executed only exists, and no task is to be executed. If only a single task (task) needs to be executed at the moment, executing the current task, scheduling the corresponding electricity acquisition service, finding the electricity acquisition service corresponding to the current task according to the task ID, and acquiring corresponding data.
Under the current terminal-oriented use scene, multitasking is generally performed, for example, more than 30 tasks are alternately performed, and the application of the embodiment of the application has great advantages on the current terminal-oriented acquisition strategy. Specifically, the embodiment of the application can avoid preemption, and the multitasking is packaged at the same time point, namely, the multiple tasks are combined to collect the user data, so that the real-time performance of the multiple tasks is ensured, and the data collection integrity is ensured. The method can also avoid the interruption of the current task, relieve the multitasking progress pool, that is, the execution of the current task is not affected, and simultaneously, the execution of other tasks is also satisfied. In addition, the storage efficiency can be improved, the data can be collected through multitasking and packaging, unified processing is realized, data decentralized processing is avoided, 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 application provides a multitasking execution device applied to an electricity collection terminal, including:
the acquisition module is used for acquiring a task to be executed and an electricity 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 electricity acquisition service of the task to be executed;
and the execution module is used for packing the task to be executed and the current execution task and executing the task simultaneously under the condition that the service type is the acquisition type.
In an optional embodiment, if the service type is a reporting type, the identification module is further configured to process the currently executed task and the task to be executed simultaneously and in parallel through two service threads.
In an optional embodiment, the tasks to be executed include a plurality of tasks, and the execution module is further configured to obtain a task start time of each task to be executed according to an electricity acquisition service corresponding to the task to be executed; and merging and packaging the plurality of tasks to be executed, wherein the starting time of the tasks is the same.
In an optional embodiment, if the service type of the task to be executed is an acquisition type, the execution module is further configured to suspend execution of the current execution task; setting the executed progress of the currently executed task; combining and packaging the task to be executed and the current executing task to obtain a packaged task; and simultaneously executing the unexecuted part in the packing task according to the set flag.
In an alternative embodiment, if an interrupt occurs to the execution task, the execution module is further configured to resume the execution progress of the execution task according to the set flag.
In an alternative embodiment, the tasks to be executed are in one-to-one correspondence with the electricity collection service through task IDs, the electricity collection service includes at least one data item, and the data item includes a unique corresponding data ID.
In an optional embodiment, the execution module is further configured to set a storage time stamp for the data item in the power consumption acquisition service corresponding to the currently executed task, where the storage time stamp is used for a time point when the data item is acquired; and continuing the acquisition progress of the data item according to the stored time mark.
The embodiment of the application can pack the multi-task combination, improve the efficiency strategy, process according to the classification of the service class, detect the abnormal situation, and reserve the current task scheduling progress when the abnormal situation occurs so as to directly locate the last task execution step next time. Meanwhile, the data storage efficiency is improved, the data retrieval efficiency is optimized, the data is retrieved according to the key fields, and the query time is shortened. In addition, in the state of multi-service (reporting and collecting), the multithreading is executed asynchronously and has no influence on each other. When the service class subdivides the acquisition types (real-time, daily freezing, events and the like), the same type of merging and packaging treatment can be realized. The method has the advantages of realizing the purposes of accelerating execution efficiency, improving storage and 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, a schematic diagram of an electronic device 300 for implementing the multitasking method according to an embodiment of the present application is shown. In this embodiment, the electronic device 300 may be, but is not limited to, a personal computer (Personal Computer, PC), a notebook computer, a monitoring device, a server, or other computer devices with analysis and processing capabilities. As an alternative embodiment, the electronic device 300 may be an electricity acquisition terminal.
Fig. 4 is a schematic hardware architecture of an electronic device 300 according to an embodiment of the present application. Referring to fig. 4, the computer apparatus includes: a machine-readable storage medium 301 and a processor 302, and may also include a non-volatile storage medium 303, a communication interface 304, and a bus 305; wherein 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 above embodiments describe the multitasking method by the processor 302 reading and executing machine-executable instructions of the multitasking method in the machine-readable storage medium 301.
The machine-readable storage medium 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, or the like. For example, a machine-readable storage medium may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), any type of storage disk (e.g., optical disk, dvd, etc.), or a similar storage medium, or a combination thereof.
The non-volatile medium may be a non-volatile memory, a flash memory, a storage drive (e.g., hard drive), any type of storage disk (e.g., optical disk, dvd, etc.), or a similar non-volatile storage medium, or a combination thereof.
It can be understood that the specific operation method of each functional module in this embodiment may refer to the detailed description of the corresponding steps in the above method embodiment, and the detailed description is not repeated here.
The embodiment of the present application provides a computer readable storage medium, in which a computer program is stored, where the computer program code can implement the method for performing multiple tasks according to any of the above embodiments when executed, and the specific implementation can refer to the method embodiment and is not repeated herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
In addition, in the description of embodiments of the present application, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art.
In the description of the present application, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. 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 examples are only specific embodiments of the present application, and are not intended to limit the scope of the present application, but it should be understood by those skilled in the art that the present application is not limited thereto, and that the present application is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (9)

1. The multitasking execution method is characterized by being applied to an electricity acquisition terminal and comprising the following steps:
acquiring a task to be executed and an electricity acquisition service corresponding to the task to be executed;
according to the electricity collection service of the task to be executed, identifying the service type of the task to be executed;
if the service type is the acquisition type, packaging the task to be executed and the current executing task, and executing the task simultaneously;
if the service type is the acquisition type, packaging the task to be executed and the currently executed task, and executing simultaneously, wherein the method comprises the following steps:
if the service type of the task to be executed is an acquisition type, suspending executing the current execution task;
setting the executed progress of the currently executed task;
combining and packaging the task to be executed and the current executing task to obtain a packaged task;
and simultaneously executing the unexecuted part in the packing task according to the set flag.
2. The method according to claim 1, wherein the method further comprises:
and if the service type is the reporting type, simultaneously processing the current execution task and the task to be executed in parallel through two service threads.
3. The method of claim 1, wherein the task to be performed comprises a plurality of tasks, and further comprising, prior to the step of packaging the task to be performed with the currently performed task:
obtaining the 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, wherein the starting time of the tasks is the same.
4. The method according to claim 1, wherein the method further comprises:
and if the interrupt of the execution task occurs, restoring the execution progress of the execution task according to the setting mark.
5. The method according to claim 1, wherein the tasks to be performed are in one-to-one correspondence with the electricity collection service via task IDs, the electricity collection service comprising at least one data item comprising a uniquely corresponding data ID.
6. The method of claim 5, wherein the method further comprises:
setting a storage time scale for the data item in the power utilization acquisition service corresponding to the current execution task, wherein the storage time scale is used for the time point of the acquired data item;
and continuing the acquisition progress of the data item according to the stored time mark.
7. A multitasking execution device, characterized in that it is applied to a power consumption acquisition terminal, comprising:
the acquisition module is used for acquiring a task to be executed and an electricity 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 electricity acquisition service of the task to be executed;
the execution module is used for packing the task to be executed and the current execution task and executing the task simultaneously under the condition that the service type is the acquisition type;
the execution module is further configured to suspend execution of the current execution task if the service type of the task to be executed is an acquisition type; setting the executed progress of the currently executed task; combining and packaging the task to be executed and the current executing task to obtain a packaged task; and simultaneously executing the unexecuted part in the packing task according to the set flag.
8. An electronic device comprising a memory, a processor and a program stored on the memory and capable of running on the processor, the processor implementing the multitasking method of any of claims 1-6 when executing the program.
9. A computer readable storage medium, characterized in that the computer program is stored in the readable storage medium, which computer program, when executed, implements the multitasking method of any of claims 1-6.
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 CN111124648A (en) 2020-05-08
CN111124648B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065797B (en) * 2021-04-22 2023-08-18 平安国际智慧城市科技股份有限公司 Method, device, terminal equipment and medium for optimizing execution period of multitasking
CN113238820A (en) * 2021-05-12 2021-08-10 北京达佳互联信息技术有限公司 Task processing method, device, server and storage medium
CN114296890A (en) * 2021-11-17 2022-04-08 宁波三星智能电气有限公司 Service processing method and power terminal applying same
CN115114028B (en) * 2022-07-05 2023-04-28 南方电网科学研究院有限责任公司 Task allocation method and device for secondary control of electric power simulation

Citations (4)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3514682B1 (en) * 2017-11-24 2021-09-29 Autel Robotics Co., Ltd. Task execution method and apparatus, movable object, and computer readable storage medium

Patent Citations (4)

* 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

Also Published As

Publication number Publication date
CN111124648A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111124648B (en) Multitasking method and device
CN104011680B (en) The virtual center processing unit of scheduling virtual machine in physical processing unit
CN101996098B (en) Managing message queues
EP2503733B1 (en) Data collecting method, data collecting apparatus and network management device
CN102096603B (en) Task decomposition control method in MapReduce system and scheduling node equipment
US8166480B2 (en) Reducing lock contention by adding a time slice to an active thread holding a lock
US11132294B2 (en) Real-time replicating garbage collection
US11620215B2 (en) Multi-threaded pause-less replicating garbage collection
CN102467412B (en) Method, device and business system for processing operation request
CN112612523B (en) Embedded equipment driving system and method
CN109445939A (en) A kind of dispatching method based on the soft real-time scheduling kernel for actively selling mechanism
CN107818012B (en) Data processing method and device and electronic equipment
CN102316156A (en) Method for distributing and processing dynamically extensible task
CN107515781B (en) Deterministic task scheduling and load balancing system based on multiple processors
US20140372649A1 (en) Operating System-Managed Interrupt Steering in Multiprocessor Systems
CN111416825A (en) Inter-thread lock-free log management method and system, terminal and storage medium
CN110187838A (en) Data IO information processing method, analysis method, device and relevant device
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
CN111309494A (en) Multithreading event processing assembly
CN114297002A (en) Mass data backup method and system based on object storage
CN112114983B (en) Communication method, device and equipment based on shared memory
CN114896295B (en) Data desensitization method, desensitization device and desensitization system in big data scene
CN114124643B (en) PaaS-based network equipment flow collection method and device
CN106997304B (en) Input and output event processing method and device

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