Power system data processing cluster, detection method, device, equipment and medium
By introducing a heartbeat detection method into the data processing cluster of the power monitoring system, the management end sends a heartbeat packet to the node to detect the working state, solving the data loss problem caused by deadlocks of the node process and improving the real-time and reliability of the system.
Patent Information
- Application Number
- CN202110885405.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-03
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-08-03
AI Technical Summary
The data processing cluster in the existing power monitoring system cannot detect whether the node process has deadlocks, resulting in data loss and unable to effectively perform monitoring and management of the power grid system.
A power monitoring system data processing cluster and heartbeat detection method are designed, and heartbeat detection packets are sent to nodes through the management end to detect the working status of the nodes and avoid data loss. The specific implementation includes establishing a first process and a first heartbeat receiving thread on the management end, receiving the first heartbeat data packet or alarm information through the first heartbeat receiving thread, and determining whether the second process is deadlocked and invalid.
Effectively detect whether the thread of the node is deadlocked, avoiding data loss and improving user experience.
Smart Images

Figure CN113708486B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power monitoring technology, and in particular to a power system data processing cluster, a detection method, a device, a power monitoring device and a computer-readable storage medium. Background Art
[0002] With the continuous development of the power grid system, the parameters of each node in the power grid system are also constantly changing. Therefore, it is necessary to use a power monitoring system to monitor the parameters of each node in the power grid. With the increasing importance and complexity of the power grid system, the centralized power monitoring system cannot meet the requirements in terms of processing power and real-time performance. Therefore, distributed data processing clusters are widely used in power monitoring systems. However, the data processing cluster in the related art cannot detect whether the process of its node is deadlocked. Therefore, when the process of its node is deadlocked, the data processing cluster in the related art will cause a large amount of data loss, making the monitoring and management of the power grid system unable to be effectively executed. Summary of the invention
[0003] Based on this, the present application provides a data processing cluster and heartbeat detection method for an electric power monitoring system, which can detect whether the thread of a node is deadlocked, thereby avoiding data loss and improving the user experience.
[0004] A data processing cluster for a power monitoring system, comprising:
[0005] A remote terminal unit, used for acquiring power information, wherein the power information is used for characterizing an electrical parameter in a power grid;
[0006] A computing and processing cluster, comprising a plurality of nodes, each of which is connected to the remote terminal unit, and the nodes are used to process the power information;
[0007] The management end is connected to the remote terminal unit and each of the nodes respectively, and is used to send a heartbeat packet to each of the nodes to detect the working status of the nodes.
[0008] In one embodiment, a heartbeat detection method is provided, which is applied to a management end of a data processing cluster of a power monitoring system, wherein the data processing cluster of the power monitoring system comprises: a remote terminal unit, a computing and processing cluster, and the management end, wherein the computing and processing cluster comprises a plurality of nodes, each of which is connected to the remote terminal unit; the management end is respectively connected to the remote terminal unit and each of the nodes;
[0009] The heartbeat detection method comprises:
[0010] Establishing a first process, wherein the first process is used to implement a communication function of the management end;
[0011] Establishing a first heartbeat receiving thread under the first process, wherein the first heartbeat receiving thread is used to detect the working status of the node;
[0012] receiving a first heartbeat data packet or alarm information through the first heartbeat receiving thread, wherein the first heartbeat data packet is sent by a second process and is used to characterize a working state of the second process; the second process is established by the node and is used to process power information while sending the first heartbeat data packet to the management end, wherein the power information is obtained by the node from the remote terminal unit and is used to characterize power parameters in a power grid;
[0013] Whenever the first heartbeat data packet is received, timing begins, and when the timing time exceeds a first preset time or an alarm message is received, it is determined that the second process is deadlocked and invalid.
[0014] In one embodiment, the method further comprises:
[0015] Establishing a first heartbeat sending thread under the first process, wherein the first heartbeat sending thread is used to indicate the working status of the management end to the node;
[0016] At intervals of a second preset time, a second heartbeat data packet is sent to the node through the first heartbeat sending thread, where the second heartbeat data packet is used to represent a working status of the first process.
[0017] In one embodiment, sending a second heartbeat data packet to the node through the first heartbeat sending thread at every second preset time interval further includes:
[0018] Obtaining address information of the node according to the first heartbeat data packet, where the address information is used to represent a physical address of the node;
[0019] At intervals of the second preset time, a second heartbeat data packet is sent to the node according to the address information, and the second heartbeat data packet is sent through the first heartbeat sending thread.
[0020] In one embodiment, the method further comprises:
[0021] In the case where the second process fails, a first restart instruction is sent to the node according to the address information, where the first restart instruction is used to restart the second process.
[0022] In one of the embodiments, a heartbeat detection method is also provided, which is applied to a node of a data processing cluster of a power monitoring system, wherein the data processing cluster of the power monitoring system comprises: a remote terminal unit, a computing and processing cluster, and a management end, wherein the computing and processing cluster comprises a plurality of the nodes, each of which is connected to the remote terminal unit; the management end is respectively connected to the remote terminal unit and each of the nodes;
[0023] The heartbeat detection method comprises:
[0024] Establishing a second process, the second process is used to process power information, the power information is obtained by the node from the remote terminal unit, the power information is used to characterize the power parameters in the power grid;
[0025] Establishing a second heartbeat sending thread under the second process, wherein the second heartbeat sending thread is used to indicate the working status of the node to the management end;
[0026] At intervals of a second preset time, a first heartbeat data packet is sent to the management end through the second heartbeat sending thread, where the first heartbeat data packet is used to represent the working status of the node;
[0027] Establishing a third process, wherein the third process is used to monitor whether the second process fails;
[0028] In the event that the second process fails, the data from the remote terminal unit is cached through the third process, and an alarm message is sent to the management terminal through the third process.
[0029] In one embodiment, the method further comprises:
[0030] Establishing a second heartbeat receiving thread under the second process, wherein the second heartbeat receiving thread is used to detect the working status of the management terminal;
[0031] Receiving, through the second heartbeat receiving thread, a second heartbeat data packet sent by the management end, where the second heartbeat data packet is used to represent the working status of the management end;
[0032] Whenever the second heartbeat data packet is received, timing is started, and when the timing time exceeds the first preset time, it is determined that the first process is deadlocked and invalid;
[0033] as well as,
[0034] In the case where the first process deadlock fails, a second restart instruction is sent to the management end, where the second restart instruction is used to restart the management end.
[0035] A heartbeat detection device is applied to the management end of a data processing cluster of a power monitoring system. The data processing cluster of the power monitoring system includes: a remote terminal unit, a computing and processing cluster and the management end. The computing and processing cluster includes a plurality of nodes, each of which is connected to the remote terminal unit; the management end is respectively connected to the remote terminal unit and each of the nodes; the device includes:
[0036] A first process establishing module, used to establish a first process, wherein the first process is used to implement a communication function of the management end;
[0037] A first heartbeat receiving thread establishing module, used for establishing a first heartbeat receiving thread under the first process, wherein the first heartbeat receiving thread is used for detecting the working state of the node;
[0038] A first heartbeat data packet receiving module is used to receive a first heartbeat data packet or an alarm message through the first heartbeat receiving thread, wherein the first heartbeat data packet is sent by a second process and is used to characterize a working state of the second process; the second process is established by the node and is used to process power information while sending the first heartbeat data packet to the management terminal, wherein the power information is obtained by the node from the remote terminal unit and is used to characterize electrical parameters in a power grid;
[0039] The deadlock determination module is used to start timing each time the first heartbeat data packet is received, and determine that the second process is deadlocked and invalid when the timing time exceeds a first preset time or an alarm message is received.
[0040] In one of the embodiments, a power monitoring device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step in the above-mentioned heartbeat detection method embodiment is implemented.
[0041] In one of the embodiments, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned heartbeat detection method embodiment are implemented.
[0042] The above embodiment provides a heartbeat detection method applied to a data processing cluster of a power monitoring system, including: establishing a first process, the first process is used to realize the communication function of the management end; establishing a first heartbeat receiving thread under the first process, the first heartbeat receiving thread is used to detect the working state of the node; receiving a first heartbeat data packet or an alarm message through the first heartbeat receiving thread, the first heartbeat data packet is sent by the second process, and the first heartbeat data packet is used to characterize the working state of the second process; the second process is established by the node, the second process is used to send the first heartbeat data packet to the management end while processing the power information, the power information is obtained by the node from the remote terminal unit, and the power information is used to characterize the electrical parameters in the power grid; the alarm information is sent by the third process, the third process is used to monitor whether the second process fails, and can cache the data from the remote terminal unit when the second process fails. The first process starts timing whenever it obtains the first heartbeat data packet, and determines that the second process is deadlocked and failed when the timing time exceeds the first preset time or the alarm message is received. Since a second heartbeat sending thread is established under the second process of the node to indicate the working status of the node to the management end, and the second process is also responsible for processing the power information obtained by the remote terminal unit, when the thread responsible for processing the power information under the second process is deadlocked, all threads under the second process including the second heartbeat sending thread will be in a deadlock failure state, so that the first process of the management end can determine whether the second process is deadlocked and failed through the first heartbeat data packet. In addition, by setting a third process at the node to detect the status of the second process, data from the remote terminal unit can be cached to prevent data loss when the second process is deadlocked and failed, and an alarm signal can be sent to the management end to let the management end know that the second process is deadlocked and failed. The present application can detect whether the thread of the node is deadlocked, thereby avoiding data loss and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.
[0044] Figure 1 A schematic diagram of the system architecture of a data processing cluster of a power monitoring system provided by an embodiment;
[0045] Figure 2 A flowchart of a heartbeat detection method provided by an embodiment;
[0046] Figure 3 A flowchart of a heartbeat detection method provided by another embodiment;
[0047] Figure 4 A flowchart of a heartbeat detection method provided in yet another embodiment;
[0048] Figure 5 A flowchart of a heartbeat detection method provided in yet another embodiment;
[0049] Figure 6 A flowchart of a heartbeat detection method provided in yet another embodiment;
[0050] Figure 7 A flowchart of a heartbeat detection method provided in yet another embodiment;
[0051] Figure 8 A flowchart of a heartbeat detection method provided in yet another embodiment;
[0052] Fig. 9 is a structural block diagram of a heartbeat detection device in an embodiment;
[0053] Fig.10 is a structural block diagram of a heartbeat detection device in another embodiment;
[0054] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0056] It should be noted that although the logical order is shown in the flowchart and the topological structure is shown in the topological structure diagram, in some cases, the steps shown or described may be performed in a different order than that in the flowchart or the topological structure shown in the topological structure diagram. The terms "first", "second", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0057] The present invention provides a data processing cluster and a heartbeat detection method for an electric power monitoring system. The heartbeat detection method includes establishing a first process, the first process is used to realize the communication function of a management end; establishing a first heartbeat receiving thread under the first process, the first heartbeat receiving thread is used to detect the working state of a node; receiving a first heartbeat data packet or an alarm message through the first heartbeat receiving thread, the first heartbeat data packet is sent by a second process, the first heartbeat data packet is used to characterize the working state of the second process; the second process is established by the node, the second process is used to process electric power information while sending the first heartbeat data packet to the management end, the electric power information is obtained by the node from a remote terminal unit, the electric power information is used to characterize the electric parameters in the power grid; the alarm message is sent by a third process, the third process is used to monitor whether the second process fails, and can cache data from the remote terminal unit when the second process fails. The first process starts timing whenever the first heartbeat data packet is obtained, and determines that the second process is deadlocked and failed when the timing time exceeds the first preset time or the alarm message is received. Since a second heartbeat sending thread is established under the second process of the node to indicate the working status of the node to the management end, and the second process is also responsible for processing the power information obtained by the remote terminal unit, when the thread responsible for processing the power information under the second process is deadlocked, all threads under the second process including the second heartbeat sending thread will be in a deadlock failure state, so that the first process of the management end can determine whether the second process is deadlocked and failed through the first heartbeat data packet. In addition, by setting a third process at the node to detect the status of the second process, data from the remote terminal unit can be cached to prevent data loss when the second process is deadlocked and failed, and an alarm signal can be sent to the management end to inform the management end that the second process is deadlocked and failed. In summary, the embodiments of the present invention can detect whether the thread of the node is deadlocked, thereby avoiding data loss and improving the user experience.
[0058] The embodiments of the present invention are further described below in conjunction with the accompanying drawings.
[0059] like Figure 1 As shown, Figure 1 is a schematic diagram of a system architecture 100 of a power monitoring system data processing cluster provided by an embodiment of the present invention. Figure 1 In the example, the system architecture 100 of the power monitoring system includes a remote terminal unit 110, a computing and processing cluster 120 and a management terminal 130. The remote terminal unit 110 is used to obtain power information, and the power information is used to characterize the electrical parameters in the power grid; the computing and processing cluster 120 includes multiple nodes 121, each of which is connected to the remote terminal unit 110, and the node 121 is used to process power information; the management terminal 120 is respectively connected to the remote terminal unit 110 and each node 121, and is used to send a heartbeat packet to each node 121 to detect the working status of the node 121.
[0060] The system architecture and application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. Those skilled in the art will appreciate that with the evolution of the system architecture and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are equally applicable to similar technical problems.
[0061] It can be understood by those skilled in the art that Figure 1 The structure of the system architecture 100 shown in the figure does not constitute a limitation on the embodiments of the present invention, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0062] Based on the structure of the above system architecture, various embodiments of the heartbeat detection method of the present invention are proposed.
[0063] like Figure 2 As shown, Figure 2 It is a flowchart of a heartbeat detection method provided by an embodiment of the present invention. The heartbeat detection method is applied to the management end in the system architecture in the above embodiment. The heartbeat detection method includes but is not limited to step S100, step S200, step S300 and step S400.
[0064] Step S100, establishing a first process, the first process is used to implement the communication function of the management end.
[0065] In one embodiment, the first process is also used to implement the data processing function of the management end.
[0066] In one embodiment, each node is connected to the management end, and each node obtains power information from a remote terminal unit (RTU, Remoteterminal unit). The power information is used to characterize the electrical parameters in the power grid, and a processing result is generated based on the power information, and finally the processing result is sent to the management end.
[0067] Step S200: establishing a first heartbeat receiving thread under a first process, where the first heartbeat receiving thread is used to detect the working status of the node.
[0068] In one embodiment, the first heartbeat receiving thread is used to obtain a second heartbeat data packet sent by a node to detect a working status of the node.
[0069] Step S300, receiving the first heartbeat data packet or alarm information through the first heartbeat receiving thread, the first heartbeat data packet is sent by the second process, and the first heartbeat data packet is used to characterize the working status of the second process; the second process is established by the node, and the second process is used to send the first heartbeat data packet to the management end while processing the power information, the power information is obtained by the node from the remote terminal unit, and the power information is used to characterize the electrical parameters in the power grid.
[0070] In one embodiment, the first heartbeat data packet is sent by the second heartbeat sending thread under the second process of the node. At the same time, the second process is also used to process power information. Therefore, there is a thread for processing power information under the second process. Therefore, when the management end cannot receive the second heartbeat data packet normally, it means that the second heartbeat sending thread under the second process is deadlocked and failed. Since the thread for processing power information is also established under the second process, the thread for processing power information under the second process is also in a deadlocked and failed state.
[0071] In one embodiment, the first heartbeat data packet carries result information obtained by the node according to the power information. Therefore, when the node sends the first heartbeat data packet to the management end to indicate its own working status, it can also complete the transmission of the result information.
[0072] In one embodiment, the node is provided with a third process to detect the status of the second process, and is capable of caching data from the remote terminal unit to prevent data loss when the second process deadlocks and fails, and is capable of sending an alarm signal to the management end to inform the management end of the deadlock and failure of the second process.
[0073] Step S400, starting timing each time a first heartbeat data packet is received, and determining that the second process is deadlocked and invalid when the timing time exceeds a first preset time or an alarm message is received.
[0074] In one embodiment, when the timing time exceeds the first preset time, it means that the second heartbeat sending thread is deadlocked and invalid, that is, all threads under the second process are deadlocked and invalid.
[0075] In one embodiment, the first preset time is set to 1000 milliseconds.
[0076] In addition, in one embodiment, referring to Figure 3 The heartbeat detection method may also include but is not limited to the following steps:
[0077] Step S500, establishing a first heartbeat sending thread under the first process, the first heartbeat sending thread is used to indicate the working status of the management end to the node;
[0078] Step S600: sending a second heartbeat data packet to the node through the first heartbeat sending thread at every second preset time interval, where the second heartbeat data packet is used to represent the working status of the first process.
[0079] In one embodiment, a first heartbeat sending thread is further provided under the first process, and the first heartbeat sending thread is used to send a second heartbeat data packet to the node, and the node can determine the working status of the first process by obtaining the second heartbeat data packet.
[0080] In one embodiment, the second preset time is set to 200 milliseconds.
[0081] In addition, in one embodiment, referring to Figure 4 In step S600, sending a second heartbeat data packet to the node through the first heartbeat sending thread at every second preset time interval may include but is not limited to the following steps:
[0082] Step S610: obtaining address information of the node according to the first heartbeat data packet, where the address information is used to represent the physical address of the node.
[0083] Step S620: sending a second heartbeat data packet to the node according to the address information at intervals of a second preset time, and the second heartbeat data packet is sent through the first heartbeat sending thread.
[0084] In one embodiment, the first heartbeat data packet carries the address information of the node, so when the node works abnormally, the physical address of the node can be located through the address information to maintain the faulty node.
[0085] Specifically, in one embodiment, the address information may represent the IP address of the node, or may represent the MAC address of the node, which is not specifically limited in this embodiment.
[0086] It should be noted that, in one embodiment, the address information may represent a virtual address assigned to the node by the power monitoring system, or may be a unique hardware address of the node, which is not specifically limited in this embodiment.
[0087] In addition, in one embodiment, referring to Figure 5 The heartbeat detection method may also include but is not limited to the following steps:
[0088] Step S700: When the second process fails, a first restart instruction is sent to the node according to the address information, where the first restart instruction is used to restart the second process.
[0089] In one embodiment, after detecting that a node is deadlocked and failed, the management end can send a first restart instruction according to address information corresponding to the failed node to restart the second process.
[0090] It should be noted that the process in the node for receiving the first restart instruction to restart the node is independent of the second process.
[0091] like Figure 6 As shown, Figure 6 It is a flowchart of a heartbeat detection method provided by another embodiment of the present invention. The heartbeat detection method is applied to the nodes in the system architecture in the above embodiment. The heartbeat detection method includes but is not limited to step S800, step S900, step S1000, step S1100 and step S1200.
[0092] Step S800, establishing a second process, the second process is used to process power information, the power information is obtained by the node from the remote terminal unit, the power information is used to characterize the electrical parameters in the power grid.
[0093] In one embodiment, the second process is also used to implement the data processing function of the node, and a thread for processing the power information acquired by the remote terminal unit is also provided under the second process.
[0094] In one embodiment, each node is connected to the management end, and each node obtains power information from a remote terminal unit, the power information is used to characterize the electrical parameters in the power grid, and generates processing results based on the power information, and finally sends the processing results to the management end.
[0095] Step S900: establishing a second heartbeat sending thread under the second process, and the second heartbeat sending thread is used to indicate the working status of the node to the management end.
[0096] Step S1000: sending a first heartbeat data packet to the management end through a second heartbeat sending thread at intervals of a second preset time, where the first heartbeat data packet is used to represent the working status of the node.
[0097] In one embodiment, the first heartbeat data packet is sent by the second heartbeat sending thread under the second process of the node. At the same time, the second process is also used to process power information. Therefore, there is a thread for processing power information under the second process. Therefore, when the management end cannot receive the second heartbeat data packet normally, it means that the second heartbeat sending thread under the second process is deadlocked and failed. Since the thread for processing power information is also established under the second process, the thread for processing power information under the second process is also in a deadlocked and failed state.
[0098] Step S1100, establishing a third process, the third process is used to monitor whether the second process fails;
[0099] Step S1200: When the second process fails, data from the remote terminal unit is cached through the third process, and an alarm message is sent to the management terminal through the third process.
[0100] In one embodiment, the alarm information is sent by a third process, and the third process is used to monitor whether the second process fails, and can cache data from the remote terminal unit when the second process fails. The first process starts timing each time the first heartbeat data packet is obtained, and determines that the second process is deadlocked and failed when the timing time exceeds the first preset time or the alarm information is received. Since a second heartbeat sending thread for indicating the working status of the node to the management end is established under the second process of the node, and the second process is also responsible for processing the power information obtained by the remote terminal unit, when the thread responsible for processing the power information under the second process is deadlocked, all threads under the second process including the second heartbeat sending thread will be in a deadlocked and failed state, so that the first process of the management end can determine whether the second process is deadlocked and failed through the first heartbeat data packet. In addition, by setting a third process at the node to detect the status of the second process, it is possible to cache data from the remote terminal unit when the second process is deadlocked and failed to prevent data loss, and it is possible to send an alarm signal to the management end to let the management end know that the second process is deadlocked and failed.
[0101] In addition, in one embodiment, referring to Figure 7 The heartbeat detection method may also include but is not limited to the following steps:
[0102] Step S1300: establish a second heartbeat receiving thread in the second process, and the second heartbeat receiving thread is used to detect the working status of the management end.
[0103] Step S1400: receiving a second heartbeat data packet sent by the management end through a second heartbeat receiving thread, where the second heartbeat data packet is used to represent the working status of the management end.
[0104] In one embodiment, a first heartbeat sending thread is also provided under the first process, and the first heartbeat sending thread is used to send a second heartbeat data packet to the node. The node can obtain the second heartbeat data packet through the second heartbeat receiving thread to determine the working status of the first process.
[0105] In one embodiment, since the second heartbeat data packet is sent by the first heartbeat sending thread under the first process of the management end, and other processes for realizing management end communication and data processing are also provided under the first process, the failure of other threads under the first process can be indirectly judged by failing the first heartbeat sending thread.
[0106] Step S1500, starting timing each time a second heartbeat data packet is received, and determining that the first process is deadlocked and invalid when the timing time exceeds a first preset time.
[0107] In one embodiment, the first heartbeat data packet is sent by the second heartbeat sending thread under the second process of the node. At the same time, the second process is also used to process power information. Therefore, there is a thread for processing power information under the second process. Therefore, when the management end cannot receive the second heartbeat data packet normally, it means that the second heartbeat sending thread under the second process is deadlocked and failed. Since the thread for processing power information is also established under the second process, the thread for processing power information under the second process is also in a deadlocked and failed state.
[0108] In addition, in one embodiment, referring to Figure 8 The heartbeat detection method may also include but is not limited to the following steps:
[0109] Step S1600: When the first process deadlock fails, a second restart instruction is sent to the management end, where the second restart instruction is used to restart the management end.
[0110] In one embodiment, after detecting that the management end is deadlocked and failed, the node can send a second restart instruction to the management end to restart the management end.
[0111] It should be noted that the process in the management terminal for receiving the second restart instruction to restart the management terminal is independent of the first process, so that the management terminal cannot be restarted due to the deadlock of the first process.
[0112] It should be understood that the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, but these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0113] In one embodiment, Fig. 9 As shown, a heartbeat detection device 900 is provided, comprising: a first process establishment module 901, a first heartbeat receiving thread establishment module 902, a first heartbeat data packet receiving module 903, and a second process deadlock determination module 904, wherein:
[0114] A first process establishing module 901, used to establish a first process, where the first process is used to implement the communication function of the management terminal;
[0115] A first heartbeat receiving thread establishing module 902, used to establish a first heartbeat receiving thread under the first process, wherein the first heartbeat receiving thread is used to detect the working status of the node;
[0116] A first heartbeat data packet receiving module 903 is configured to receive a first heartbeat data packet or an alarm message through the first heartbeat receiving thread, wherein the first heartbeat data packet is sent by a second process and is used to characterize a working state of the second process; the second process is established by the node and is used to process power information while sending the first heartbeat data packet to the management terminal, wherein the power information is obtained by the node from the remote terminal unit and is used to characterize power parameters in the power grid;
[0117] The second process deadlock determination module 904 is configured to start timing each time the first heartbeat data packet is received, and determine that the second process deadlock is invalid when the timing time exceeds a first preset time or an alarm message is received.
[0118] In one of the embodiments, the system further comprises: a first heartbeat sending thread establishing unit, configured to establish a first heartbeat sending thread under the first process, wherein the first heartbeat sending thread is configured to indicate the working status of the management terminal to the node;
[0119] And, a second heartbeat data packet sending unit is used to send a second heartbeat data packet to the node through the first heartbeat sending thread at every second preset time interval, wherein the second heartbeat data packet is used to represent the working status of the first process.
[0120] In one embodiment, the above-mentioned second heartbeat data packet sending unit is further used to obtain address information of the node according to the first heartbeat data packet, and the address information is used to characterize the physical address of the node; every second preset time interval, a second heartbeat data packet is sent to the node according to the address information, and the second heartbeat data packet is sent through the first heartbeat sending thread.
[0121] In one embodiment, it further includes a second process restarting unit, which is used to send a first restart instruction to the node according to the address information when the second process fails, and the first restart instruction is used to restart the second process.
[0122] In one embodiment, a heartbeat detection device 1000 is also provided, which is applied to a node of a data processing cluster of a power monitoring system. The data processing cluster of the power monitoring system includes: a remote terminal unit, a computing and processing cluster, and a management end. The computing and processing cluster includes a plurality of nodes, each of which is connected to the remote terminal unit; the management end is connected to the remote terminal unit and each of the nodes respectively; the heartbeat detection device 1000 includes: a second process establishment module 1001, a second heartbeat sending thread establishment module 1002, a first heartbeat data packet sending module 1003, a third process establishment module 1004, and an alarm information sending module 1005; wherein,
[0123] A second process establishing module 1001, used to establish a second process, wherein the second process is used to process power information, wherein the power information is obtained by the node from the remote terminal unit, and the power information is used to characterize the power parameters in the power grid;
[0124] A second heartbeat sending thread establishing module 1002, used for establishing a second heartbeat sending thread under the second process, wherein the second heartbeat sending thread is used for indicating the working status of the node to the management terminal;
[0125] A first heartbeat data packet sending module 1003, configured to send a first heartbeat data packet to the management terminal through the second heartbeat sending thread at every second preset time interval, wherein the first heartbeat data packet is used to represent the working status of the node;
[0126] A third process establishing module 1004 is used to establish a third process, and the third process is used to monitor whether the second process fails;
[0127] The alarm information sending module 1005 caches the data from the remote terminal unit through the third process when the second process fails, and sends the alarm information to the management terminal through the third process.
[0128] In one embodiment, it further includes a second heartbeat receiving thread establishing unit, which is used to establish a second heartbeat receiving thread under the second process, and the second heartbeat receiving thread is used to detect the working state of the management terminal;
[0129] A second heartbeat data packet receiving unit, configured to receive a second heartbeat data packet sent by the management terminal through the second heartbeat receiving thread, wherein the second heartbeat data packet is used to represent a working state of the management terminal;
[0130] A first process deadlock determination unit, configured to start timing each time the second heartbeat data packet is received, and determine that the first process deadlock is invalid when the timing time exceeds a first preset time;
[0131] And, a management end restart unit is used to send a second restart instruction to the management end when the first process deadlock fails, and the second restart instruction is used to restart the management end.
[0132] For the specific definition of the heartbeat detection device, please refer to the definition of the heartbeat detection method above, which will not be repeated here. Each module in the above-mentioned heartbeat detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0133] In addition, an embodiment of the present invention also provides a power monitoring device, including: a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the containerized non-stop release method of the power monitoring system based on the image repository applied to the node in the above-mentioned heartbeat detection method embodiment is implemented.
[0134] The processor and the memory may be connected via a bus or other means.
[0135] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory 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 embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor 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.
[0136] The non-transient software program and instructions required to implement the non-stop release method of the power monitoring system container based on the image warehouse in the above embodiment are stored in the memory. When executed by the processor, the heartbeat detection method in the above embodiment is executed. The non-transient software program and instructions required to implement the heartbeat detection method in the above embodiment are stored in the memory. When executed by the processor, the heartbeat detection method in the above embodiment is executed. For example, the above-described Figure 2 The method steps S100 to S400, Figure 3 Method steps S500 to 600, Figure 4 In the method steps S610, S620 and Figure 5 In step S700 of the method, or executing Figure 6 Steps S800 to S1200 of the method, Figure 7 Method steps S1300 to S1500 and Figure 8 Method step S1600 in .
[0137] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by a processor or a controller, for example, by a processor in the above-mentioned device embodiment, so that the above-mentioned processor can execute the heartbeat detection method in the above-mentioned embodiment, for example, execute the above-mentioned Figure 2 The method steps S100 to S400, Figure 3 Steps S500 to 600 of the method, Figure 4 Method steps S610, S620 and Figure 5 In step S700 of the method, or executing Figure 6 Steps S800 to S1200 of the method, Figure 7 Method steps S1300 to S1500 and Figure 8 Method step S1600 in .
[0138] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store power monitoring data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a heartbeat detection method is implemented.
[0139] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0140] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined in this application.
Claims
1. A data processing cluster for a power monitoring system, characterized in that: include: A remote terminal unit, used for acquiring power information, wherein the power information is used for characterizing an electrical parameter in a power grid; A computing and processing cluster, comprising a plurality of nodes, each of which is connected to the remote terminal unit, and the nodes are used to process the power information; A management terminal, connected to the remote terminal unit and each of the nodes, and used to send a heartbeat packet to each of the nodes to detect the working status of the nodes; Establishing a first process, wherein the first process is used to implement a communication function of the management end; Establishing a first heartbeat receiving thread under the first process, wherein the first heartbeat receiving thread is used to detect the working status of the node; Receiving a first heartbeat data packet or alarm information through the first heartbeat receiving thread, where the first heartbeat data packet is sent by the second process, and the first heartbeat data packet is used to represent the working state of the second process; The second process is established by the node, and the second process is used to process power information while sending the first heartbeat data packet to the management end. The power information is obtained by the node from the remote terminal unit, and the power information is used to characterize electrical parameters in the power grid. The timing starts each time the first heartbeat data packet is received, and the second process is determined to be deadlocked and invalid when the timing time exceeds the first preset time or an alarm message is received.
2. A heartbeat detection method, characterized in that: A management end applied to a data processing cluster of a power monitoring system, wherein the data processing cluster of the power monitoring system comprises: a remote terminal unit, a computing and processing cluster and the management end, wherein the computing and processing cluster comprises a plurality of nodes, each of which is connected to the remote terminal unit; the management end is connected to the remote terminal unit and each of the nodes respectively; The heartbeat detection method comprises: Establishing a first process, wherein the first process is used to implement a communication function of the management end; Establishing a first heartbeat receiving thread under the first process, wherein the first heartbeat receiving thread is used to detect the working status of the node; receiving a first heartbeat data packet or alarm information through the first heartbeat receiving thread, wherein the first heartbeat data packet is sent by a second process and is used to characterize a working state of the second process; the second process is established by the node and is used to process power information while sending the first heartbeat data packet to the management end, wherein the power information is obtained by the node from the remote terminal unit and is used to characterize power parameters in a power grid; Whenever the first heartbeat data packet is received, timing begins, and when the timing time exceeds a first preset time or an alarm message is received, it is determined that the second process is deadlocked and invalid.
3. The heartbeat detection method according to claim 2, characterized in that: Also includes: Establishing a first heartbeat sending thread under the first process, wherein the first heartbeat sending thread is used to indicate the working status of the management end to the node; At intervals of a second preset time, a second heartbeat data packet is sent to the node through the first heartbeat sending thread, where the second heartbeat data packet is used to represent a working status of the first process.
4. The heartbeat detection method according to claim 3, characterized in that: The sending of the second heartbeat data packet to the node through the first heartbeat sending thread at every second preset time also includes: Obtaining address information of the node according to the first heartbeat data packet, wherein the address information is used to represent a physical address of the node; At intervals of the second preset time, a second heartbeat data packet is sent to the node according to the address information, and the second heartbeat data packet is sent through the first heartbeat sending thread.
5. The heartbeat detection method according to claim 4, characterized in that: Also includes: In the case where the second process fails, a first restart instruction is sent to the node according to the address information, where the first restart instruction is used to restart the second process.
6. A heartbeat detection method, characterized in that: A node applied to a data processing cluster of an electric power monitoring system, wherein the data processing cluster of the electric power monitoring system comprises: a remote terminal unit, a computing and processing cluster, and a management end, wherein the computing and processing cluster comprises a plurality of the nodes, each of which is connected to the remote terminal unit; and the management end is connected to the remote terminal unit and each of the nodes respectively; The heartbeat detection method comprises: Establishing a second process, the second process is used to process power information, the power information is obtained by the node from the remote terminal unit, the power information is used to characterize the power parameters in the power grid; Establishing a second heartbeat sending thread under the second process, wherein the second heartbeat sending thread is used to indicate the working status of the node to the management end; At intervals of a second preset time, a first heartbeat data packet is sent to the management end through the second heartbeat sending thread, where the first heartbeat data packet is used to represent the working status of the node; Establishing a third process, wherein the third process is used to monitor whether the second process fails; In the event that the second process fails, the data from the remote terminal unit is cached through the third process, and an alarm message is sent to the management terminal through the third process.
7. The heartbeat detection method according to claim 6, characterized in that: Also includes: Establishing a second heartbeat receiving thread under the second process, wherein the second heartbeat receiving thread is used to detect the working status of the management terminal; Receiving, through the second heartbeat receiving thread, a second heartbeat data packet sent by the management end, where the second heartbeat data packet is used to represent the working status of the management end; Whenever the second heartbeat data packet is received, timing is started, and when the timing time exceeds the first preset time, it is determined that the first process is deadlocked and invalid; as well as, In the case where the first process deadlock fails, a second restart instruction is sent to the management end, where the second restart instruction is used to restart the management end.
8. A heartbeat detection device, characterized in that: The management end of the data processing cluster of the power monitoring system is applied, and the data processing cluster of the power monitoring system includes: a remote terminal unit, a computing and processing cluster and the management end, the computing and processing cluster includes a plurality of nodes, each of which is connected to the remote terminal unit; the management end is respectively connected to the remote terminal unit and each of the nodes; the device includes: A first process establishing module, used to establish a first process, wherein the first process is used to implement a communication function of the management end; A first heartbeat receiving thread establishing module, used for establishing a first heartbeat receiving thread under the first process, wherein the first heartbeat receiving thread is used for detecting the working state of the node; A first heartbeat data packet receiving module is used to receive a first heartbeat data packet or an alarm message through the first heartbeat receiving thread, wherein the first heartbeat data packet is sent by a second process and is used to characterize a working state of the second process; the second process is established by the node and is used to process power information while sending the first heartbeat data packet to the management terminal, wherein the power information is obtained by the node from the remote terminal unit and is used to characterize electrical parameters in a power grid; The deadlock determination module is used to start timing each time the first heartbeat data packet is received, and determine that the second process is deadlocked and invalid when the timing time exceeds a first preset time or an alarm message is received.
9. An electric power monitoring device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the heartbeat detection method as described in any one of claims 2 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the heartbeat detection method according to any one of claims 2 to 7 is implemented.
Citation Information
Patent Citations
Intelligent power utilization management platform
CN110751463A