A multi-task parallel efficient acquisition method and system based on HPLC concentrator
Through multi-task parallel execution and state machine scheduling, task switching is optimized, and the problem of low concentrator acquisition efficiency is solved and efficient power consumption information is achieved.
Patent Information
- Application Number
- CN202310370848.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-04-10
AI Technical Summary
In the existing power consumption information acquisition system, the collection efficiency of the concentrator is low, and the concurrent and merged collection capabilities of the local communication channel cannot be fully utilized. Frequent task switching leads to data loss and low acquisition efficiency.
The multi-task parallel execution method is adopted, and the task priority and operation mode are set through state machine scheduling and copy-read pool module design, so as to realize efficient execution of parallel tasks and data merging and reorganization, and optimize the task switching process.
It improves the acquisition efficiency, reduces the task switching frequency, avoids data loss, makes full use of the concurrency and merging acquisition capabilities of the local communication channel, and improves the overall efficiency of data acquisition.
Smart Images

Figure CN116566434B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric power communication, and in particular relates to a concentrator multi-task parallel efficient acquisition method and system based on HPLC. Background Art
[0002] Existing electricity usage information collection systems primarily consist of a master station, a concentrator, a local communication channel, and electricity meters. The concentrator collects meter data via the local communication channel, processes it, and then uploads it to the master station. The concentrator hosts multiple collection tasks, each responsible for collecting data from a subset of meters. The local communication channel typically utilizes HPLC or HPLC dual-mode communication technology. This technology supports simultaneous collection from N meters ("concurrent collection"), where N represents the number of concurrent collections, typically greater than 5. Each communication session can collect M data points from meters ("merged collection"), where M represents the number of merged collections, typically greater than 5.
[0003] With the advancement of new business demands such as low-voltage distributed photovoltaics and market-based electricity trading, electricity consumption information collection systems have increasingly higher requirements for the amount and frequency of collected data. As a key collection device, the concentrator needs to complete various collection tasks more efficiently. The current conventional collection implementation scheme for concentrators is to execute collection tasks one by one (only one task is executed at a time) until all the data to be collected from all electricity meters under all tasks is collected. This collection method has the following disadvantages:
[0004] 1. Task switching reduces collection efficiency: The preparation required for task switching reduces collection efficiency. After a task is switched in, the required meter information and data must be loaded from the database, which takes time. Frequent task switching, such as in situations where a table fails, requires time to reload data, reducing collection efficiency. Task switching also easily discards meter data from the previous task, further reducing collection efficiency. After a high-priority task is switched in, it may receive a response message to a collection message already sent by a lower-priority task. Because the lower-priority task is not executing, the data is discarded.
[0005] 2. The local channel's concurrent data collection capability cannot be fully utilized, reducing data collection efficiency: When only one task is executed at a time, the number of meters to be collected may be less than the number of concurrent data collections, which prevents the local channel's concurrent data collection capability from being fully utilized. This is especially true at the end of a task execution when only a few meters remain to be collected.
[0006] 3. Unable to give full play to the combined collection capability, reducing the collection efficiency: Only one task is executed at the same time, which easily leads to the situation that the number of data to be collected is less than the number of combined collections, and the local channel combined collection capability cannot be fully utilized. Summary of the Invention
[0007] In response to the above-mentioned inconveniences and defects in the current electricity consumption data collection, the present invention provides a concentrator multi-task parallel efficient collection method and system based on HPLC. By executing multiple tasks in parallel and using a designed reading pool to read data, the above-mentioned problems are solved and the collection efficiency is improved.
[0008] In order to solve the above technical problems, the technical solution adopted by the present invention is: a multi-task parallel efficient acquisition method of a concentrator based on HPLC, comprising the following steps:
[0009] S1. Setting the operation mode and priority of each reading task; the operation mode is set to an exclusive task or a parallel task; determining a task transition mode of a state machine, the state machine being used to execute a first reading task, the first reading task being a task for collecting data to be read configured by a master station;
[0010] S2. After the system starts, it determines whether there are exclusive tasks in the task pool. If so, all exclusive tasks are executed in order of priority.
[0011] S3. After the exclusive task is executed, all the parallel first reading tasks in the task pool are obtained and executed in parallel through the task scheduling mode of the state machine to obtain the corresponding data items to be read;
[0012] S4. Read the data according to the acquired data items to be copied.
[0013] In step 1, the route identification task and the file synchronization task are set to exclusive mode; the proxy reading task and the meter reading task are set to parallel mode; the priority of the route identification task is higher than the file synchronization task; the priority of the proxy reading task is higher than the meter reading task.
[0014] The task states of the state machine include:
[0015] TASK_STATE_READY status: indicates that the task can be executed, but is not within the set execution period;
[0016] TASK_STATE_DELAY state: indicates that the task execution period has entered the delay time;
[0017] TASK_STATE_RUNNING state: indicates that the task is being executed;
[0018] TASK_STATE_SLEEP state: indicates the task is in sleep state;
[0019] TASK_STATE_STOPING state: indicates the state where the task execution of this cycle is completed;
[0020] TASK_STATE_SUSPEND state: task suspended state;
[0021] The state transition mode of the state machine is set to:
[0022] After starting, it enters the TASK_STATE_READY state;
[0023] In the TASK_STATE_READY state, if the execution time period is entered, it enters the TASK_STATE_DELAY state; if it is manually suspended, it enters the TASK_STATE_SUSPEND state;
[0024] In the TASK_STATE_DELAY state, if the task delay time is reached, it enters the TASK_STATE_RUNNING state;
[0025] In the TASK_STATE_RUNNING state, if the execution is successful or it is not in the execution time period, it enters the TASK_STATE_STOPING state and reclaims the resources used by the task; if the execution fails or the task actively sleeps, it enters the TASK_STATE_SLEEP state;
[0026] In the TASK_STATE_STOPING state, if the task is a single task, it enters the TASK_STATE_SUSPEND state; if the task is a periodic task, it enters the TASK_STATE_READY state;
[0027] In the TASK_STATE_SLEEP state, if the task queue is idle or the active sleep time ends, it returns to the TASK_STATE_RUNNING state;
[0028] In the TASK_STATE_SUSPEND state, if manually resumed, it enters the TASK_STATE_READY state.
[0029] The specific method for performing data copying according to the data item to be copied in step S4 is:
[0030] Merge and reorganize all data items to be read, organize all data items to be read by adding meters in units of meters to form a second reading task and send it to the meter module;
[0031] Save the response data after receiving it from the meter module.
[0032] In step S4, when the second reading task is formed and sent to the electric meter module, it is sent in the order of the electric meter priority, and the priority of the electric meter is the highest priority of the data item to be read;
[0033] In the second reading task, the data items to be read of the electricity meter are sorted by priority.
[0034] The HPLC-based concentrator multi-task parallel efficient collection method further includes the following steps:
[0035] After receiving the response data, it is reported to the first reading task indexed by the meter address and data item, and resources are released, and the items to be read and the meter priority of the corresponding meter are adjusted.
[0036] In addition, the present invention also provides a concentrator multi-task parallel efficient acquisition system based on HPLC, comprising:
[0037] Task scheduling module: used to obtain tasks from the task pool and execute them; also used to execute the first reading task to obtain the data items to be read and send them to the reading pool module; also used to receive the reported data sent by the reading pool module and save it after processing; the first reading task is the task of collecting the data to be read configured by the master station;
[0038] When the task scheduling module executes tasks in the task pool, the exclusive tasks are executed first. After the exclusive tasks are executed, the state machine is used to execute multiple first reading tasks in parallel according to the maximum concurrency number of the local channel.
[0039] The reading pool module is used to merge and reorganize all the data items to be read sent by the task scheduling module, organize and add all the data items to be read of the meter in units of meters to form a second reading task, and then send it to the corresponding meter module; it is also used to receive the response data sent by the meter module and send it to the task scheduling module;
[0040] The task scheduling module is further configured to send the meter address, the data item to be read, the priority, and the task information stamp corresponding to the data item to be read obtained according to the first reading task to the reading pool module;
[0041] The task scheduling module is further used to set the operation mode and priority of each reading task, and the operation mode includes exclusive task or parallel task.
[0042] The task states of the state machine include:
[0043] TASK_STATE_READY status: indicates that the task can be executed, but is not within the set execution period;
[0044] TASK_STATE_DELAY state: indicates that the task execution period has entered the delay time;
[0045] TASK_STATE_RUNNING state: indicates that the task is being executed;
[0046] TASK_STATE_SLEEP state: indicates the task is in sleep state;
[0047] TASK_STATE_STOPING state: indicates the state where the task execution of this cycle is completed;
[0048] TASK_STATE_SUSPEND state: task suspended state;
[0049] The state transition mode of the state machine is set to:
[0050] After starting, it enters the TASK_STATE_READY state;
[0051] In the TASK_STATE_READY state, if the execution time period is entered, it enters the TASK_STATE_DELAY state; if it is manually suspended, it enters the TASK_STATE_SUSPEND state;
[0052] In the TASK_STATE_DELAY state, if the task delay time is reached, it enters the TASK_STATE_RUNNING state;
[0053] In the TASK_STATE_RUNNING state, if the execution is successful or it is not in the execution time period, it enters the TASK_STATE_STOPING state and reclaims the resources used by the task; if the execution fails or the task actively sleeps, it enters the TASK_STATE_SLEEP state;
[0054] In the TASK_STATE_STOPING state, if the task is a single task, it enters the TASK_STATE_SUSPEND state; if the task is a periodic task, it enters the TASK_STATE_READY state;
[0055] In the TASK_STATE_SLEEP state, if the task queue is idle or the active sleep time ends, it returns to the TASK_STATE_RUNNING state;
[0056] In the TASK_STATE_SUSPEND state, if manually resumed, it enters the TASK_STATE_READY state.
[0057] When the reading pool module sends the second reading task to the electric meter module, the reading task is sent in the order of the electric meter priority, and the priority of the electric meter is the highest priority of the data item to be read;
[0058] In the second reading task, the data items to be read of the electricity meter are sorted by priority.
[0059] Compared with the prior art, the present invention has the following beneficial effects:
[0060] 1. The present invention provides a multi-task parallel efficient acquisition method and system based on HPLC. Through the task concurrency mechanism, multiple tasks can be executed simultaneously after the task is configured with concurrent attributes. Task switching is only triggered once within an execution period. The task status is scheduled through the state machine, which can reduce the frequency of preparation actions when the task is cut in, avoid frequent switching of task context during exclusive use, and improve acquisition efficiency.
[0061] 2. The present invention supports parallel execution of multiple tasks, which can solve the problem of easily discarding the meter data of the previous task when switching tasks, and further improve the collection efficiency.
[0062] 3. The design of the meter reading pool of the present invention can fully utilize the local communication capabilities to realize the simultaneous collection of multiple meters, that is, "concurrent collection"; it can also realize the collection of multiple meter data in each communication, that is, "merged collection". Therefore, the collection method of the present invention can greatly improve the collection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 A schematic diagram of a flow chart of a multi-task parallel and efficient acquisition method of a concentrator based on HPLC provided in Example 1 of the present invention;
[0064] Figure 2 This is a state diagram of the state machine in the first embodiment of the present invention;
[0065] Figure 3 A schematic diagram of the structure of a multi-task parallel and efficient acquisition system based on HPLC provided in the second embodiment of the present invention;
[0066] Figure 4 This is a flowchart of the interface call and message interaction between the task scheduling module and the reading pool module. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0068] Example 1
[0069] like Figure 1As shown, the first embodiment of the present invention provides a multi-task parallel efficient acquisition method based on HPLC concentrator, which is suitable for HPLC concentrator or HPLC dual-mode concentrator, including the following steps:
[0070] S1. Setting the operation mode and priority of each reading task; the operation mode is set to an exclusive task or a parallel task; determining the task transition mode of a state machine, the state machine is used to execute a first reading task, the first reading task being a task to be read data configured by the acquisition master station.
[0071] Specifically, in step 1, the route identification task and the file synchronization task are set to exclusive mode; and the proxy reading task and the meter reading task are set to parallel mode.
[0072] Specifically, in step 1, the priority of the routing identification task is higher than the file synchronization task; the priority of the proxy reading task is higher than the meter reading task.
[0073] The local communication module of the concentrator primarily performs local communication module identification, local communication module file synchronization, proxy meter reading, and meter reading. Each function is included in the task scheduler as a task category. Route identification and file synchronization are preparatory tasks required before the execution of other functions and are designed to be executed in exclusive mode, giving them a higher priority. Proxy meter reading and meter reading are frequently performed by the concentrator on a daily basis and are designed to be executed in parallel mode, giving them a lower priority. Table 1 shows the operating modes and priority settings for several common tasks in embodiments of the present invention.
[0074] Table 1 Operation modes and priority settings of several common tasks
[0075]
[0076] As shown in Table 2, in this embodiment, the task states of the state machine include the following six states:
[0077] TASK_STATE_READY status: indicates that the task can be executed, but is not within the set execution period;
[0078] TASK_STATE_DELAY state: indicates that the task execution period has entered the delay time;
[0079] TASK_STATE_RUNNING state: indicates that the task is being executed;
[0080] TASK_STATE_SLEEP state: indicates the task is in sleep state;
[0081] TASK_STATE_STOPING state: indicates the state where the task execution of this cycle is completed;
[0082] TASK_STATE_SUSPEND state: task suspended state.
[0083] Table 2 Task status and description of the state machine
[0084]
[0085]
[0086] Specifically, in this embodiment, the conversion machine is used for task scheduling, and the task scheduling is converted according to the state diagram, such as Figure 2 As shown in FIG. 1 , it is a state diagram of a state machine. In this embodiment, the state transition mode of the state machine is set to:
[0087] (1) After starting, it enters the TASK_STATE_READY state;
[0088] (2) In the TASK_STATE_READY state, if the execution time period is entered, it enters the TASK_STATE_DELAY state; if it is manually suspended, it enters the TASK_STATE_SUSPEND state;
[0089] (3) In the TASK_STATE_DELAY state, if the task delay time is reached, it enters the TASK_STATE_RUNNING state;
[0090] (4) In the TASK_STATE_RUNNING state, if the execution is successful or it is not in the execution time period, it enters the TASK_STATE_STOPING state and reclaims the resources used by the task; if the execution fails or the task actively sleeps, it enters the TASK_STATE_SLEEP state; specifically, in the TASK_STATE_RUNNING state, if it is a single task, it enters the TASK_STATE_STOPING state after successful execution; if it is a periodic task, it remains in the TASK_STATE_RUNNING state until the execution exits and then enters the TASK_STATE_STOPING state;
[0091] (5) In the TASK_STATE_STOPING state, if the task is a single task, it enters the TASK_STATE_SUSPEND state; if the task is a periodic task, it enters the TASK_STATE_READY state;
[0092] (6) In the TASK_STATE_SLEEP state, if the task queue is idle or the active sleep time ends, it returns to the TASK_STATE_RUNNING state;
[0093] (7) In the TASK_STATE_SUSPEND state, if manually resumed, it enters the TASK_STATE_READY state.
[0094] In the embodiment of the present invention, a single task is different from a periodic task. It means that it is only run once within the executable time period unless external intervention, such as human active re-triggering of execution; while a periodic task runs periodically within the running time period, and after completing the execution of one cycle, it waits for the next time cycle.
[0095] In the TASK_STATE_STOPING state, a single task is suspended because the single task has been completed within the executable time period and is in a suspended state after completion, and can wait for human triggering to resume the executable state again. In addition, the conditions for the completion of the execution of a periodic task within a cycle (or becoming an execution exit) can be either internal factors of the task, such as: the successful execution of this cycle, no remaining executable time in this cycle, or external factors: the task is manually suspended, etc. The above-mentioned conversion setting of the embodiment of the present invention can make the tasks executed in an orderly and efficient manner within the executable time period, thereby improving the efficiency of task execution.
[0096] S2. After the system is started, it is determined whether there are exclusive tasks in the task pool. If so, all exclusive tasks are executed in order of priority.
[0097] S3. After the exclusive task is completed, all parallel tasks in the task pool are obtained as the first reading task in combination with the maximum concurrency of the local channel. The tasks are executed in parallel through the task scheduling mode of the state machine to obtain the corresponding data items to be read.
[0098] S4. Read the data according to the acquired data items to be copied.
[0099] Furthermore, in step S4, the specific method for reading data according to the data item to be copied is:
[0100] Merge and reorganize all data items to be read, organize all data items to be read by adding meters in units of meters to form a second reading task and send it to the meter module;
[0101] Save the response data after receiving it from the meter module.
[0102] The first reading task also requires obtaining other information corresponding to the data item to be read, including the meter address, the data item to be read, the priority, and the task information stamp. The priority is equal to the priority corresponding to the first reading task.
[0103] Furthermore, in the step S4, when the second reading task is formed and sent to the electric meter module, it is sent in the order of the electric meter priority, and the priority of the electric meter is the highest priority of its data item to be read;
[0104] Furthermore, the second reading task includes a plurality of reading tasks based on electricity meters, each reading task corresponds to one electricity meter, and in the reading task corresponding to each electricity meter, each data item to be read is sorted by priority.
[0105] Furthermore, the HPLC-based concentrator multi-task parallel efficient data collection method of this embodiment also includes the following steps: after receiving the local channel response data, reporting it to the reading task indexed by the meter address and data item, releasing resources, and adjusting the items to be read and the meter priority of the corresponding meter.
[0106] Example 2
[0107] like Figure 3 As shown, the second embodiment of the present invention provides a concentrator multi-task parallel efficient acquisition system based on HPLC, which is used to implement the acquisition method described in the first embodiment, and includes a task scheduling module and a reading pool module.
[0108] The task scheduling module is used to obtain tasks from the task pool and execute them; it is also used to execute the first reading task to obtain the data items to be read and send them to the reading pool module; it is also used to receive the reported data sent by the reading pool module and save it after processing; the first reading task is the task of collecting data to be read configured by the master station.
[0109] When the task scheduling module executes tasks in the task pool, it gives priority to executing the exclusive tasks therein. After the exclusive tasks are completed, the state machine is used to execute multiple first reading tasks in parallel based on the maximum concurrency of the local channel to reduce the switching in and out of tasks. For example, when both Task 1 and Task 2 have exclusive attributes, during the execution of Task 1, Task 2 (which has a higher priority than Task 1) will preempt Task 1 after reaching the executable time period, that is, Task 1 will be switched out and Task 2 will be switched in. In this embodiment, the first reading task is set to be executed in parallel by the task scheduling module. Then, Task 2 will be directly switched in after reaching the executable time period, and Task 1 will not be switched out, thereby achieving the purpose of parallel execution.
[0110] The functions of the task scheduling module are as follows:
[0111] 1. Parallel scheduling and execution of all executable first reading tasks; when executing parallel reading tasks, the state machine of Example 1 is used for execution. In addition, the task scheduling module sequentially schedules the first reading tasks according to the priority strategy, and each first reading task is configured with the data items to be read by the collection master station.
[0112] 2. Organize the meters to be read and the data items to be read according to each execution task and add them to the reading pool. The content includes: meter address, data item to be read, priority (same as task priority), and task information stamp;
[0113] 3. After receiving the data reported by the reading pool module, the corresponding task is searched according to the task information stamp and the data is processed. Specifically, the reading pool module reorganizes the data items to be read and sends them to the HPLC communication module of the concentrator (terminal). After the HPLC communication module of the concentrator exchanges messages with the HPLC communication module at the meter end, the terminal receives the response data of the data items to be read. The reading pool module sends the data to the task scheduling module for deserialization and storage.
[0114] 4. The task scheduling module can also be used to execute exclusive tasks. In the vast majority of acquisition application scenarios within the acquisition terminal, exclusive tasks account for a very small proportion. Exclusive tasks are only resumed when, for example, parameters such as the acquired table files or tasks are added or deleted. All acquisition tasks, including minute freeze, hour freeze, and day freeze, which account for the largest proportion, are parallel tasks. Therefore, in this application, the task scheduling module can greatly improve acquisition efficiency by setting acquisition tasks as parallel tasks and executing them through a parallel state machine.
[0115] The reading pool module is responsible for merging and reorganizing all pending data items sent by the task scheduling module, organizing them into a second reading task by meter, and then sending it to the corresponding meter module. It is also responsible for receiving response data from the meter module and sending it to the task scheduling module. Specifically, the second reading task includes multiple meter-based reading tasks, each corresponding to a meter. Within each meter's reading task, the pending data items are sorted by priority.
[0116] The functions of the reading pool module are as follows:
[0117] 1. Organize the data items to be read added by the task scheduling module based on the electricity meter, and sort the data items to be read for each meter by priority.
[0118] 2. According to the priority order of the electricity meters, try to maximize the number of concurrent local channels and give full play to the "concurrent collection" capability (the priority of each electricity meter is the highest priority of its waiting data item); the said concurrent collection means that tasks with parallel attributes are executed in parallel (during execution, preemptive switching of tasks will not occur due to priority reasons).
[0119] 3. Merge parallel reading tasks (data items to be read) according to data item priority, fully leveraging the "merged collection" capability. Merged collection refers to merging different data items from the same meter to be read across different tasks. For example, Task 1: Meter 1 to be read has reading ID 01, and Task 2: Meter 1 to be read has reading ID 02. When organizing the reading frame, the reading pool module generates a second reading task, combining IDs 01 and 02 for the meter in question into a single data frame. Furthermore, this embodiment supports exclusive data item flags. Data items with exclusive flags are not merged with other data for collection, and can be used for task determination, data support requirements, and other requirements.
[0120] 4. Receive the local channel response data and report it to the first reading task indexed by the meter address and data item, release resources, and adjust the data items to be read and the meter priority of the corresponding meter.
[0121] Specifically, in this embodiment, the content of the first reading task includes: meter address, data item to be read, priority, and task information stamp.
[0122] Specifically, in this embodiment, the task scheduling module is further used to set the operation mode of each reading task, setting it as an exclusive task or a parallel task.
[0123] Specifically, in this embodiment, the meter reading pool module is further used to manage the queues to be read, sort them by priority, and provide the task scheduling module with interfaces for adding, deleting, modifying, and checking meter readings and reading data items.
[0124] like Figure 4 As shown in FIG, this is a flowchart of the interface call and message interaction between the task scheduling module and the reading pool module in this embodiment. The specific process is as follows:
[0125] 1. The task scheduling module schedules the first copying task in an orderly manner according to the scheduling strategy;
[0126] 2. After the first reading task is executed, the data item to be read in the task is sent to the reading pool module;
[0127] 3. The reading pool module merges and reorganizes all data items to form a second reading task (the second reading task here is actually a queue of data items to be read), and sends it to the HPLC communication module;
[0128] 4. The reading pool module receives the response data through the HPLC communication module and reports it to the task scheduling module;
[0129] 5. The task scheduling module deserializes the response frame and saves the data.
[0130] In summary, the present invention provides a multi-task parallel and efficient acquisition method and system based on HPLC, which has the following advantages:
[0131] 1. The present invention uses a task concurrency mechanism. After the task is configured with concurrent attributes, multiple tasks can be executed simultaneously. Task switching is only triggered once in an execution period, which reduces the frequency of preparatory actions when the task is cut in, avoids frequent switching of task contexts during exclusive use, and improves collection efficiency.
[0132] 2. The present invention supports parallel execution of multiple tasks, which can solve the problem of easily discarding the meter data of the previous task when switching tasks, and further improve the collection efficiency.
[0133] 3. The design of the meter reading pool of the present invention can give full play to the capability of local communication, realize the simultaneous collection of data from multiple meters, that is, realize "concurrent collection"; it can also realize the collection of multiple data of the meters in each communication, that is, realize "combined collection", therefore, the present invention can greatly improve the collection efficiency.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A concentrator multi-task parallel efficient acquisition method based on HPLC, characterized in that: The following steps are involved: S1. Setting the operation mode and priority of each reading task; the operation mode is set to an exclusive task or a parallel task; determining a state transition mode of a state machine, the state machine being used to execute a first reading task, the first reading task being a task for collecting data to be read configured by a master station; S2. After the system starts, it determines whether there are exclusive tasks in the task pool. If so, it executes all exclusive tasks in order of priority. S3. After the exclusive task is executed, all the parallel first reading tasks in the task pool are obtained and executed in parallel through the task scheduling mode of the state machine to obtain the corresponding data items to be read; S4. Read the data according to the acquired data items to be copied; The task states of the state machine include: TASK_STATE_READY status: indicates that the task can be executed, but is not within the set execution period; TASK_STATE_DELAY state: indicates that the task execution period has entered the delay time; TASK_STATE_RUNNING state: indicates that the task is being executed; TASK_STATE_SLEEP state: indicates that the task is in sleep state; TASK_STATE_STOPING state: indicates the state where the task execution of this cycle is completed; TASK_STATE_SUSPEND state: task suspended state; The state transition mode of the state machine is set to: After starting, it enters the TASK_STATE_READY state; In the TASK_STATE_READY state, if the execution time period is entered, it enters the TASK_STATE_DELAY state; if it is manually suspended, it enters the TASK_STATE_SUSPEND state; In the TASK_STATE_DELAY state, if the task delay time is reached, it enters the TASK_STATE_RUNNING state; In the TASK_STATE_RUNNING state, if the execution is successful or it is not in the execution time period, it enters the TASK_STATE_STOPING state and reclaims the resources used by the task; if the execution fails or the task actively sleeps, it enters the TASK_STATE_SLEEP state; In the TASK_STATE_STOPING state, if the task is a single task, it enters the TASK_STATE_SUSPEND state; if the task is a periodic task, it enters the TASK_STATE_READY state; In the TASK_STATE_SLEEP state, if the task queue is idle or the active sleep time ends, it returns to the TASK_STATE_RUNNING state; In the TASK_STATE_SUSPEND state, if manually resumed, it enters the TASK_STATE_READY state; The specific method for performing data copying according to the data item to be copied in step S4 is: Merge and reorganize all data items to be read, organize all data items to be read by adding meters in units of meters to form a second reading task and send it to the meter module; Save the response data after receiving it from the meter module.
2. The HPLC-based concentrator multi-task parallel efficient acquisition method according to claim 1, characterized in that: In step 1, the route identification task and the file synchronization task are set to exclusive mode; the proxy reading task and the meter reading task are set to parallel mode; the priority of the route identification task is higher than the file synchronization task; the priority of the proxy reading task is higher than the meter reading task.
3. The HPLC-based concentrator multi-task parallel efficient acquisition method according to claim 1, characterized in that: In step S4, when the second reading task is formed and sent to the electric meter module, it is sent in the order of the electric meter priority, and the priority of the electric meter is the highest priority of the data item to be read; In the second reading task, the data items to be read of the electricity meter are sorted by priority.
4. The HPLC-based concentrator multi-task parallel efficient acquisition method according to claim 1, characterized in that: The following steps are also included: After receiving the response data, it is reported to the first reading task indexed by the meter address and data item, and resources are released, and the items to be read and the meter priority of the corresponding meter are adjusted.
5. The concentrator multi-task parallel efficient acquisition system based on HPLC is characterized by: include: Task scheduling module: used to obtain tasks from the task pool and execute them; also used to execute the first reading task to obtain the data items to be read and send them to the reading pool module; also used to receive the reported data sent by the reading pool module and save it after processing; the first reading task is the task of collecting the data to be read configured by the master station; When the task scheduling module executes tasks in the task pool, the exclusive tasks are executed first. After the exclusive tasks are executed, the state machine is used to execute multiple first reading tasks in parallel according to the maximum concurrency number of the local channel. The reading pool module is used to merge and reorganize all the data items to be read sent by the task scheduling module, organize and add all the data items to be read of the meter in units of meters to form a second reading task and then send it to the corresponding meter module; It is also used to receive the response data sent by the meter module and send it to the task scheduling module; The task states of the state machine include: TASK_STATE_READY status: indicates that the task can be executed, but is not within the set execution period; TASK_STATE_DELAY state: indicates that the task execution period has entered the delay time; TASK_STATE_RUNNING state: indicates that the task is being executed; TASK_STATE_SLEEP state: indicates that the task is in sleep state; TASK_STATE_STOPING state: indicates the state where the task execution of this cycle is completed; TASK_STATE_SUSPEND state: task suspended state; The state transition mode of the state machine is set to: After starting, it enters the TASK_STATE_READY state; In the TASK_STATE_READY state, if the execution time period is entered, it enters the TASK_STATE_DELAY state; if it is manually suspended, it enters the TASK_STATE_SUSPEND state; In the TASK_STATE_DELAY state, if the task delay time is reached, it enters the TASK_STATE_RUNNING state; In the TASK_STATE_RUNNING state, if the execution is successful or it is not in the execution time period, it enters the TASK_STATE_STOPING state and reclaims the resources used by the task; if the execution fails or the task actively sleeps, it enters the TASK_STATE_SLEEP state; In the TASK_STATE_STOPING state, if the task is a single task, it enters the TASK_STATE_SUSPEND state; if the task is a periodic task, it enters the TASK_STATE_READY state; In the TASK_STATE_SLEEP state, if the task queue is idle or the active sleep time ends, it returns to the TASK_STATE_RUNNING state; In the TASK_STATE_SUSPEND state, if manually resumed, it enters the TASK_STATE_READY state.
6. The HPLC-based concentrator multi-task parallel efficient acquisition system according to claim 5, characterized in that: The task scheduling module is further configured to send the meter address, the data item to be read, the priority, and the task information stamp corresponding to the data item to be read obtained according to the first reading task to the reading pool module; The task scheduling module is further used to set the operation mode and priority of each reading task, and the operation mode includes exclusive task or parallel task.
7. The HPLC-based concentrator multi-task parallel efficient acquisition system according to claim 5, characterized in that: When the reading pool module sends the second reading task to the electric meter module, the reading task is sent in the order of the electric meter priority, and the priority of the electric meter is the highest priority of the data item to be read; In the second reading task, the data items to be read of the electricity meter are sorted by priority.
Citation Information
Patent Citations
Dynamic intelligent meter reading method and system
CN110992210A
Multi-task acquisition scheduling management method based on intelligent Internet of Things gateway
CN115048197A