Multi-master-station operation method and device of electric power acquisition terminal and electric power acquisition terminal
By introducing channel processes and multi-process collaborative work in the power acquisition terminal, it supports dual-main station and dual-protocol operation, solving the problem of single-main station restrictions in the existing technology, and realizing flexible maintenance and data collection of power acquisition terminals Continuity.
Patent Information
- Application Number
- CN202411308563.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-27
AI Technical Summary
The existing power acquisition terminal only supports single protocol and single master station online, and needs to be disconnected during maintenance and upgrade, which affects the use of functions and leads to inconvenient maintenance.
The channel process receives messages sent by multiple masters and sends them to the first and second processes respectively. Different communication protocols are used to parse and set downlink acquisition parameters, and supports dual masters and dual protocols to ensure the continuity of data acquisition and Maintenance flexibility.
It realizes stable operation and maintenance upgrade of power acquisition terminals in a multi-main site environment, reduces on-site maintenance difficulty, and ensures the continuity of data acquisition and system stability.
Smart Images

Figure CN119211775A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power data collection, and in particular to a multi-master station operation method and device of a power collection terminal and a power collection terminal. Background Art
[0002] The power collection terminal is a device used to collect power data in the power system. It can automatically collect power instead of manually. It is an important process in the development of intelligent power grids and is often used in conjunction with power meters. In order to accurately calculate the power supply quality, the power collection terminal is required to collect users' power consumption data in real time and at high frequency. The power collection terminal needs to work with the master station, collect the corresponding meter parameters according to the collection parameters issued by the master station, and upload the collected data to the master station.
[0003] At present, most power collection terminals only support a single protocol and a single master station online. When the master station is maintained or upgraded, the connection between the master station and the power collection terminal needs to be disconnected, which affects the normal function of the power collection terminal and makes the maintenance and upgrade of the power collection terminal inconvenient. Summary of the invention
[0004] In view of this, the present invention provides a multi-master station operation method and device of a power collection terminal and a power collection terminal to solve or partially solve the technical problem of inconvenient maintenance and upgrading of existing power collection terminals.
[0005] In a first aspect, the present invention provides a multi-master station operation method of a power acquisition terminal, comprising: monitoring whether a first message sent by a first master station or a second message sent by a second master station is received based on a channel process, and sending the first message and the second message to the first process and the second process respectively when the first message or the second message is received; if the first process receives the first message, the first communication protocol is used to parse the first message to obtain the function of the first message, when the function of the first message is acquisition parameter setting, the downlink acquisition parameters are set according to the first message, and the monitoring data of the power terminal is collected based on the currently set downlink acquisition parameters and the collected data is stored in an acquisition database; if the second process receives the second message, the second communication protocol is used to parse the second message to obtain the function of the second message, when the function of the second message is acquisition parameter setting, the parameter information in the second message is extracted, and the parameter information is sent to the first process, and the downlink acquisition parameters are set based on the parameter information through the first process.
[0006] A multi-master station operation method of a power collection terminal of the present invention receives a first message sent by a first master station or a second message sent by a second master station through a channel process. When the first message is received, the first process uses a first communication protocol to parse the first message to obtain the function of the first message. When the function of the first message is a collection parameter setting, the downlink collection parameters are set according to the first message, and the monitoring data of the power terminal is collected based on the currently set downlink collection parameters and the collected data is stored in a collection database. If a second message is received, the second process uses a second communication protocol to parse the second message to obtain the function of the second message. When the function of the second message is a collection parameter setting, , extract the parameter information in the second message, and send the parameter information to the first process, and set the downlink collection parameters based on the parameter information through the first process, so that no matter whether it is connected to the first master station or the second master station, the power collection terminal can set the downlink collection parameters and collect the monitoring data of the power terminal through the first process, so that the power collection terminal can support dual-master station dual-protocol operation. During normal operation, the power collection terminal accesses the first master station to run the collection parameters. When the power collection terminal is maintained and upgraded, it can be connected to the second master station to run the collection parameters. The manufacturer maintains the first master station to ensure the continuity of data collection, reduce the difficulty of on-site maintenance, and facilitate the maintenance and upgrade of the master station.
[0007] Optionally, the format of the data stored in the acquisition database includes an acquisition database that stores data based on the first communication protocol format and an acquisition database that stores data based on the first communication protocol format. After the function of parsing the first message using the first communication protocol to obtain the first message, it also includes: when the function of the first message is to obtain the acquired data, the corresponding data is obtained from the acquisition database that stores data based on the first communication protocol format and the corresponding data is returned to the first main station through the channel process; correspondingly, after the function of parsing the second message using the second communication protocol to obtain the second message, it also includes: when the function of the second message is to obtain the acquired data, the corresponding data is obtained from the acquisition database that stores data based on the second communication protocol format and the corresponding data is returned to the second main station through the channel process.
[0008] In this manner, when the first message or the second message requests data collection, the power collection terminal can obtain and return the required data from the collection database, and supports dual master stations to obtain collection data.
[0009] Optionally, after storing the collected data in the collection database, it also includes: monitoring whether the data in the collection database has changed; if the data in the collection database has changed, sending a data change notification to the second process, and obtaining storage data based on the first communication protocol format from the collection database, performing a first abnormal event detection based on the acquired storage data and a first event judgment parameter and uploading the detection result to the first main station, wherein the first event judgment parameter is obtained by parsing the first message.
[0010] Through the first abnormal event detection, potential problems can be discovered in time, which improves the safety and predictive maintenance capabilities of the power collection terminal. At the same time, the data change notification is sent to the second process so that the second process can also perform abnormality detection.
[0011] Optionally, after sending the data change notification to the second process, it also includes: monitoring whether the data change notification is received through the second process; if the data change notification is received, storing the changed data content in the collection database to which the second process belongs based on the second communication protocol, and obtaining the stored data based on the second communication protocol format from the collection database, performing a second abnormal event detection based on the acquired stored data and the second event judgment parameter and uploading the detection result to the second main station, wherein the second event judgment parameter is obtained by parsing the second message.
[0012] The second process is able to respond to data change notifications and perform a second abnormal event detection, which ensures that the power system status can be monitored even when switching between master stations, improving the power collection terminal's ability to handle abnormal situations.
[0013] Optionally, before monitoring whether a first message sent by the first master station or a second message sent by the second master station is received based on the channel process, it also includes: maintaining the communication connection between the first master station and the power collection terminal, and the communication connection between the second master station and the power collection terminal through the channel process.
[0014] By maintaining the communication connection with the two master stations, the power collection terminal ensures stable communication with the first and second master stations, helping to maintain real-time transmission of data and continuous operation of the system, especially when the network environment is unstable or the master station is undergoing maintenance.
[0015] Optionally, the communication connection between the first master station and the power collection terminal and the communication connection between the second master station and the power collection terminal both include Ethernet connection, remote connection and local connection; correspondingly, the communication connection between the first master station and the power collection terminal and the communication connection between the second master station and the power collection terminal are maintained through the channel process, including: when both the first master station and the second master station fail to log in successfully, periodically resetting the Ethernet chip and connecting the IP port of the first master station and the IP port of the second master station by socket after detecting that the Ethernet interface is inserted, sending a login packet of the corresponding communication protocol to the IP port of the first master station and the IP port of the second master station , and maintain the heartbeat of the first master station and the heartbeat of the second master station after the first master station and the second master station log in through Ethernet; when the first master station and the second master station fail to log in successfully, reset the remote module periodically and connect the IP port of the first master station and the IP port of the second master station by socket after detecting the insertion of the remote module, send the login packet of the corresponding communication protocol to the IP port of the first master station and the IP port of the second master station, and maintain the heartbeat of the first master station and the heartbeat of the second master station after the first master station and the second master station log in through the remote network; monitor the data of the local communication interface and perform message adaptability check on the messages input through the local communication interface.
[0016] In this mode, the channel process supports multiple communication connection modes such as Ethernet, remote and local, providing more connection options and higher flexibility, enabling the power collection terminal to operate stably in different network environments, and improving the adaptability and robustness of the power collection terminal.
[0017] In a second aspect, the present invention provides a multi-master station operation device of an electric power acquisition terminal, comprising: a channel process module, for monitoring whether a first message sent by a first master station or a second message sent by a second master station is received based on a channel process, and sending the first message and the second message to the first process and the second process respectively when the first message or the second message is received; a first process module, for, if the first process receives the first message, using a first communication protocol to parse the first message to obtain the function of the first message, when the function of the first message is acquisition parameter setting, setting the downlink acquisition parameters according to the first message, collecting the monitoring data of the electric power terminal based on the currently set downlink acquisition parameters and storing the collected data in an acquisition database; a second process module, for, if the second process receives the second message, using a second communication protocol to parse the second message to obtain the function of the second message, when the function of the second message is acquisition parameter setting, extracting the parameter information in the second message, and sending the parameter information to the first process, and setting the downlink acquisition parameters based on the parameter information through the first process.
[0018] In a third aspect, the present invention provides a power collection terminal, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the multi-master station operation method of the power collection terminal of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0019] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the multi-master station operation method of a power collection terminal of the first aspect or any corresponding embodiment thereof.
[0020] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the multi-master station operation method of the power collection terminal as in the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 It is a flowchart of a multi-master station operation method of a power collection terminal according to an embodiment of the present invention;
[0023] Figure 2 It is a schematic diagram of the operating framework of the multi-master station operating method of the power collection terminal according to an embodiment of the present invention;
[0024] Figure 3 is a workflow diagram of an uplink message processing thread in a first process of an embodiment of the present invention;
[0025] Figure 4 is a workflow diagram of a parameter synchronization thread in a first process of an embodiment of the present invention;
[0026] Figure 5 is a workflow diagram of a downlink collection thread in a first process of an embodiment of the present invention;
[0027] Figure 6 is a workflow diagram of a data collection and storage thread in a first process of an embodiment of the present invention;
[0028] Figure 7 is a workflow diagram of a data analysis thread in a first process of an embodiment of the present invention;
[0029] Figure 8 is a workflow diagram of an uplink message processing thread in the second process of an embodiment of the present invention;
[0030] Fig. 9 is a workflow diagram of a data collection and storage thread in a second process of an embodiment of the present invention;
[0031] Fig.10 is a workflow diagram of a data analysis thread in a second process of an embodiment of the present invention;
[0032] Fig.11 is a workflow diagram of an Ethernet thread in a channel process of an embodiment of the present invention;
[0033] Fig.12 is a workflow diagram of a remote module thread in a channel process of an embodiment of the present invention;
[0034] Fig.13 is a workflow diagram of a local communication thread in a channel process of an embodiment of the present invention;
[0035] Fig.14 It is a structural block diagram of a multi-master station operation device of a power collection terminal according to an embodiment of the present invention;
[0036] Fig.15 It is a schematic diagram of the hardware structure of the power collection terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0038] In view of the problem that the current power collection terminal only supports a single protocol and a single master station online, and cannot adapt to the second master station in the on-site master station iteration scenario, cannot access the second master station and maintain the first master station, and is inconvenient to maintain, an embodiment of the present invention provides a multi-master station operation method for a power collection terminal, which realizes the online operation of multiple master stations of the power collection terminal and can reduce the difficulty of upgrading the on-site power collection terminal.
[0039] According to an embodiment of the present invention, an embodiment of a multi-master station operation method of a power collection terminal is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0040] In this embodiment, a multi-master station operation method of a power collection terminal is provided, which is applied to a power collection terminal, such as Figures 1 to 13 As shown, the process includes the following steps:
[0041] Step S101, based on the channel process, monitors whether a first message sent by the first master station or a second message sent by the second master station is received, and sends the first message and the second message to the first process and the second process respectively when the first message or the second message is received.
[0042] Specifically, the channel process is mainly responsible for performing tasks such as protocol distribution and link keep-alive of multiple master stations, and receiving the first message sent by the first master station or the second message sent by the second master station while maintaining the communication connection with the first master station or the second master station. The channel process can be connected to the first master station and the second master station at the same time, or connected to the first master station or the second master station separately.
[0043] Step S102: If the first process receives the first message, the first communication protocol is used to parse the first message to obtain the function of the first message. When the function of the first message is to set the acquisition parameters, the downlink acquisition parameters are set according to the first message, and the monitoring data of the power terminal is collected based on the currently set downlink acquisition parameters and the collected data is stored in the acquisition database.
[0044] Specifically, the communication protocol between the first master station and the power collection terminal is the first communication protocol, and the communication protocol between the second master station and the power collection terminal is the second communication protocol. The first communication protocol and the second communication protocol are two different protocols. Exemplarily, the first communication protocol is the 698 communication protocol, and the second communication protocol is the 376 communication protocol.
[0045] The first process can parse the format of the first message in the first communication protocol format, and set the downlink collection parameters by parsing the content, and can also monitor the parameter information of the second process to set the downlink collection parameters. The first process can also perform downlink meter reading, that is, collect monitoring data of power terminals such as electric meters, water meters and other equipment based on the currently set downlink collection parameters and store the collected data in the collection database.
[0046] In one example, the first process is provided with an uplink message processing thread, a downlink collection thread and a parameter synchronization thread. The uplink message processing thread needs to listen to the first message from the channel process, and perform corresponding operations after parsing the first message, including parameter setting, parameter reading, method execution, etc., and reply the execution result to the channel process; the downlink collection thread collects the electric meter and water meter data through interfaces such as RS485 / MBUS according to the meter reading configuration in the downlink collection parameters, and stores it in the collection database for other processes to read; the parameter synchronization thread sets the downlink collection parameters according to the parameter setting information in the first message, listens to the parameter messages from other protocol processes, and performs parameter synchronization.
[0047] Step S103: If the second process receives the second message, the second communication protocol is used to parse the second message to obtain the function of the second message. When the function of the second message is to set the acquisition parameters, the parameter information in the second message is extracted and sent to the first process. The downlink acquisition parameters are set based on the parameter information by the first process.
[0048] The second process can perform format parsing on the second message in the second communication protocol format. If it is confirmed after parsing that the function of the second message is to set acquisition parameters, the parameter information in the second message is converted into the format of the first communication protocol and sent to the first process. The first process sets the downlink acquisition parameters based on the received parameter information.
[0049] Exemplarily, the second process is also provided with an uplink message processing thread, which performs format parsing on the second message from the channel process, converts the parameter information of the second message whose function is to collect parameter settings into the first communication protocol format, and sends it to the first process synchronously.
[0050] Since the downstream hardware interface of the power collection terminal can only be controlled by one process, such as the carrier and RS485, if multiple processes control the meter reading at the same time, the workflow will be disrupted. Therefore, in the embodiment of the present invention, only the first process collects data from external devices such as electric energy meters through the hardware interface, and stores the data in the internal collection database. The second process connected to the other second master station directly converts the collected data into the second process protocol format through the internal database and stores it in the collection database, and performs data acquisition and processing. The second process can also synchronize the parameter information sent by the second master station to the first process for downstream collection parameter setting. By setting the channel process, the first process and the second process, the power collection terminal supports online operation of dual master stations, and can achieve normal operation under both master stations.
[0051] A multi-master station operation method of a power collection terminal according to an embodiment of the present invention receives a first message sent by a first master station or a second message sent by a second master station through a channel process. When the first message is received, the first process uses a first communication protocol to parse the first message to obtain the function of the first message. When the function of the first message is a collection parameter setting, the downlink collection parameters are set according to the first message, and the monitoring data of the power terminal is collected based on the currently set downlink collection parameters and the collected data is stored in a collection database. If a second message is received, the second process uses a second communication protocol to parse the second message to obtain the function of the second message. When the function of the second message is a collection parameter setting, the downlink collection parameters are set according to the first message. The monitoring data of the power terminal is collected based on the currently set downlink collection parameters and the collected data is stored in a collection database. When the power acquisition terminal is set, the parameter information in the second message is extracted, and the parameter information is sent to the first process. The downlink acquisition parameters are set by the first process based on the parameter information, so that no matter whether it is connected to the first master station or the second master station, the power acquisition terminal can set the downlink acquisition parameters and collect the monitoring data of the power terminal through the first process, so that the power acquisition terminal can support dual-master station dual-protocol operation. During normal operation, the power acquisition terminal accesses the first master station to run the acquisition parameters. When the power acquisition terminal is maintained and upgraded, it can be connected to the second master station to run the acquisition parameters. The manufacturer maintains the first master station to ensure the continuity of data acquisition, reduce the difficulty of on-site maintenance, and facilitate the maintenance and upgrade of the master station.
[0052] According to a multi-master station operation method of a power collection terminal according to an embodiment of the present invention, in step S102, after the first message is parsed using the first communication protocol to obtain the function of the first message, the method further includes:
[0053] When the function of the first message is to obtain collected data, corresponding data is obtained from a collection database storing data based on the first communication protocol format and the corresponding data is returned to the first main station through a channel process.
[0054] Specifically, the functions of the first message include parameter setting, obtaining collected data and method execution, etc. When the function of the first message is to obtain collected data, the corresponding data is obtained from the collection database and returned to the channel process, and the channel process returns the corresponding data to the first master station.
[0055] Correspondingly, in step S102, after the second message is parsed using the second communication protocol to obtain the function of the second message, the method further includes:
[0056] When the function of the second message is to obtain collected data, corresponding data is obtained from a collection database storing data based on the second communication protocol format and the corresponding data is returned to the second main station through a channel process.
[0057] Similarly, the functions of the second message include parameter setting, obtaining collected data and method execution, etc., wherein the parameter setting includes event judgment parameter setting and collection parameter setting. When the function of the second message is to obtain collected data, the corresponding data is obtained from the collection database and returned to the channel process, and the channel process returns the corresponding data to the second main station.
[0058] In this manner, when the first message or the second message requests data collection, the power collection terminal can obtain and return the required data from the collection database, and supports dual master stations to obtain collection data.
[0059] According to a multi-master station operation method of a power collection terminal according to an embodiment of the present invention, after storing the collected data in a collection database in step S102, the method further includes:
[0060] Monitor and collect whether the data in the database has changed.
[0061] If the data in the acquisition database changes, a data change notification is sent to the second process, and storage data based on the first communication protocol format is obtained from the acquisition database. A first abnormal event detection is performed based on the acquired storage data and the first event judgment parameter, and the detection result is uploaded to the first main station, wherein the first event judgment parameter is obtained by parsing the first message.
[0062] Specifically, the first process is provided with a data collection and storage thread and a data analysis thread. The data collection and storage thread of the first process will determine whether there is a data storage message from the downlink collection thread. If there is a data storage message from the downlink collection thread, the data will be stored in the collection database, and the data in the collection database will be monitored for changes. If changes occur, the data analysis thread of the first process will analyze and judge the collected data, and determine whether the first abnormal event defined by the first communication protocol is generated based on the collected data, and upload the first abnormal event to the first master station. At the same time, the first process also sends a data change notification to the second process. The first abnormal event includes but is not limited to: analysis and judgment events such as the electric energy meter clock out of tolerance, electric energy stopping, and electric energy flying away.
[0063] Through the first abnormal event detection, potential problems can be discovered in time, which improves the safety and predictive maintenance capabilities of the power collection terminal. At the same time, the data change notification is sent to the second process so that the second process can also perform abnormality detection.
[0064] Furthermore, after sending the data change notification to the second process, the method further includes:
[0065] Whether a data change notification is received is monitored by the second process.
[0066] If a data change notification is received, the changed data content is stored in the collection database belonging to the second process based on the second communication protocol, and the storage data based on the second communication protocol format is obtained from the collection database. A second abnormal event detection is performed based on the acquired storage data and the second event judgment parameters and the detection results are uploaded to the second main station, wherein the second event judgment parameters are obtained by parsing the second message.
[0067] The second process is able to respond to data change notifications and perform a second abnormal event detection, which ensures that the power system status can be monitored even when switching between master stations, improving the power collection terminal's ability to handle abnormal situations.
[0068] Specifically, the second process is also provided with a data collection and storage thread and a data analysis thread. The data collection and storage thread of the second process will determine whether a data change notification is received, and after receiving the data change notification, convert the content in the collection database into the second communication protocol format and store it in the internal database of the second communication protocol. When the data in the internal database changes, the data analysis thread of the second process is notified. The data analysis thread of the second process obtains the stored data based on the second communication protocol format and judges the second abnormal event according to the first event judgment parameters. If the second abnormal event occurs, the judgment result is uploaded to the second main station.
[0069] The abnormal events defined for different communication protocols are different, that is, the first abnormal event and the second abnormal event are determined according to the protocol types of the first communication protocol and the second communication protocol, respectively.
[0070] The second process is able to respond to data change notifications and perform a second abnormal event detection, which ensures that the power system status can be monitored even when switching between master stations, improving the power collection terminal's ability to handle abnormal situations.
[0071] According to a multi-master station operation method of a power collection terminal according to an embodiment of the present invention, in step S101, before monitoring based on a channel process whether a first message sent by a first master station or a second message sent by a second master station is received, it also includes:
[0072] The communication connection between the first master station and the power collection terminal, and the communication connection between the second master station and the power collection terminal are maintained through the channel process.
[0073] The channel process is responsible for dial-up Internet access on the remote network, Ethernet cable detection, socket connection of each master station, keep-alive mechanism of the corresponding protocol of each master station, and message distribution of the corresponding master station, etc. At the same time, the channel process also monitors the data communication of various local serial ports, including RS485, Bluetooth, RS232, TTL and other local serial ports, and performs message parsing of 698 / 376 and other communication protocols on the received data, and distributes the messages to the corresponding business processes.
[0074] By maintaining the communication connection with the two master stations, the power collection terminal ensures stable communication with the first and second master stations, helping to maintain real-time transmission of data and continuous operation of the system, especially when the network environment is unstable or the master station is undergoing maintenance.
[0075] In one embodiment, the communication connection between the first master station and the power collection terminal and the communication connection between the second master station and the power collection terminal both include an Ethernet connection, a remote connection, and a local connection. Correspondingly, maintaining the communication connection between the first master station and the power collection terminal and the communication connection between the second master station and the power collection terminal through a channel process includes:
[0076] When both the first master station and the second master station fail to log in successfully, the Ethernet chip is reset periodically, and after detecting that the Ethernet interface is inserted, the IP port of the first master station and the IP port of the second master station are connected by socket, and a login packet of the corresponding communication protocol is sent to the IP port of the first master station and the IP port of the second master station, and the heartbeat of the first master station and the heartbeat of the second master station are maintained after the first master station and the second master station log in through Ethernet.
[0077] When both the first master station and the second master station fail to log in successfully, the remote module is reset periodically, and after detecting that the remote module is inserted, the IP port of the first master station and the IP port of the second master station are connected by socket, and a login packet of the corresponding communication protocol is sent to the IP port of the first master station and the IP port of the second master station, and the heartbeat of the first master station and the heartbeat of the second master station are maintained after the first master station and the second master station log in through the remote network.
[0078] Monitor data on the local communication interface and perform message adaptability checks on messages input through the local communication interface.
[0079] Specifically, the channel process includes an Ethernet thread, a remote module thread, and a local interface thread.
[0080] The Ethernet thread is responsible for the detection of Ethernet interface insertion and removal. After the Ethernet interface is inserted, it uses a socket to connect to the IP port of the first master station or the second master station and sends a login packet of the corresponding protocol. After the Ethernet interface is unplugged or there is no master station login for a long time, the Ethernet chip is reset periodically to prevent the master station from being unable to log in due to Ethernet chip failure. After the first master station or the second master station logs in, it determines whether the first master station and the second master station are online by monitoring the heartbeat of the first master station and the second master station, and receives the messages sent by the first master station and the second master station in real time.
[0081] The remote module thread is responsible for periodically detecting the insertion and removal of remote modules (such as 4G / 2G network standard communication modules of operators such as China Telecom / China Mobile / China Unicom), and performing PPP dial-up Internet access through the remote module. When the remote module cannot establish PPP dial-up or all master stations are not online, the channel process needs to periodically reset the remote module and retry to establish the PPP dial-up function, which can improve the online rate of the terminal. After the remote module dials up to the Internet, the IP port of the first master station or the second master station is connected to the socket and the login packet of the corresponding protocol is sent. After logging in to the first master station or the second master station, the heartbeat of the first master station and the second master station is monitored to determine whether the first master station and the second master station are online, and the messages sent by the first master station and the second master station are received in real time.
[0082] The local interface thread needs to monitor the data of local communication interfaces such as RS485, Bluetooth, RS232, TTL, etc., and perform protocol checks on the message adaptability. The protocol checks of the messages should be carried out in order from complex to simple, first checking the protocols with high rigor and complexity and then checking the protocols with low complexity, so as to prevent misjudgment and send the message to the process of the corresponding communication protocol. The local interface thread also needs to record the type of hardware interface sent to other processes (Ethernet / remote module / RS485, etc.) to prevent the message reply frames of other processes from being sent to the wrong hardware interface.
[0083] In this mode, the channel process supports multiple communication connection modes such as Ethernet, remote and local, providing more connection options and higher flexibility, enabling the power collection terminal to operate stably in different network environments, and improving the adaptability and robustness of the power collection terminal.
[0084] The embodiment of the present invention also provides a multi-master station operation device of a power collection terminal, such as Fig.14 As shown, including:
[0085] The channel process module 301 is used to monitor whether a first message sent by the first master station or a second message sent by the second master station is received based on the channel process, and send the first message and the second message to the first process and the second process respectively when the first message or the second message is received;
[0086] The first process module 302 is used for, if the first process receives the first message, parsing the first message using the first communication protocol to obtain the function of the first message, and when the function of the first message is the collection parameter setting, setting the downlink collection parameters according to the first message, collecting the monitoring data of the power terminal based on the currently set downlink collection parameters and storing the collected data in the collection database;
[0087] The second process module 303 is used to parse the second message using the second communication protocol to obtain the function of the second message if the second process receives the second message. When the function of the second message is to set the acquisition parameters, the parameter information in the second message is extracted and sent to the first process, and the downlink acquisition parameters are set based on the parameter information by the first process.
[0088] The multi-master station operation device of the power collection terminal of the embodiment of the present invention receives a first message sent by the first master station or a second message sent by the second master station through a channel process. When the first message is received, the first process uses the first communication protocol to parse the first message to obtain the function of the first message. When the function of the first message is to set the collection parameters, the downlink collection parameters are set according to the first message, and the monitoring data of the power terminal is collected based on the currently set downlink collection parameters and the collected data is stored in the collection database. If the second message is received, the second process uses the second communication protocol to parse the second message to obtain the function of the second message. When the function of the second message is to set the collection parameters, the downlink collection parameters are set according to the first message. When the power acquisition terminal is connected to the first master station or the second master station, the power acquisition terminal can set the downlink acquisition parameters and collect the monitoring data of the power terminal through the first process, so that the power acquisition terminal can support dual-master station and dual-protocol operation. During normal operation, the power acquisition terminal accesses the first master station to run the acquisition parameters. When the power acquisition terminal is maintained and upgraded, it can access the second master station to run the acquisition parameters. The manufacturer maintains the first master station to ensure the continuity of data acquisition, reduce the difficulty of on-site maintenance, and facilitate the maintenance and upgrade of the master station.
[0089] Furthermore, the first process module 302 also includes:
[0090] A first data acquisition module, used for acquiring corresponding data from an acquisition database storing data based on a first communication protocol format and returning the corresponding data to the first master station through a channel process when the function of the first message is to acquire acquisition data;
[0091] Correspondingly, the second process module 303 also includes:
[0092] The second data acquisition module is used to obtain corresponding data from an acquisition database storing data based on a second communication protocol format and return the corresponding data to the second main station through a channel process when the function of the second message is to obtain acquisition data.
[0093] Furthermore, the first process module 302 also includes:
[0094] Data change monitoring module, used to monitor whether the data in the collection database has changed;
[0095] The first abnormality detection module is used to send a data change notification to the second process if the data in the acquisition database changes, and obtain storage data based on the first communication protocol format from the acquisition database, perform a first abnormal event detection based on the acquired storage data and a first event judgment parameter, and upload the detection result to the first main station, wherein the first event judgment parameter is obtained by parsing the first message.
[0096] Furthermore, the first process module 302 also includes:
[0097] A change notification receiving module, used to monitor whether a data change notification is received through a second process;
[0098] The second abnormality detection module is used to store the changed data content in the collection database belonging to the second process based on the second communication protocol if a data change notification is received, and obtain the storage data based on the second communication protocol format from the collection database, perform a second abnormal event detection based on the acquired storage data and the second event judgment parameter and upload the detection result to the second main station, wherein the second event judgment parameter is obtained by parsing the second message.
[0099] Furthermore, the channel process module 301 also includes:
[0100] The communication maintenance module is used to maintain the communication connection between the first master station and the power collection terminal, and the communication connection between the second master station and the power collection terminal through the channel process.
[0101] Further, the communication connection between the first master station and the power collection terminal and the communication connection between the second master station and the power collection terminal both include an Ethernet connection, a remote connection and a local connection; correspondingly, the communication maintenance module includes:
[0102] The Ethernet maintenance module is used to reset the Ethernet chip periodically when the first master station and the second master station fail to log in successfully, and connect the IP port of the first master station and the IP port of the second master station by means of a socket after detecting that the Ethernet interface is inserted, send a login packet of the corresponding communication protocol to the IP port of the first master station and the IP port of the second master station, and maintain the heartbeat of the first master station and the heartbeat of the second master station after the first master station and the second master station log in through Ethernet;
[0103] A remote maintenance module, used for periodically resetting the remote module when both the first master station and the second master station fail to log in successfully, and connecting the IP port of the first master station and the IP port of the second master station by means of a socket after detecting that the remote module is inserted, sending a login packet of a corresponding communication protocol to the IP port of the first master station and the IP port of the second master station, and maintaining the heartbeat of the first master station and the heartbeat of the second master station after the first master station and the second master station log in through a remote network;
[0104] The local maintenance module is used to monitor the data of the local communication interface and perform message adaptability check on the messages input through the local communication interface.
[0105] The embodiment of the present invention also provides a schematic diagram of the structure of a power collection terminal, such as Fig.15 As shown, the power collection terminal includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the power collection terminal, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple power collection terminals can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.15 A processor 10 is taken as an example.
[0106] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0107] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0108] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the power acquisition terminal, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the power acquisition terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0109] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0110] The power collection terminal also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 can be connected via a bus or other means. Fig.15 The example of connecting through bus is taken in the following.
[0111] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the power collection terminal, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0112] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0113] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0114] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope of protection.
Claims
1. A multi-master station operation method of a power collection terminal, characterized in that: include: Monitoring whether a first message sent by a first master station or a second message sent by a second master station is received based on a channel process, and sending the first message and the second message to a first process and a second process respectively when the first message or the second message is received; If the first process receives the first message, the first communication protocol is used to parse the first message to obtain the function of the first message, and when the function of the first message is to set the collection parameter, the downlink collection parameter is set according to the first message, and the monitoring data of the power terminal is collected based on the currently set downlink collection parameter and the collected data is stored in the collection database; If the second process receives the second message, the second communication protocol is used to parse the second message to obtain the function of the second message. When the function of the second message is to set acquisition parameters, the parameter information in the second message is extracted and the parameter information is sent to the first process, and the downlink acquisition parameters are set based on the parameter information by the first process.
2. The multi-master station operation method of the power collection terminal according to claim 1 is characterized in that: The acquisition database includes an acquisition database storing data based on the first communication protocol format and an acquisition database storing data based on the first communication protocol format, and after the function of parsing the first message using the first communication protocol to obtain the first message, further includes: When the function of the first message is to obtain collected data, the corresponding data is obtained from a collection database storing data in a first communication protocol format and the corresponding data is returned to the first master station through the channel process; Correspondingly, after the second message is parsed using the second communication protocol to obtain the function of the second message, the method further includes: When the function of the second message is to obtain collected data, corresponding data is obtained from a collection database storing data based on a second communication protocol format and the corresponding data is returned to the second main station through the channel process.
3. The multi-master station operation method of the power collection terminal according to claim 1, characterized in that: After the collected data is stored in the collection database, it also includes: Monitoring whether the data in the acquisition database is changed; If the data in the acquisition database changes, a data change notification is sent to the second process, and storage data based on the first communication protocol format is obtained from the acquisition database, and a first abnormal event detection is performed based on the acquired storage data and a first event judgment parameter, and the detection result is uploaded to the first main station, wherein the first event judgment parameter is obtained by parsing the first message.
4. The multi-master station operation method of the power collection terminal according to claim 3 is characterized in that: After sending the data change notification to the second process, the method further includes: monitoring, by the second process, whether the data change notification is received; If the data change notification is received, the changed data content is stored in the collection database belonging to the second process based on the second communication protocol, and the storage data based on the second communication protocol format is obtained from the collection database. A second abnormal event detection is performed based on the acquired storage data and the second event judgment parameter and the detection result is uploaded to the second main station, wherein the second event judgment parameter is obtained by parsing the second message.
5. The multi-master station operation method of the power collection terminal according to claim 1, characterized in that: Before monitoring whether a first message sent by the first master station or a second message sent by the second master station is received based on the channel process, the method further includes: The communication connection between the first master station and the power collection terminal, and the communication connection between the second master station and the power collection terminal are maintained through the channel process.
6. The multi-master station operation method of the power collection terminal according to claim 5, characterized in that: The communication connection between the first master station and the power collection terminal and the communication connection between the second master station and the power collection terminal both include an Ethernet connection, a remote connection and a local connection; Correspondingly, maintaining the communication connection between the first master station and the power collection terminal, and the communication connection between the second master station and the power collection terminal through the channel process includes: When both the first master station and the second master station fail to log in successfully, the Ethernet chip is reset periodically, and after detecting that the Ethernet interface is inserted, the IP port of the first master station and the IP port of the second master station are connected in a socket manner, a login packet of a corresponding communication protocol is sent to the IP port of the first master station and the IP port of the second master station, and the heartbeat of the first master station and the heartbeat of the second master station are maintained after the first master station and the second master station log in through Ethernet; When both the first master station and the second master station fail to log in successfully, the remote module is reset periodically, and after detecting that the remote module is inserted, the IP port of the first master station and the IP port of the second master station are connected by socket, a login packet of the corresponding communication protocol is sent to the IP port of the first master station and the IP port of the second master station, and the heartbeat of the first master station and the heartbeat of the second master station are maintained after the first master station and the second master station log in through the remote network; Monitor data on the local communication interface and perform message adaptability checks on messages input through the local communication interface.
7. A multi-master station operation device for a power collection terminal, characterized in that: include: A channel process module, used for monitoring whether a first message sent by the first master station or a second message sent by the second master station is received based on the channel process, and sending the first message and the second message to the first process and the second process respectively when the first message or the second message is received; a first process module, configured to parse the first message using a first communication protocol to obtain a function of the first message if the first process receives the first message, and when the function of the first message is a collection parameter setting, set a downlink collection parameter according to the first message, collect monitoring data of the power terminal based on the currently set downlink collection parameter, and store the collected data in a collection database; The second process module is used for, if the second process receives the second message, parsing the second message using the second communication protocol to obtain the function of the second message; when the function of the second message is to set acquisition parameters, extracting parameter information in the second message, and sending the parameter information to the first process, so as to set the downlink acquisition parameters based on the parameter information through the first process.
8. A power collection terminal, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the multi-master station operation method of the power collection terminal according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the multi-master station operation method of the power collection terminal according to any one of claims 1 to 6.
10. A computer program product, characterized in that It comprises computer instructions, and the computer instructions are used to make a computer execute the multi-master station operation method of the power collection terminal according to any one of claims 1 to 6.