Master station meter reading control method and device based on slot and sliding window strategy

By adopting the main station meter reading control method based on slot and sliding window strategies in the power consumption information collection system, the problem of dynamic control of the maximum number of TCP connections when using the PLC-Gateway device is solved, independent concurrent reading and resource balanced allocation of terminal devices are realized, and communication efficiency is improved.

CN114364036BActive Publication Date: 2025-03-04深圳市力合微电子股份有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210054927.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-18
Publication Date
2025-03-04
Estimated Expiration
2042-01-18

AI Technical Summary

Technical Problem

The existing power consumption information collection system's main station meter reading control methods and devices cannot meet the new needs, especially when using PLC-Gateway equipment, it is impossible to dynamically control the maximum number of TCP connections of GPRS terminals, concentrators and PLC-Gateway, resulting in low communication efficiency.

Method used

The main station meter reading control method based on slot and sliding window strategies is adopted. By initializing the task data model, slot model and sliding window, independent reading and concurrent control of GPRS terminal, concentrator and PLC-Gateway is realized, and resource sharing is realized through the TCP connection resource query compensation mechanism.

Benefits of technology

It ensures that the copying and reading of all types of terminals is completely independent and concurrently executed, avoids the problem of unbalanced resource occupation, and improves the load balancing and meter reading efficiency of the TCP communication connection of the entire system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114364036B_ABST
    Figure CN114364036B_ABST
Patent Text Reader

Abstract

A master station meter reading control method and device based on slot and sliding window strategy, the method includes the following steps: S1: initialization of the master station system task data model; S2: initialization of the master station system slot model; S3: initialization of the sliding window of each slot of the master station system; S4: initialization of the sliding window of each PLC-Gateway of the master station system; S5: generation of the master station system meter collection task; S6: execution of the master station system meter collection task; S7: termination of the master station system meter collection task. The present invention can fundamentally ensure that each terminal type reads its own meter completely independently and can be executed concurrently; the communication connection of the TCP of the entire system is load balanced, and the meter reading efficiency is greatly improved; the system effectively controls the concurrent reading volume of the PLC meter, and there will be no problem of PLC network blocking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart grid communication technology, and in particular to a master station meter reading control method and device based on slot and sliding window strategies. Background Art

[0002] The domestic electricity consumption information collection system was developed in the 1980s, and has a history of more than 30 years. With the advancement of modern computer technology, communication technology and automation technology, as well as the continuous improvement of power marketing and management requirements, the overall development of the industry has been changing. In particular, in 2006, the power grid company began to initiate marketing modernization construction, and the development of the power information collection industry has entered a stage of rapid development.

[0003] According to the plan of the power grid company, by the end of the 12th Five-Year Plan, the domestic power grid will achieve "full coverage, full collection, and full fee control" for all user meters in the direct supply and direct management area. At present, the construction of the main stations of the collection systems of various provincial companies in the power grid company system has been completed and put into operation, which has provided great convenience for the construction of the power consumption information collection system. The coverage rate of the power consumption information collection system of the domestic power grid will be further accelerated.

[0004] The entire electricity consumption information collection system generally includes a collection system master station, a concentrator and smart meter equipment. The collection system master station is responsible for collecting, processing and real-time monitoring of electricity consumption information of all power users within the jurisdiction; the concentrator is the central management equipment and control equipment of the remote collection system master station, responsible for functions such as regular reading of terminal data, system command transmission, data communication, network management, event recording, and horizontal transmission of data; the smart meter is one of the basic equipment of the electricity consumption information collection system, responsible for the task of collecting, measuring and transmitting original electric energy data, and is the basis for realizing information integration, analysis optimization and information presentation.

[0005] However, in recent years, with the rapid development of power technology at home and abroad, in order to further reduce equipment costs, some companies such as Siemens have begun to launch new central management equipment PLC-Gateway to replace the original concentrator. Based on the original concentrator, this equipment removes the related functions of data acquisition and storage and adds PLC routing management. Therefore, the meter reading control method and device of the original domestic acquisition system master station can no longer meet the new requirements. For example: Since PLC-Gateway does not have data acquisition and storage functions, for the timed reading of meter curve freezing data, the master station system needs to be modified to read directly from the meter device, and control the maximum number of concurrent PLC network communications of the device like the original concentrator during the reading process; furthermore, since the master station system has added support for PLC-Gateway devices, its reading function now needs to support GPRS meters, PLC tables of concentrators and PLC-Gateway PLC tables at the same time. Therefore, how to dynamically control the maximum number of TCP connections of GPRS terminals, concentrators and PLC-Gateway to ensure the maximum communication efficiency of the entire system device has become an urgent problem to be solved. Summary of the invention

