The distribution system of collection tasks and the electric energy metering system based on domestic operating system
By setting up a master-slave collection server cluster in the master station layer of the electric energy measurement system, the distribution and execution of collection tasks are realized, which solves the problem of insufficient distribution of collection tasks in the electric energy measurement system, improves the stability and availability of the system, and ensures the power The company's data collection work went smoothly.
Patent Information
- Application Number
- CN201811604485.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2038-12-26
AI Technical Summary
There are deficiencies in the distribution of collection tasks at the main station level in the existing electric energy metering system, which affects the management and data collection efficiency of power enterprises.
By setting up a master collection server and a slave collection server in the master station layer of the electric energy metering system, the master collection server sends a startup command to the slave collection server, and generates collection tasks based on the startup response to realize the distribution and execution of collection tasks and form a logically unified system. Collect server clusters to achieve load balancing and multi-machine redundancy.
It improves the distribution efficiency of collection tasks and the availability of the system, avoids the problem of collection tasks being shelved due to exceptions in the collection server, and ensures the stability and security of data collection work for power companies.
Smart Images

Figure CN109460946B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data service technology, and in particular to a collection task allocation system and an electric energy metering system based on a domestic operating system. Background Art
[0002] The electric energy metering system realizes the automatic collection, calculation, statistics, in-depth analysis and prediction of power plant and substation data, providing important data support for the production and decision-making of power companies. It plays an important role in the metering management, electricity settlement and automation management of power companies, power plants, and upper and lower power supply companies. It helps power companies continuously improve their management and technical levels, and electric energy data serves as an important basis for supporting market decision-making.
[0003] At present, the allocation of acquisition tasks at the master station level still needs further study. Summary of the invention
[0004] In view of this, the purpose of the present invention is to propose a collection task allocation system and an electric energy metering system based on a domestic operating system, so as to realize the allocation of collection tasks in the electric energy metering system.
[0005] To achieve the above object, the present invention adopts the following technical solution:
[0006] An embodiment of the present invention provides a collection task allocation system, comprising a collection server cluster, wherein the collection server cluster comprises a main collection server and at least one slave collection server, wherein the main collection server and the at least one slave collection server communicate with each other via a network;
[0007] The master acquisition server is used to: send a start instruction to the at least one slave acquisition server, and receive a start response returned by the at least one slave acquisition server; generate a first acquisition task according to the start response; and assign the first acquisition task to the acquisition server started in the acquisition server cluster;
[0008] The slave acquisition server is used to: start the operation upon receiving the start instruction and return the start response; determine the assigned collector according to the first acquisition task and perform data acquisition on the assigned collector.
[0009] An embodiment of the present invention provides a method for allocating collection tasks, which can be applied to a system for allocating collection tasks in any embodiment of the present invention, including:
[0010] Sending a start instruction to at least one slave acquisition server, and receiving a start response returned by the at least one slave acquisition server;
[0011] generating a first acquisition task according to the startup response;
[0012] The first acquisition task is allocated to the enabled acquisition servers in the acquisition server cluster.
[0013] An embodiment of the present invention provides a method for allocating collection tasks, which can be applied to a system for allocating collection tasks in any embodiment of the present invention, including:
[0014] When receiving a start instruction sent by the main acquisition server, the system starts running and returns a start response to the main acquisition server;
[0015] The assigned collector is determined according to the first collection task assigned by the main collection server, and data collection is performed on the assigned collector.
[0016] The embodiment of the present invention further provides a collection task allocation device, which can be configured in the collection task allocation system in any embodiment of the present invention, including:
[0017] A start instruction sending module, used to send a start instruction to at least one slave acquisition server, and receive a start response returned by the at least one slave acquisition server;
[0018] A first acquisition task generating module, used to generate a first acquisition task according to the startup response;
[0019] The first acquisition task allocation module is used to allocate the first acquisition task to the acquisition servers started in the acquisition server cluster.
[0020] The embodiment of the present invention further provides a collection task allocation device, which can be configured in the collection task allocation system in any embodiment of the present invention, including:
[0021] A startup response returning module, used to start the operation upon receiving the startup instruction sent by the main acquisition server, and return a startup response to the main acquisition server;
[0022] The collection task execution module is used to determine the assigned collector according to the first collection task assigned by the main collection server, and perform data collection on the assigned collector.
[0023] An embodiment of the present invention also provides an electric energy metering system based on a domestic operating system, including a meter layer, a collection layer, a network layer and a master station layer, wherein the master station layer includes the collection task allocation system in any embodiment of the present invention, the meter layer is connected to the collection layer via a communication interface, and the collection layer is communicatively connected to the collection task allocation system via the network layer.
[0024] The beneficial effects of the present invention are as follows: the technical solution of the present invention forms a logically unified collection server cluster on the physical network by setting a main collection server and at least one slave collection server in multiple collection servers in the main station layer of the electric energy metering system, and the main collection server and each slave collection server communicate with each other through the network; then, the main collection server sends a startup instruction to at least one slave collection server, and the slave collection server returns a startup response, the main collection server generates a first collection task according to the startup response, and allocates the first collection task to the collection servers (including the main server and the slave server) started in the collection server cluster, so that the started collection server determines the allocated collector according to the first collection task, and collects data for the allocated collector, thereby realizing the allocation and execution of collection tasks in the collection server cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings so that those skilled in the art will understand the above and other features and advantages of the present invention more clearly. In the accompanying drawings:
[0026] Figure 1 It is a structural diagram of a collection task allocation system provided by an embodiment of the present invention;
[0027] Figure 2 is a flow chart of a method for allocating collection tasks provided by an embodiment of the present invention;
[0028] Figure 3 is a flow chart of another method for allocating collection tasks provided by an embodiment of the present invention;
[0029] Figure 4 is a structural block diagram of a collection task allocation device provided by an embodiment of the present invention;
[0030] Figure 5 It is a structural block diagram of another device for allocating collection tasks provided by an embodiment of the present invention;
[0031] Figure 6 It is a structural diagram of an electric energy metering system based on a domestic operating system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and through specific implementation methods. It is understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It is also necessary to explain that, for the convenience of description, only the parts related to the present invention are shown in the accompanying drawings, rather than all structures.
[0033] Figure 1 FIG. 1 is a schematic diagram of the structure of the collection task allocation system provided by an embodiment of the present invention. Figure 1 As shown, the collection task allocation system includes a collection server cluster 1, the collection server cluster 1 includes a main collection server 11 and at least one slave collection server 12, the main collection server 11 and at least one slave collection server 12 communicate with each other through a network;
[0034] The master acquisition server 11 is used to: send a start instruction to at least one slave acquisition server 12, and receive a start response returned by at least one slave acquisition server 12; generate a first acquisition task according to the start response; and assign the first acquisition task to the acquisition server started in the acquisition server cluster 1;
[0035] The slave collection server 12 is used to: start the operation upon receiving the start instruction and return a start response; determine the assigned collector according to the first collection task and collect data for the assigned collector.
[0036] In this embodiment, the collection server cluster 1 includes at least two collection servers. When the collection server cluster 1 starts working, one of the collection servers is commanded to start and serve as the main collection server 11, that is, the main collection server can be any collection server in the collection server cluster 1, and the other collection servers in the collection server cluster 1 are slave collection servers 12. Therefore, any collection server in the above-mentioned collection server cluster 1 is configured with the functions of the main collection server 11 and the slave collection server 12. Therefore, when starting the collection server cluster 1, if the collection server selected to start cannot be started, any other collection server can be selected to start and serve as the main collection server 11 without affecting the work of the collection server cluster 1.
[0037] Specifically, when the collection server cluster 1 or the system in which it is located is working, a startup instruction is sent to a collection server in the collection server cluster 1. After receiving the startup instruction, the collection server starts working and serves as the main collection server 11, and the other collection servers serve as slave collection servers 12. Optionally, the main collection server 11 and the slave collection server 12 are both configured with a collection communication program and a network management program. The main collection server 11 and the slave collection server 12 can be connected on a physical link through a network cable and a network switch 2, and communicate with each other through the network. Among them, the network management program running on the main collection server 11 or the slave collection server 12 can identify the network management program also running on other collection servers through the network, forming a logically unified collection server cluster 1 on the physical network. When the main acquisition server 11 is started, the network management program on the main acquisition server 11 starts running and sends a startup instruction to each slave acquisition server 12; when each slave acquisition server 12 receives the startup instruction through the network, its own network management program starts running, and the network management program that has been successfully started returns a startup response to the main acquisition server 11; the main acquisition server 11 receives each startup response, and can determine the slave acquisition servers 12 that have been successfully started based on the startup response, generate a first acquisition task based on the number of slave acquisition servers 12 that have been successfully started, and assign the first acquisition task to the acquisition servers started in the acquisition server cluster 1. Optionally, the main acquisition server 11 can evenly assign the first acquisition task to itself and the slave acquisition servers 12, the main acquisition server 11 can assign the first acquisition task to each slave acquisition server 12 separately, or share the total first acquisition task through the network management program, and each slave acquisition server 12 can identify its assigned first acquisition task based on the total first acquisition task. After the main acquisition server 11 and each slave acquisition server 12 obtain the first acquisition task, the acquisition communication program can determine the assigned collector 3 according to the first acquisition task, and perform data acquisition on the assigned collector 3 .
[0038] The system for allocating collection tasks provided by the embodiment of the present invention forms a logically unified collection server cluster on the physical network by setting a main collection server and at least one slave collection server among multiple collection servers in the master station layer of the electric energy metering system, and the main collection server and each slave collection server communicate with each other through a network; then, a start instruction is sent to at least one slave collection server through the main collection server, and a start response is returned from the slave collection server. The main collection server generates a first collection task according to the start response, and allocates the first collection task to the collection servers (including the main server and the slave server) started in the collection server cluster, so that the started collection server determines the allocated collector according to the first collection task, and collects data for the allocated collector, thereby realizing the allocation and execution of collection tasks in the collection server cluster.
[0039] Based on the above embodiment, in another embodiment of the present invention, the master acquisition server 11 is further used to: regularly send heartbeat data to the started slave acquisition server 12, and receive an ACK response returned from the slave acquisition server; determine the slave acquisition server 12 that is working normally according to the ACK response, and generate a second acquisition task based on the unfinished first acquisition task; assign the second acquisition task to the acquisition server that is working normally in the acquisition server cluster 1;
[0040] The slave collection server 12 is further used to: return an ACK response when receiving the heartbeat data; determine the assigned collector 3 according to the second collection task, and collect data for the assigned collector 3.
[0041] In this embodiment, the main acquisition server 11 sends heartbeat data to the slave acquisition servers 12 at regular intervals, so that the working status of each slave acquisition server 12 can be monitored in real time. When it is detected that a problem occurs in one or part of the slave acquisition servers (the acquisition communication program and / or the network management program occurs), the main acquisition server 11 will then uniformly supervise the unfinished first acquisition tasks, and then generate the second acquisition tasks according to the determined slave acquisition servers 12 that are working normally, and assign the second acquisition tasks to the acquisition servers (including the main acquisition server 11 and the slave acquisition servers 12) that are working normally in the acquisition server cluster 1. The main acquisition server 11 and the slave acquisition servers 12 that are working normally determine the assigned collectors 3 according to the second acquisition tasks, and perform data acquisition on the assigned collectors 3. Therefore, when a few slave acquisition servers 12 have problems (abnormalities), the unfinished first acquisition tasks on these slave acquisition servers 12 can be reallocated to other main acquisition servers 11 and slave acquisition servers 12 that are working normally to continue execution, thereby avoiding the situation that when a few slave acquisition servers 12 have problems, the assigned first acquisition tasks are shelved and affect the data acquisition work of the entire system.
[0042] Optionally, the first collection task and the second collection task on the main collection server 11 and the slave collection server 12 are evenly distributed. Exemplarily, there are X collectors 3 that need to communicate, and there are Y collection servers with communication functions. If each collection server works normally, each collection server will share an average of about X / Y collectors 3 tasks (first collection tasks) each time it communicates; if one slave collection server 12 has a problem, the remaining Y-1 collection servers will share the communication tasks of X collectors 3, that is, each collection server will share an average of about X / (Y-1) collectors 3 communication tasks (second collection tasks). Therefore, this technical solution can achieve the effects of load balancing and multi-machine redundancy, and improve the availability of the system.
[0043] Based on the above embodiment, in another embodiment of the present invention, the master acquisition server 11 is further used to: when receiving a startup response, record the startup sequence of at least one slave acquisition server 12; number the started slave acquisition servers 12 in ascending order according to the startup sequence, and share the started slave acquisition servers 12 and their corresponding numbers in the acquisition server cluster 1;
[0044] The slave acquisition server 12 is also used to determine whether the main acquisition server 11 is abnormal (has a problem); if the main acquisition server 11 is determined to be abnormal, based on the numbers of the shared slave acquisition servers 12 and their corresponding numbers, determine the slave acquisition server 12 with the smallest number and that is working normally, so as to establish the slave acquisition server with the smallest number and that is working normally as the new main acquisition server.
[0045] In this embodiment, when receiving the startup response, the main acquisition server 11 records the startup sequence of at least one slave acquisition server 12; according to the startup sequence, the started slave acquisition servers 12 are numbered in ascending order, such as starting from 1 according to the startup sequence (positive integer), and sharing in the network management program of each slave acquisition server 12, so that each slave acquisition server 12 can also identify the startup sequence of the slave acquisition server 12. Based on this, when the main acquisition server is abnormal, specifically, if the slave acquisition server 12 does not receive the heartbeat data within the time interval when the main acquisition server 11 regularly sends the heartbeat data, it is judged that the main acquisition server is abnormal, and the slave acquisition server 12 can determine the slave acquisition server 12 with the smallest number and normal operation based on the shared numbers corresponding to each slave acquisition server 12. At this time, the slave acquisition server 12 with the smallest number and normal operation is established as the new main acquisition server. If the new main acquisition server is abnormal in the subsequent work, the remaining slave acquisition server 12 that is started first and can work normally is established as the new main acquisition server, and so on. Therefore, when problems occur in the main collection server, the data collection work will not be affected, which achieves the effect of multi-machine redundancy and improves the availability of the system.
[0046] Based on the above-mentioned collection task allocation system, an embodiment of the present invention further provides a collection task allocation method, which is applied to the collection task allocation system of any of the above-mentioned embodiments. Figure 2 As shown, the method for allocating the collection task includes:
[0047] Step 110: Send a start instruction to at least one slave acquisition server, and receive a start response returned by at least one slave acquisition server.
[0048] Step 120: Generate a first collection task according to the start response.
[0049] Step 130: Allocate a first acquisition task to an enabled acquisition server in the acquisition server cluster.
[0050] The collection task allocation method of this embodiment can be executed by the main collection server in the above-mentioned collection task allocation system, and has corresponding functions and beneficial effects. The contents not fully described in the collection task allocation method can be referred to the embodiment of the above-mentioned collection task allocation system, and will not be repeated here.
[0051] Optionally, the method for allocating the collection task also includes:
[0052] Send heartbeat data to the started slave acquisition server regularly, and receive ACK responses returned from the acquisition server; determine the slave acquisition server that is working normally according to the ACK response, and generate a second acquisition task based on the unfinished first acquisition task; assign the second acquisition task to the acquisition server that is working normally in the acquisition server cluster.
[0053] Optionally, the method for allocating the collection task also includes:
[0054] When receiving a startup response, record the startup sequence of at least one slave acquisition server; number the started slave acquisition servers in ascending order according to the startup sequence, and share the started slave acquisition servers and their corresponding numbers in the acquisition server cluster.
[0055] Based on the above-mentioned collection task allocation system, an embodiment of the present invention further provides a collection task allocation method, which is applied to the collection task allocation system of any of the above-mentioned embodiments. Figure 3 As shown, the method for allocating the collection task includes:
[0056] Step 210: Start the operation upon receiving the start instruction sent by the main acquisition server, and return a start response to the main acquisition server.
[0057] Step 220: Determine the assigned collector according to the first collection task assigned by the main collection server, and perform data collection on the assigned collector.
[0058] The collection task allocation method of this embodiment can be executed by the collection server in the above-mentioned collection task allocation system, and has corresponding functions and beneficial effects. The contents not described in detail in the collection task allocation method can be referred to the embodiment of the above-mentioned collection task allocation system, and will not be repeated here.
[0059] Optionally, the method for allocating the collection task also includes:
[0060] When the heartbeat data regularly sent by the main acquisition server is received, an ACK response is returned; the assigned collector is determined according to the second acquisition task assigned by the main acquisition server, and data is collected for the assigned collector.
[0061] Optionally, the method for allocating the collection task also includes:
[0062] Determine whether the main acquisition server is abnormal; if the main acquisition server is determined to be abnormal, determine the slave acquisition server with the smallest number and working normally based on the slave acquisition servers shared by the main acquisition server in the acquisition server cluster and their corresponding numbers, so as to establish the slave acquisition server with the smallest number and working normally as the new main acquisition server.
[0063] Exemplarily, determining whether the main acquisition server is abnormal includes:
[0064] If no heartbeat data is received within the time interval at which the main acquisition server regularly sends heartbeat data, it is determined that the main acquisition server is abnormal.
[0065] In addition, an embodiment of the present invention further provides a collection task allocation device, which is configured in the collection task allocation system of any of the above embodiments, such as Figure 4 As shown, the collection task allocation device includes:
[0066] A start instruction sending module 331 is used to send a start instruction to at least one slave acquisition server and receive a start response returned by at least one slave acquisition server;
[0067] A first acquisition task generating module 332, configured to generate a first acquisition task according to a start response;
[0068] The first acquisition task allocation module 333 is used to allocate the first acquisition task to the enabled acquisition servers in the acquisition server cluster.
[0069] The device for allocating collection tasks provided in this embodiment belongs to the same inventive concept as the method for allocating collection tasks provided in any embodiment of the present invention, and can execute the method for allocating collection tasks provided in any embodiment of the present invention, and has corresponding functions and beneficial effects. For technical details not fully described in this embodiment, please refer to the method for allocating collection tasks provided in any embodiment of the present invention.
[0070] Optionally, the collection task allocation device further includes:
[0071] The heartbeat data sending module is used to send heartbeat data to the started slave acquisition server at regular intervals and receive ACK responses returned from the acquisition server;
[0072] A second collection task generating module, used to determine a slave collection server that is working normally according to the ACK response, and to generate a second collection task based on the unfinished first collection task;
[0073] The second collection task allocation module is used to allocate the second collection task to the collection servers that are working normally in the collection server cluster.
[0074] Optionally, the collection task allocation device further includes:
[0075] A startup sequence recording module, used to record the startup sequence of at least one slave acquisition server when receiving a startup response;
[0076] The encoding module is used to number the started slave acquisition servers in ascending order according to the startup sequence, and share the started slave acquisition servers and their corresponding numbers in the acquisition server cluster.
[0077] The embodiment of the present invention further provides a collection task allocation device, which is configured in the collection task allocation system of any of the above embodiments, such as Figure 5 As shown, the collection task allocation device includes:
[0078] The startup response returning module 441 is used to start the operation upon receiving the startup instruction sent by the main acquisition server, and return the startup response to the main acquisition server;
[0079] The collection task execution module 442 is used to determine the assigned collector according to the first collection task assigned by the main collection server, and perform data collection on the assigned collector.
[0080] Optionally, the collection task allocation device further includes:
[0081] ACK response module, used to return ACK response when receiving the heartbeat data sent regularly by the main acquisition server;
[0082] The second collection task execution module is used to determine the assigned collector according to the second collection task assigned by the main collection server, and perform data collection on the assigned collector.
[0083] Optionally, the collection task allocation device further includes:
[0084] An abnormality judgment module is used to judge whether the main acquisition server is abnormal;
[0085] The main acquisition server determination module is used to determine the slave acquisition server with the smallest number and working normally based on the numbers of the slave acquisition servers shared by the main acquisition server in the acquisition server cluster and their corresponding numbers if the main acquisition server is judged to be abnormal, so as to establish the slave acquisition server with the smallest number and working normally as the new main acquisition server.
[0086] Optionally, when the main acquisition server determination module determines that the main acquisition server is abnormal, specifically: if no heartbeat data is received within a time interval for the main acquisition server to regularly send heartbeat data, then it is determined that the main acquisition server is abnormal.
[0087] In addition, the embodiment of the present invention also provides an electric energy metering system based on a domestic operating system, such as Figure 6 As shown, the electric energy metering system based on the domestic operating system includes a meter layer 10, a collection layer 20, a network layer 30 and a master station layer 40. The master station layer 40 includes a collection task allocation system 1 of any of the above embodiments. The meter layer 10 is connected to the collection layer 20 through a communication interface (such as an RS485 communication interface), and the collection layer 20 is communicatively connected to the collection task allocation system 1 through the network layer 30.
[0088] The electric energy metering system based on the domestic operating system provided by the embodiment of the present invention includes the distribution system of the collection task provided by the embodiment of the present invention, and has corresponding functions and beneficial effects. In addition, the electric energy metering system based on the domestic operating system provided by this embodiment can run under the domestic operating system, is applicable to domestic databases and various types of relational databases, avoids information leakage caused by the operating system, avoids information security risks, and improves the security level of the system.
[0089] Optional, reference Figure 6 The metering layer 10 includes multiple electric energy metering devices 11 (such as electric energy meters or meters), the collection layer 20 includes multiple collectors 3, the network layer 30 includes optical fiber cables, switches, routers and telephone lines, etc., and the master station layer 40 also includes a database server 41 and a WEB server 42; the electric energy metering device 11 is connected to the corresponding collector 3 through the RS485 communication interface, and the collector 3 is communicated with the corresponding collection server in the collection task allocation system 1 through the network layer 30, and the collection task allocation system 1 is respectively connected to the database server 41 and the WEB server 42.
[0090] Specifically, the metering layer 10 mainly includes electric energy metering devices 11 such as electric energy meters or meters with communication interfaces, which are configured to complete the metering of electric energy production or consumption and the storage and display of local devices, and can communicate with the equipment of the collection layer 20, and the data is read by the collector 3 in the collection layer 20.
[0091] The collection layer 20 mainly includes a collector 3. The collector 3 is configured with an electric energy meter communication protocol, and communicates with electric energy metering devices 11 such as electric energy meters or meters at the metering layer in the downstream direction to complete the collection of electric energy meter data and store the data in the collector 3. It communicates with the collection program deployed on the collection server of the master station layer 40 in the upstream direction, and sends the data to the master station layer 40, completing the transmission of data from the field to the master station layer 40.
[0092] The network layer 30 mainly includes optical fiber cables, switches, routers, telephone lines, program-controlled switches and other equipment. Its main function is to provide a communication channel for the collection layer 20 to communicate with the main station layer 40.
[0093] The main station layer 40 mainly includes database server 41, collection server (located in the set collection task distribution system 1), WEB server 42, switches, routers and firewalls and other hardware devices. The main station layer runs the power metering system, which is based on the domestic operating system and has the following main functions:
[0094] 1) Data collection: The collection server communicates with the collector 3 to complete the collection of the electric energy meter data.
[0095] 2) Data storage: The database server 41 stores the data in a database.
[0096] 3) Electricity calculation: The WEB server 42 automatically calculates the electricity of the electric energy meter according to the archive information such as the meter ratio; and then classifies and counts the electricity according to the relationship between the electric energy meters by region and voltage level.
[0097] 4) Loss statistics: The WEB server 42 calculates the loss according to various logical relationships and loss relationships in the power system, according to categories such as transformers, buses, lines, regions, and voltage levels, and obtains the loss power and loss rate.
[0098] 5) Event alarm: The WEB server 42 issues alarms in the form of text messages, screen flashing, and sound prompts for abnormal information such as sudden changes in power, excessive losses, and collector time deviations.
[0099] In summary, the collection task allocation system and the electric energy metering system based on the domestic operating system provided by the embodiments of the present invention realize the collection task allocation while using load balancing and multi-machine redundancy technology, and have better stability and higher availability, so that the electric energy settlement business, line loss management and other tasks between power companies (power supply companies) at all levels, or between power companies and power generation enterprises can be better carried out; in addition, in view of the fact that previous collection communication programs all run on foreign operating systems, the electric energy metering system based on the domestic operating system provided by the present invention can avoid information leakage caused by the operating system, avoid information security risks, and improve the security level of the system.
[0100] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, combinations and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A collection task allocation system, characterized in that: It includes a collection server cluster, the collection server cluster includes a main collection server and at least one slave collection server, the main collection server and the at least one slave collection server communicate with each other through a network; The master acquisition server is used to: send a start instruction to the at least one slave acquisition server, and receive a start response returned by the at least one slave acquisition server; generating a first acquisition task according to the startup response; Allocating the first acquisition task to the acquisition servers started in the acquisition server cluster; The slave acquisition server is used to: start the operation upon receiving the start instruction and return the start response; determine the assigned collector according to the first acquisition task and perform data acquisition on the assigned collector; The master acquisition server is also used to: regularly send heartbeat data to the started slave acquisition server, and receive an ACK response returned by the slave acquisition server; Determine a slave acquisition server that is working normally according to the ACK response, and generate a second acquisition task based on the unfinished first acquisition task; Allocating the second acquisition task to an acquisition server in the acquisition server cluster that is operating normally; The slave acquisition server is further used to: return the ACK response when receiving the heartbeat data; Determining the assigned collector according to the second collection task, and collecting data on the assigned collector; The master acquisition server is further configured to: upon receiving the startup response, record the startup sequence of the at least one slave acquisition server; number the started slave acquisition servers in ascending order according to the startup sequence, and share the started slave acquisition servers and their corresponding numbers in the acquisition server cluster; The slave acquisition server is further used to: determine whether the master acquisition server is abnormal; if the master acquisition server is determined to be abnormal, determine the slave acquisition server with the smallest number and working normally based on the numbers corresponding to the shared slave acquisition servers, so as to establish the slave acquisition server with the smallest number and working normally as the new master acquisition server; The slave acquisition server is further configured to determine that the master acquisition server is abnormal if the slave acquisition server does not receive the heartbeat data within a time interval during which the master acquisition server regularly sends the heartbeat data.
2. A method for allocating collection tasks, applied to the collection task allocation system as claimed in claim 1, characterized in that: include: Sending a start instruction to at least one slave acquisition server, and receiving a start response returned by the at least one slave acquisition server; generating a first acquisition task according to the startup response; The first acquisition task is allocated to the enabled acquisition servers in the acquisition server cluster.
3. The method for allocating collection tasks according to claim 2, characterized in that: Also includes: Send heartbeat data to the started slave acquisition server at regular intervals, and receive an ACK response returned by the slave acquisition server; Determine a slave acquisition server that is working normally according to the ACK response, and generate a second acquisition task based on the unfinished first acquisition task; The second acquisition task is allocated to an acquisition server in the acquisition server cluster that is working normally.
4. The method for allocating collection tasks according to claim 3, characterized in that: Also includes: When receiving the startup response, recording the startup sequence of the at least one slave acquisition server; The started slave acquisition servers are numbered in ascending order according to the startup sequence, and the started slave acquisition servers and their corresponding numbers are shared in the acquisition server cluster.
5. A method for allocating collection tasks, applied to the system for allocating collection tasks as claimed in claim 1, characterized in that: include: When receiving a start instruction sent by the main acquisition server, the system starts running and returns a start response to the main acquisition server; The assigned collector is determined according to the first collection task assigned by the main collection server, and data collection is performed on the assigned collector.
6. The method for allocating collection tasks according to claim 5, characterized in that: Also includes: Upon receiving the heartbeat data sent regularly by the main acquisition server, an ACK response is returned; The assigned collector is determined according to the second collection task assigned by the main collection server, and data collection is performed on the assigned collector.
7. The method for allocating collection tasks according to claim 6, characterized in that: Also includes: Determine whether the main acquisition server is abnormal; If it is determined that the main acquisition server is abnormal, the slave acquisition server with the smallest number and working normally is determined based on the numbers of the slave acquisition servers shared by the main acquisition server in the acquisition server cluster and their corresponding numbers, so as to establish the slave acquisition server with the smallest number and working normally as the new main acquisition server.
8. The method for allocating collection tasks according to claim 6, characterized in that: Determining whether the main acquisition server is abnormal includes: If the heartbeat data is not received within the time interval at which the main acquisition server regularly sends the heartbeat data, it is determined that the main acquisition server is abnormal.
9. A collection task allocation device, configured in the collection task allocation system according to claim 1, characterized in that: include: A start instruction sending module, used to send a start instruction to at least one slave acquisition server, and receive a start response returned by the at least one slave acquisition server; A first acquisition task generating module, used to generate a first acquisition task according to the startup response; The first acquisition task allocation module is used to allocate the first acquisition task to the acquisition servers started in the acquisition server cluster.
10. A collection task allocation device, configured in the collection task allocation system according to claim 1, characterized in that: include: A startup response returning module, used to start the operation upon receiving the startup instruction sent by the main acquisition server, and return a startup response to the main acquisition server; The collection task execution module is used to determine the assigned collector according to the first collection task assigned by the main collection server, and perform data collection on the assigned collector.
11. An electric energy metering system based on a domestic operating system, characterized in that: It includes a metering layer, a collection layer, a network layer and a master station layer, wherein the master station layer includes the collection task allocation system according to claim 1, the metering layer is connected to the collection layer through a communication interface, and the collection layer is connected to the collection task allocation system through the network layer; The metering layer includes a plurality of electric energy metering devices, the collection layer includes a plurality of collectors, the network layer includes optical fiber cables, switches, routers and telephone lines, and the master station layer also includes a database server and a WEB server; The electric energy metering device is connected to the corresponding collector via the RS485 communication interface, and the collector is connected to the corresponding collection server in the collection task allocation system via the network layer, and the collection task allocation system is connected to the database server and the WEB server respectively.