[0006] In order to solve the above technical problems, the present invention provides a master station meter reading control method and device based on slot and sliding window strategy. To achieve the above purpose, the present invention adopts the following technical solutions:

[0007] A master station meter reading control method based on slot and sliding window strategy comprises the following steps:

[0008] S1: Initialization of the master station system task data model;

[0009] S2: Initialization of the master station system slot model;

[0010] S3: Initialization of sliding windows of each slot of the master system;

[0011] S4: Initialization of the sliding windows of each PLC-Gateway of the master station system;

[0012] S5: Generation of the master station system meter collection task;

[0013] S6: Execution of the master station system meter collection task;

[0014] S7: End of the master station system electricity meter collection task.

[0015] A master station meter reading control device based on slot and sliding window strategy comprises: a processor and a computer-readable storage medium; when a computer program stored in the computer-readable storage medium is executed by the processor, the master station meter reading control method based on slot and sliding window strategy is implemented.

[0016] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0017] (1) Since the device of the embodiment of the present invention adopts a slot processing strategy for the GPRS terminal, concentrator and PLC-Gateway, compared with the prior art, it fundamentally ensures that they read the meters of their respective terminals completely independently and can be executed concurrently. There will be no problem that the meter of a certain terminal type A is read all the time for a period of time, causing the meters of all other terminal types to be blocked and unable to be read.

[0018] (2) In addition, since the device of the embodiment of the present invention adopts the concurrent control of the sliding window method for the meter reading terminal tasks of each slot, compared with the prior art, it fundamentally ensures that the TCP connection resources of various terminals in the master station system can be configured and evenly distributed according to actual needs, and there will be no situation where a certain terminal type A always occupies a large amount of resources while other terminal types have no resources available. At the same time, since the system also adds a TCP connection resource query compensation mechanism on this basis, resources can be shared among these slots. Once a task in a slot is completed or the number of resources required is less than the maximum value allocated by its own sliding window, these idle resources can be shared with other slots with a large number of unfinished tasks. Therefore, through the above method, the TCP communication connection of the entire system achieves load balancing, and the meter reading efficiency is greatly improved.

[0019] (3) Finally, since the device of the embodiment of the present invention also performs concurrent control in a sliding window manner for the meter tasks of each PLC-Gateway, the master station system can effectively control the concurrent reading volume of the PLC meter of this type of terminal device, and the problem of PLC network congestion will not occur like the concentrator. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a design diagram of a task data model according to an embodiment of the present invention;

[0021] Figure 2 A slot model design diagram of an embodiment of the present invention;

[0022] Figure 3 It is a design diagram of the PLC-Gateway task queue model of an embodiment of the present invention;

[0023] Figure 4 A flow chart of generating an electric meter collection task according to an embodiment of the present invention;

[0024] Figure 5 This is a flowchart of ending the electricity meter collection task according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The embodiments of the present invention are further described below in conjunction with the accompanying drawings and specific implementation methods.

[0026] S1: Initialization of the master station system task data model, such as Figure 1 As shown, the specific performance is:

[0027] In the system, one terminal task can store multiple meter tasks of the terminal, and one meter task can store multiple meter reading tasks of different curve types of the meter.

[0028] The terminal here can be a GPRS terminal, or a concentrator or a PLC-Gateway; the electric meter here can be a GPRS meter or a PLC meter; the curve here can be a daily freezing curve, or a minute freezing curve or a monthly freezing curve, etc.

[0029] S2: Initialization of the master station system slot model, such as Figure 2 As shown, the specific performance is:

[0030] When the system starts, the number of terminal files of each terminal type is read, for example: the number of GPRS terminals is k, the number of concentrators (DCU) is p, and the number of PLC-Gateway is q; then slots are added in the memory for these three types of terminals to store terminal tasks.

[0031] S3: Initialization of the sliding windows of each slot in the master system, such as Figure 2 As shown, the specific performance is:

[0032] The system reads the sliding window parameters of each terminal type, for example: the maximum concurrent task number of GPRS terminal is Mx, the maximum concurrent task number of concentrator is My, and the maximum concurrent task number of PLC-Gateway is Mz;

[0033] Then calculate the maximum number of TCP resource connections M supported by the system;

[0034] M=Mx+My+Mz

[0035] Calculate the number of sliding window concurrency actually used when the system starts for each terminal type:

[0036] Rx = Mx;

[0037] Ry=My;

[0038] Rz=Mz;

[0039] Finally, the actual number of sliding window concurrency used by each terminal type is loaded into the collection task execution module.

[0040] It should be noted that the sliding window here is to perform concurrent control on the terminal tasks of the slot, that is, each slot only allows Rx / Ry / Rz terminal tasks to be executed simultaneously at the same time; the value of M is calculated based on the sum of the maximum concurrent number of terminal tasks of each slot when the system starts, and will remain unchanged in the subsequent task processing flow.

[0041] S4: Initialize the sliding windows of each PLC-Gateway in the master station system, such as Figure 3 As shown, the specific performance is:

[0042] The system reads the configured PLC-Gateway meter sliding window parameter m and then loads it into the task acquisition module.

[0043] It should be noted that the sliding window here refers to the terminal's concurrent control of the meter task, that is, the terminal task only allows m internal meter tasks to be executed at the same time. For GPRS terminals and concentrators, the number of concurrent tasks is generally 1. If you need to increase the number of concurrent tasks and control them, you can do the same thing. I will not elaborate on this here.

[0044] S5: The generation of the master station system meter collection task is as follows:

[0045] Whenever the start time of each configured curve collection task cycle arrives, the master station system will immediately generate a new meter reading task t2 for all meters of all associated terminals, and then try to insert the task into the correct position in the slot, such as Figure 4 As shown, the process method for inserting a new task is as follows:

[0046] 1. Find the corresponding slot according to the terminal type;

[0047] 2. Check the slot for the corresponding terminal task based on the terminal ID;

[0048] If not found, a new terminal task is created.

[0049] 3. Check whether there is a corresponding meter task in the terminal task according to the meter ID;

[0050] If not found, a new meter task is created and inserted into the internal queue of the terminal task.

[0051] 4. Search the meter tasks for tasks with the same curve type based on the curve ID.

[0052] If a task t1 of the same curve type is found, task t2 is merged into task t1; otherwise, task t2 is directly inserted into the internal queue of the electric meter task.

[0053] S6: Execution of the master station system meter collection task, specifically:

[0054] The system will continuously traverse all slots when executing tasks, and directly execute the first Rx / Ry / Rz terminal tasks in each slot at the same time according to the current sliding window size Rx / Ry / Rz value of each slot;

[0055] At the same time, when the system executes the terminal tasks of each PLC-Gateway, it will also directly execute the first m meter tasks in its internal queue at the same time according to the configured meter sliding window parameter m;

[0056] Finally, it should be noted that when the system executes each meter task, since it does not use a sliding window method, the various curve meter reading tasks in its internal queue are still executed serially one by one starting from the head.

[0057] S7: The end of the master station system meter collection task, such as Figure 5 As shown, the specific performance is:

[0058] For the curve reading task t3 of the meter task Ma of the terminal task Ta, it is an indivisible minimum atomic task. When the task is completed, if it is successful, the following process is executed:

[0059] 1. Delete task t3 directly from the internal queue of meter task Ma;

[0060] 2. Check whether the internal queue of the meter task Ma is empty;

[0061] 3. If it is empty, delete the meter task Ma from the internal queue of the terminal task Ta; otherwise, add a new meter task Mb to the sliding window;

[0062] 4. Check whether the internal queue of the terminal task Ta is empty;

[0063] 5. If it is empty, delete the terminal task Ta from the slot and execute the TCP connection number sharing compensation process; otherwise, add a new terminal task Tb to the sliding window.

[0064] If it fails, execute the following process:

[0065] 1. Change the status of task t3 to suspended;

[0066] 2. Change the status of the meter task Ma to suspended, and increase the number of retries by 1;

[0067] 4. Determine whether the number of retries of the meter task Ma is greater than the maximum value Mr (preferably the default value 7);

[0068] 5. If it is not greater than the maximum value Mr, move the meter task Ma to the end of the internal queue, start requeuing, and add the new meter task Mb to the sliding window; otherwise, go to step 6;

[0069] 6. Delete the meter task Ma from the internal queue of the terminal task Ta;

[0070] 7. Check whether the internal queue of the terminal task Ta is empty;

[0071] 8. If it is empty, delete the terminal task Ta from the slot and execute the TCP connection number sharing compensation process; otherwise, add a new terminal task Tb to the sliding window.

[0072] Preferably, the TCP connection number sharing compensation process for S7 is specifically implemented as follows:

[0073] 1. The system queries the number of terminal tasks currently being executed in each slot, assuming that the GPRS terminal is Cx, the concentrator is Cy, and the PLC-Gateway is Cz;

[0074] 2. The system calculates the current total number of idle TCP connection resources F = M–Cx–Cy–Cz, and the current number of idle TCP connection resources of the GPRS terminal Fx = Mx–Cx.

[0075] The number of idle resources of TCP connections in the current concentrator is Fy = My – Cy,

[0076] The current number of idle resources of TCP connection of PLC-Gateway is Fz=Mz–Cz;

[0077] 3. The system selects slots with more terminal tasks that are not greater than 0 from Fx, Fy, and Fz, and evenly distributes all the idle resources F to these slots. If they cannot be divided equally, the remaining resources will be randomly distributed after equal division;

[0078] 6. Load the latest sliding window concurrency count of each slot into the collection task execution module.

[0079] It should be noted that whenever a new collection cycle of the curve collection task arrives, the maximum concurrency of the sliding windows of all slots will be restored to the default setting, and the shared compensation will be reset and restarted immediately.

[0080] The background section of the present invention may contain background information about the problem or environment of the present invention, but does not necessarily describe the prior art. Therefore, the content included in the background section is not an admission by the applicant that the prior art is available.

[0081] The above content is a further detailed description of the present invention in combination with specific / preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, without departing from the concept of the present invention, it can also make several substitutions or modifications to these described embodiments, and these substitutions or modifications should be regarded as belonging to the protection scope of the present invention. In the description of this specification, the description of the reference terms "an embodiment", "some embodiments", "preferred embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in combination with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In the absence of mutual contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples. Although the embodiments of the present invention and their advantages have been described in detail, it should be understood that various changes, substitutions and modifications can be made herein without departing from the scope of protection of the patent application.

Claims

1. A master station meter reading control method based on slot and sliding window strategy, characterized in that: The following steps are involved: S1: Initialization of the master station system task data model; S2: Initialization of the master station system slot model; S3: Initialization of sliding windows of each slot of the master system; S4: Initialization of the sliding windows of each PLC-Gateway of the master station system; S5: Generation of the master station system meter collection task; S6: Execution of the master station system meter collection task; S7: End of the master station system meter collection task; Step S3 includes: reading sliding window parameters of each terminal type; Calculate the maximum number of TCP resource connections M supported by the system; M=Mx+My+Mz Mx is the maximum concurrent number of tasks of the GPRS terminal, My is the maximum concurrent number of tasks of the concentrator, and Mz is the maximum concurrent number of tasks of the PLC-Gateway; Calculate the number of sliding window concurrency actually used when the system starts for each terminal type: Rx = Mx; Ry=My; Rz=Mz; Load the actual number of concurrent sliding windows used by each terminal type into the collection task execution module; Among them, the sliding window is used to perform concurrent control on the terminal tasks of the slot, that is, each slot only allows Rx / Ry / Rz terminal tasks to be executed simultaneously at the same time; the value of M is calculated based on the sum of the maximum concurrent number of terminal tasks of each slot when the system starts, and remains unchanged in the subsequent task processing flow.

2. The master station meter reading control method according to claim 1, characterized in that: In step S1, one terminal task in the master station system can store multiple meter tasks of the terminals, and one meter task can store multiple meter reading tasks of different curve types of the meter; the terminal is a GPRS terminal, a concentrator or a PLC-Gateway; the meter is a GPRS meter or a PLC meter; the curve is a daily frozen curve, a minute frozen curve or a monthly frozen curve.

3. The master station meter reading control method according to claim 1, characterized in that: In step S2, when the master station system is started, the number of terminal files of each terminal type is read, and then slots are added in the memory for each terminal type to store terminal tasks.

4. The master station meter reading control method according to claim 1, characterized in that: In step S4, the configured PLC-Gateway meter sliding window parameter m is read and then loaded into the task acquisition module; The sliding window is a concurrent control of the electric meter tasks by the terminal, that is, the terminal task only allows m internal electric meter tasks to be executed simultaneously at the same time.

5. The master station meter reading control method according to claim 1, characterized in that: In step S5, whenever the configured start time of each curve collection task cycle arrives, the master station system generates a new meter reading task t2 of the curve for all meters of all associated terminals, and then tries to insert the task into the correct position in the slot.

6. The master station meter reading control method according to claim 1, characterized in that: In step S5, the method for inserting a new meter reading task includes the following process: 1) Find the corresponding slot according to the terminal type; 2) Check whether there is a corresponding terminal task in the slot according to the terminal ID; If not found, a new terminal task is created; 3) Search the terminal tasks for corresponding meter tasks according to the meter ID; If not found, a new meter task is created and inserted into the internal queue of the terminal task; 4) Search the meter tasks for tasks with the same curve type according to the curve ID; If a task t1 of the same curve type is found, task t2 is merged into task t1; otherwise, task t2 is directly inserted into the internal queue of the electric meter task.

7. The master station meter reading control method according to claim 1, characterized in that: In step S6, when executing tasks, all slots are continuously traversed, and according to the current sliding window size Rx / Ry / Rz value of each slot, the first Rx / Ry / Rz terminal tasks in each slot are directly executed simultaneously; When executing the terminal tasks of each PLC-Gateway, the first m meter tasks in its internal queue are directly executed simultaneously according to the configured meter sliding window parameter m.

8. The master station meter reading control method according to claim 1, characterized in that: Step S7 includes: For the curve reading task t3 of the meter task Ma of the terminal task Ta, it is an indivisible minimum atomic task; when the task is completed, if it is successful, the following process is executed: Directly delete task t3 from the internal queue of the meter task Ma; Check whether the internal queue of the meter task Ma is empty; If it is empty, delete the meter task Ma from the internal queue of the terminal task Ta; otherwise, add a new meter task Mb to the sliding window; Check whether the internal queue of the terminal task Ta is empty; If it is empty, delete the terminal task Ta from the slot and execute the TCP connection number sharing compensation process; otherwise, add a new terminal task Tb to the sliding window; When the task is completed, if it fails, the following process is executed: Change the status of task t3 to suspended; Change the status of the meter task Ma to suspended, and increase the number of retries by 1; Determine whether the number of retries of the meter task Ma is greater than the maximum value Mr; If it is not greater than the maximum value Mr, move the meter task Ma to the end of the internal queue, start requeuing, and add a new meter task Mb to the sliding window; otherwise, proceed to the next step; Delete the meter task Ma from the internal queue of the terminal task Ta; Check whether the internal queue of the terminal task Ta is empty; If it is empty, delete the terminal task Ta from the slot and execute the TCP connection number sharing compensation process; otherwise, add a new terminal task Tb to the sliding window.

9. The master station meter reading control method according to claim 8, characterized in that: The TCP connection number sharing compensation process includes: Query the number of terminal tasks currently being executed in each slot; Calculate the current total number of idle TCP connection resources F = M – Cx – Cy – Cz; Calculate the number of idle resources of TCP connection of the current GPRS terminal Fx = Mx – Cx; Calculate the number of idle resources of TCP connections in the current concentrator: Fy = My – Cy; Calculate the number of idle resources of TCP connection of current PLC-Gateway Fz = Mz – Cz; Among them, Cx represents GPRS terminal, Cy represents concentrator, and Cz represents PLC-Gateway; Select slots with more terminal tasks whose number is not greater than 0 from Fx, Fy, and Fz, and evenly distribute all the idle resources F to these slots; Load the latest sliding window concurrency count of each slot into the collection task execution module; Among them, every time a new collection cycle of the curve collection task arrives, the maximum concurrency of the sliding windows of all slots will be restored to the default setting, and the shared compensation will be reset and restarted immediately.

10. The master station meter reading control method according to claim 9, characterized in that: If all the free resources F cannot be divided equally, the remaining resources will be randomly allocated after equal division.

11. A master station meter reading control device based on slot and sliding window strategy, characterized in that: include: processor; computer readable storage medium; Wherein, when the computer program stored in the computer-readable storage medium is executed by the processor, the master station meter reading control method based on the slot and sliding window strategy as claimed in any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Lock-free multi-co-processing thread concurrent meter reading method based on double-ring queue

    CN113242059A