Method and device for switching multiple group service instances of electric power monitoring system

By implementing container switching of data processing services in the power monitoring system, the problem of missed judgments and misjudgments in traditional systems when the power grid fluctuates is solved, the dispatching efficiency and analysis and computing capabilities of the power system are improved, and the openness and transparency of market information are ensured.

CN115714713BActive Publication Date: 2024-10-01SOUTHERN POWER GRID DIGITAL GRID RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211312428.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-25
Publication Date
2024-10-01
Estimated Expiration
2042-10-25

AI Technical Summary

Technical Problem

When faced with frequently fluctuating power grids, traditional real-time monitoring systems have omissions and misjudgments, resulting in inefficient power system dispatching and unable to meet the needs of large-scale power grid analysis and calculation and market information openness and transparency.

Method used

In the power monitoring system, when the data processing service response status is abnormal, the target container and the backup container are determined, the target container is stopped and the backup container is started, making it the primary instance, and the target container is restarted to become the backup instance, thereby realizing the data Handles fast switching of services and resource scheduling.

Benefits of technology

It improves the dispatching efficiency of the power monitoring system, ensures the stability and response speed of data processing services, and enhances the system's analysis and computing capabilities and the transparency of market information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115714713B_ABST
    Figure CN115714713B_ABST
Patent Text Reader

Abstract

The present application relates to a method and device for switching multiple group service instances in an electric power monitoring system. The method includes: when there is an abnormality in the response status of at least one data processing service in the electric power monitoring system, determining the target container where the abnormal instance providing the data processing service is deployed, and when the container type of the target container is a main container, determining the backup container of the target container, stopping the target container, starting the backup container so that the instance deployed in the backup container is the main instance providing the data processing service, and restarting the target container so that the instance deployed in the target container is the backup instance providing the data processing service. The method can timely schedule the instance in the backup container to replace the instance in the target container to run the data processing service when there is an abnormality in the data processing service in the electric power monitoring system, thereby improving the scheduling efficiency of the electric power monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method, device, computer equipment, storage medium and computer program product for switching multiple group service instances of an electric power monitoring system. Background Art

[0002] With the widespread access to renewable energy generation and the gradual popularization of power electronic equipment, the power system is developing in the direction of large-scale, refined and instantaneous operation, which objectively requires that the power system dispatching and operation should be given equal importance to safety and economy. At the same time, it also puts forward new requirements on the power system's access capabilities to different market players, the refinement of dispatching decisions, the analysis and calculation capabilities of large-scale power grids, the standardization of dispatching behaviors, and the openness and transparency of market information.

[0003] The stable operation of the power system requires increasingly higher accuracy and speed in system analysis and calculation. Traditional real-time monitoring systems face frequently fluctuating power grids, and there are omissions and misjudgments in the monitoring of power grid operation events. There are errors and delays in the deployment and monitoring of system resources, which is not conducive to improving the dispatch efficiency of the power monitoring system. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for switching multiple group service instances of an electric power monitoring system, which can improve the dispatching efficiency of the electric power system, in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for switching multiple group service instances of a power monitoring system. The method comprises:

[0006] In the case where there is an abnormality in the response state of at least one data processing service in the power monitoring system, determining a target container in which the abnormal instance providing the data processing service is deployed;

[0007] In the case where the container type of the target container is a primary container, determining a backup container of the target container; the backup container is a container in which an instance for providing the same data processing service as the data processing service is deployed;

[0008] Stop the target container and start the standby container, so that the instance deployed in the standby container is the main instance that provides the data processing service;

[0009] The target container is restarted so that the instance deployed in the target container is a standby instance that provides the data processing service.

[0010] In one embodiment, the method further comprises:

[0011] Sending a heartbeat message to at least one data processing service in the power monitoring system at a preset time interval; the heartbeat message is used to instruct the instance corresponding to the data processing service to return a corresponding heartbeat response message;

[0012] If the heartbeat response message returned by the data processing service is not received within the preset waiting time, it is determined that the response status of the data processing service is abnormal.

[0013] In one of the embodiments, before the step of restarting the target container, the method further includes:

[0014] When the standby container is successfully started, obtaining a container operation status corresponding to the started standby container;

[0015] According to the container running state corresponding to the standby container, the instance information corresponding to the data processing service is updated.

[0016] In one of the embodiments, updating the instance information corresponding to the data processing service according to the container running state corresponding to the standby container includes:

[0017] When the container running state indicates that the instance deployed in the standby container runs successfully, setting the instance state corresponding to the instance deployed in the standby container to the primary instance, and setting the instance state corresponding to the instance deployed in the target container to the standby instance;

[0018] The instance state after setting corresponding to the standby container and the instance state after setting corresponding to the target container are used as new instance information corresponding to the data processing service.

[0019] In one embodiment, the method further comprises:

[0020] Starting all containers in a container set; the container set is a set of containers associated with all data processing services in the power grid monitoring system;

[0021] For any container in the container set, receiving container startup parameters sent by any container; returning container configuration information to any container according to the container startup parameters; the container configuration information is used to determine whether the instance deployed in any container is a main instance or a backup instance that provides corresponding data processing services.

[0022] In one embodiment, the method further comprises:

[0023] In the case that the container node where the target container is located is abnormal, determining a takeover node corresponding to the container node; the takeover node is used to provide the same data processing service as the data processing service provided by the container node;

[0024] Stop the container in the container node;

[0025] The instance state corresponding to the instance deployed by the container in the takeover node is set to a standby instance.

[0026] In a second aspect, the present application also provides a multi-group service instance switching device for a power monitoring system.

[0027] The device comprises:

[0028] A target container determination module, configured to determine, when there is an abnormality in the response state of at least one data processing service in the power monitoring system, a target container in which the abnormal instance providing the data processing service is deployed;

[0029] a standby container determination module, configured to determine a standby container of the target container when the container type of the target container is a primary container; the standby container is a container in which an instance for providing a data processing service identical to the data processing service is deployed;

[0030] A container state control module, used to stop the target container and start the standby container, so that the instance deployed in the standby container is the main instance providing the data processing service;

[0031] The target container restart module is used to restart the target container so that the instance deployed in the target container is a standby instance that provides the data processing service.

[0032] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0034] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0035] The above-mentioned method, device, computer equipment, storage medium and computer program product for switching multiple group service instances of the power monitoring system, when there is an abnormality in the response status of at least one data processing service in the power monitoring system, determine the target container where the abnormal instance providing the data processing service is deployed, thereby determining the abnormal instance and its corresponding abnormal target container, and when the container type of the target container is a main container, determine the backup container corresponding to the target container, thereby determining the backup instance used to replace the instance in the target container and run the data processing service, after determining the target container and the backup container, stop the target container, start the backup container, so that the instance deployed in the backup container is the main instance providing the data processing service, that is, the instance in the backup container is upgraded to the main instance, restart the target container, so that the instance deployed in the target container is the backup instance providing the data processing service, that is, the instance in the target container is set as the backup instance, thereby realizing that when there is an abnormality in the data processing service in the power monitoring system, the instance in the backup container is timely scheduled to replace the instance in the target container to run the data processing service, thereby improving the scheduling efficiency of the power monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 An application environment diagram of a method for switching multiple group service instances of a power monitoring system in an embodiment;

[0037] Figure 2 A schematic diagram of a flow chart of a method for switching multiple group service instances of a power monitoring system in one embodiment;

[0038] Figure 3 A schematic diagram of a process for determining a service response status in an embodiment;

[0039] Figure 4 A schematic diagram of a process for updating instance information in one embodiment;

[0040] Figure 5 A schematic diagram of a process for updating instance information in another embodiment;

[0041] Figure 6 A schematic diagram of a process of starting a container in one embodiment;

[0042] Figure 7 A schematic diagram of a process of determining a takeover node in an embodiment;

[0043] Figure 8 A framework diagram of a method for switching multiple group service instances of a power monitoring system in one embodiment;

[0044] Fig. 9 It is a structural block diagram of a multi-group service instance switching device of a power monitoring system in one embodiment;

[0045] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.

[0047] The method for switching multiple group service instances of a power monitoring system provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The scheduler 104 is in communication connection with the node (Node) of the power monitoring system and the service instance deployed in the container in the node. An application instance that can provide data processing services is deployed in each node. The scheduler 104 can schedule each application instance and its corresponding standby instance. In the case that there is an abnormality in the response status of at least one data processing service in the power monitoring system, the scheduler 104 determines the target container where the abnormal instance providing the data processing service is deployed. In the case that the container type of the target container is the main container, the scheduler 104 determines the standby container of the target container. The server 104 stops the target container and starts the standby container so that the instance deployed in the standby container is the main instance providing the data processing service. The scheduler 104 restarts the target container so that the instance deployed in the target container is the standby instance providing the data processing service. The scheduler 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0048] In some embodiments, Figure 2 As shown, a method for switching multiple group service instances of a power monitoring system is provided, and the method is applied to Figure 1 The scheduler 104 in the example is described as a server, and includes the following steps:

[0049] Step S202: when there is an abnormality in the response status of at least one data processing service in the power monitoring system, determine a target container where the abnormal instance providing the data processing service is deployed.

[0050] Among them, the power monitoring system may refer to a system used to monitor and control the power production and supply process.

[0051] In specific implementation, the power monitoring system may include systems and intelligent devices based on computer and network technology, as well as communication and data networks as basic support, such as: Supervisory Control And Data Acquisition (SCADA).

[0052] The data processing service may refer to a service for operating power monitoring data in a power monitoring system. In a specific implementation, the data processing service may include a power system parameter transmission service.

[0053] The abnormal instance may refer to an application program that runs abnormally among the application programs that provide a certain data processing service.

[0054] The target container may refer to a container where the abnormal instance is deployed.

[0055] For example, servers use application containerization platforms, such as Kubernetes, to implement applications by deploying containers. Each container is isolated from each other, each container has its own file system, and the processes between containers will not affect each other, and computing resources can be distinguished. Compared with virtual machines, containers can be deployed quickly. Since containers are decoupled from underlying facilities and machine file systems, they can be migrated between different clouds and different versions of operating systems. Containers occupy less resources and are quick to deploy. Each application can be packaged into a container image, and each application has a one-to-one relationship with the container.

[0056] As an example, the server uses an application containerization platform to deploy an application instance that provides a data processing service in a container of a power monitoring system. When the server detects that there is an abnormality in the response status of a data processing service in the power monitoring system, the server determines the abnormal application instance that provides the data processing service through a preset heartbeat mechanism in the power monitoring system, and determines the container in which the abnormal application instance is deployed as the target container.

[0057] Step S204: when the container type of the target container is a primary container, determine a backup container of the target container; the backup container is a container where an instance for providing the same data processing service as the data processing service is deployed.

[0058] The container type may refer to the container attribute information configured by the power monitoring system for the target container. In a specific implementation, the container type may include a main container and a backup container.

[0059] The standby container may refer to a standby container that has a corresponding relationship with the target container. In a specific implementation, the corresponding relationship may refer to that the data processing service provided by the instance deployed by the standby container is the same as the data processing service provided by the instance deployed by the target container.

[0060] As an example, when the container type of the target container is a standby container, the server calls an interface of the application containerization platform to stop and restart the target container.

[0061] As an example, based on the node affinity and instance affinity of the application containerization platform, the server specifies a preset node during initialization to create a cluster data processing instance. Combined with the Pod anti-affinity in the application containerization platform, it can be ensured that the primary and standby cluster data processing instances are not on the same node.

[0062] For example, after the server determines the target container and queries the target container attribute information, the server determines that the container type of the target container is a main container, and the server locates the backup container corresponding to the target container in the power monitoring system and obtains the address information of the backup container.

[0063] Step S206: stop the target container and start the standby container, so that the instance deployed in the standby container becomes the main instance that provides the data processing service.

[0064] As an example, when a node of the application containerization platform is abnormal, the server restarts the instance based on the affinity and anti-affinity configured in the yaml configuration file, and uses the multi-group dynamic autonomous elastic scaling framework to switch the instance between active and standby. The multi-group dynamic autonomous elastic scaling framework itself supports the active and standby operation mode. Also based on the affinity and anti-affinity of the application containerization platform, the server dynamically adjusts and switches the cluster data processing instances through the application containerization platform and based on the yaml configuration file.

[0065] As an example, the server responds to a user-triggered master-slave instance switching request, the server stops the target container, and starts the backup container corresponding to the target container. Regardless of whether the target container exits normally or abnormally, the server performs the master-slave switching operation.

[0066] For example, the server calls the interface of the application containerization platform to stop the instance deployed by the target container, and calls the interface of the application containerization platform to start the instance deployed by the backup container, that is, starts the instance deployed by the backup container to replace the instance deployed by the target container, so that the instance deployed in the backup container is the main instance that provides data processing services.

[0067] Step S208, restarting the target container so that the instance deployed in the target container is a standby instance that provides the data processing service.

[0068] For example, the server calls an interface of the application containerization platform to restart the instance deployed by the target container. At this time, the instance deployed by the target container may be in an online state.

[0069] In the above-mentioned method for switching multiple group service instances of the power monitoring system, when there is an abnormality in the response status of at least one data processing service in the power monitoring system, the target container where the abnormal instance providing the data processing service is deployed is determined, thereby determining the abnormal instance and its corresponding abnormal target container. When the container type of the target container is a main container, the backup container corresponding to the target container is determined, thereby determining the backup instance used to replace the instance in the target container and run the data processing service. After determining the target container and the backup container, the target container is stopped and the backup container is started so that the instance deployed in the backup container is the main instance providing the data processing service, that is, the instance in the backup container is upgraded to the main instance, and the target container is restarted so that the instance deployed in the target container is the backup instance providing the data processing service, that is, the instance in the target container is set as the backup instance, thereby realizing that when there is an abnormality in the data processing service in the power monitoring system, the instance in the backup container is timely scheduled to replace the instance in the target container to run the data processing service, thereby improving the scheduling efficiency of the power monitoring system.

[0070] In some embodiments, Figure 3 As shown, the method also includes:

[0071] Step S302: sending a heartbeat message to at least one data processing service in the power monitoring system at a preset time interval; the heartbeat message is used to instruct the instance corresponding to the data processing service to return a corresponding heartbeat response message.

[0072] In a specific implementation, the preset time interval may include but is not limited to 30 seconds, 1 minute, 90 seconds and 2 minutes.

[0073] The heartbeat message may refer to a fixed message used to verify whether the data processing service runs normally.

[0074] For example, at a preset time interval, the server sends a fixed message as a heartbeat message to address information corresponding to at least one data processing service in the power monitoring system, and receives a heartbeat response message returned by each data processing service.

[0075] Step S304: if the heartbeat response message returned by the data processing service is not received within a preset waiting time, it is determined that there is an abnormality in the response status of the data processing service.

[0076] In a specific implementation, the preset waiting time may include but is not limited to 30 seconds, 1 minute, 90 seconds and 2 minutes.

[0077] The heartbeat response message may refer to a response message corresponding to the heartbeat message and used to reflect the normal operation of the data processing service.

[0078] For example, after the server receives the heartbeat response messages returned by each data processing service, it counts each data processing service and its corresponding heartbeat response messages. If the server still does not receive the heartbeat response message returned by a data processing service within the preset waiting time, the server determines that there is an abnormality in the response status of the data processing service.

[0079] The technical solution of this embodiment sends a heartbeat message to the data processing service in the power monitoring system at a preset time interval, and receives a heartbeat response message corresponding to the heartbeat message. It is determined that there is an abnormality in the data processing service corresponding to the heartbeat response message that is not received within a preset waiting time. This can timely determine that there is an abnormal data processing service in the power monitoring system, thereby improving the resource monitoring efficiency of the power monitoring system.

[0080] In some embodiments, Figure 4 As shown, before the step of restarting the target container, the method further includes:

[0081] Step S402: when the standby container is successfully started, obtaining a container operation state corresponding to the started standby container.

[0082] The container running status may refer to the running status of the container and the application instance deployed by the container.

[0083] For example, the server calls the interface of the application containerization platform to start the standby container and runs the instance deployed in the standby container. The server determines whether the container running status corresponding to the started standby container is normal operation based on the response status of the data processing service provided by the instance.

[0084] As an example, when the server uses the containerization platform, the Pod instance of cluster data processing is calculated based on the maximum threshold of cluster data processing. When the user-added data producer received by the server meets the requirements of the current cluster data processing instance and the current cluster data processing instance has not reached the performance ceiling, the user-added data producer is added to the current cluster data processing instance; when the current cluster data processing instance has reached the performance ceiling, the server adds a cluster data processing instance, and the user-added data producer is added to the newly added cluster data processing instance; when the current cluster data processing instance has reached the performance ceiling and there are destroyed data producers in the current cluster data processing instance, the user-added data producer covers the destroyed data producer. When the server uses the newly added node based on the application containerization platform for the cluster processing instance, the server will no longer adjust the already running cluster data processing instance, and only create or adjust the newly added cluster data processing instance calculated according to the scaling algorithm.

[0085] Step S404: updating instance information corresponding to the data processing service according to the container running state corresponding to the standby container.

[0086] The instance information may refer to the instance type corresponding to the instance associated with the data processing service and the address information of the container deployed by the instance.

[0087] For example, when the server detects that the response status of a data processing service provided by an application instance is normal, the server determines that the container operation status corresponding to the backup container where the application instance is deployed is normal, that is, the server determines that the instance type corresponding to the instance deployed by the backup container is upgraded to the main instance, and the server stores the instance type and address information corresponding to the instances deployed by the backup container and the target container as new instance information in the local configuration information set.

[0088] The technical solution of this embodiment can perform an operation check on the started standby container and timely update the instance information corresponding to the data processing service in the power monitoring system by obtaining the container operation status corresponding to the started standby container and updating the instance information corresponding to the data processing service according to the container operation status, thereby improving the monitoring timeliness and scheduling accuracy of the power monitoring system.

[0089] In some embodiments, Figure 5 As shown, updating the instance information corresponding to the data processing service according to the container running state corresponding to the standby container includes:

[0090] Step S502, when the container running status indicates that the instance deployed in the backup container runs successfully, the instance status corresponding to the instance deployed in the backup container is set to the primary instance, and the instance status corresponding to the instance deployed in the target container is set to the backup instance.

[0091] The instance status may refer to status information indicating whether the instance deployed by the container is running successfully.

[0092] For example, when the server obtains the container running status of the standby container and determines that the container running status of the standby container is normal operation, the server determines that the instance deployed by the standby container is running successfully, and the server sets the instance status corresponding to the instance deployed in the standby container to the primary instance, and sets the instance status corresponding to the instance deployed in the target container to the standby instance.

[0093] Step S504: The instance state after setting corresponding to the backup container and the instance state after setting corresponding to the target container are used as new instance information corresponding to the data processing service.

[0094] For example, the server obtains the instance state after setting corresponding to the backup container and the instance state after setting corresponding to the target container, and stores the instance state after setting corresponding to the backup container and the instance state after setting corresponding to the target container as the latest instance information in the local configuration information set.

[0095] The technical solution of this embodiment can timely update the instance information and improve the scheduling accuracy of the power monitoring system by setting the instance status of the target container and the backup container when the instance deployed in the backup container runs successfully, and updating the instance information corresponding to the set instance.

[0096] In some embodiments, Figure 6 As shown, the method also includes:

[0097] Step S602, start all containers in a container set; the container set is a set of containers associated with all data processing services in the power grid monitoring system.

[0098] The container set may refer to a set of containers associated with all data processing services in the power grid monitoring system. In a specific implementation, the container set may include all containers in the power monitoring system.

[0099] For example, within the preset range of designated container nodes, the server calls the interface of the application containerization platform to indiscriminately start the containers associated with the designated data processing services in the power monitoring system, and controls the containers to send container startup parameters corresponding to each container.

[0100] As an example, the scheduling strategy of the server through the application containerization platform can refer to Node affinity scheduling and Pod affinity scheduling. Node affinity scheduling can assist the cluster scheduling of the SCADA scheduling service. Since the SCADA scheduling service is implemented independently of the application containerization platform, the scheduling service does not need to consider Pod affinity scheduling. The SCADA scheduling service combines the soft and hard restrictions of Node affinity scheduling, where the hard restriction means that the instance can only be deployed on certain Node nodes; the soft restriction means that the scheduling of the service emphasizes the priority of satisfying the preset rules, but it is not mandatory. For example: the monitoring service and the FRONT service are used to process monitoring data and processing pre-data respectively. The above monitoring data and pre-data are received and processed into the warehouse through the protocol. If the monitoring service and the FRONT service need to be allocated to three Node nodes, namely Node1, Node2 and Node3, the hard restriction can mean that the monitoring data can only be allocated to Node1 and Node2 for processing according to the preset allocation requirements, and cannot be allocated to Node3 for processing, and the pre-data can only be allocated to Node3 for processing, and cannot be allocated to Node1 and Node2 for processing.

[0101] Step S604: for any container in the container set, receiving a container startup parameter sent by the any container.

[0102] The container startup parameter may refer to parameter information when the container is started.

[0103] For example, the server receives the container startup parameters sent by any container through the receiving module, and generates container configuration information corresponding to each container startup parameter.

[0104] Step S606: Return container configuration information to any of the containers according to the container startup parameters; the container configuration information is used to determine whether the instance deployed in any of the containers is a primary instance or a backup instance that provides corresponding data processing services.

[0105] The container configuration information may refer to information representing an instance type corresponding to an instance in the container.

[0106] As an example, when a data processing service is started, the server reads a local configuration information set, which may include a service unique ID, a Node IP address, and a Node computer name, wherein the service unique ID is manually assigned.

[0107] For example, the server returns the container configuration information corresponding to the container startup parameters to each container, and sets the current instance information of the instance deployed by each container in the power monitoring system through the container configuration information.

[0108] The technical solution of this embodiment starts all containers in the power monitoring system, receives container startup information, and returns container configuration information. It can configure parameters for instances corresponding to containers in the power monitoring system, quickly determine the primary and standby instances, and improve the operating efficiency of the power monitoring system.

[0109] In some embodiments, Figure 7 As shown, the method also includes:

[0110] Step S702: when an abnormality occurs in the container node where the target container is located, determine a takeover node corresponding to the container node; the takeover node is used to provide the same data processing service as that provided by the container node.

[0111] Among them, the container node may refer to a node where a container in which at least one application instance in the power monitoring system is deployed is located. In a specific implementation, the number of containers included in the container node may include but is not limited to 1, 2, and 3.

[0112] Among them, the takeover node may refer to a container node used to take over a container node and provide corresponding data processing services when an abnormality occurs in a container node in the power monitoring system.

[0113] For example, when the server detects that there is an abnormality in the container node where the target container is located, the server locates the takeover node corresponding to the container node in the power monitoring system, so that the takeover node serves as a standby node to replace the container node.

[0114] Step S704: stop the container in the container node.

[0115] For example, when the server detects that there is an abnormality in the container node where the target container is located, the server stops the instance deployed by the container in the container node from providing data processing services, and performs a master-slave switch between the instance deployed by the container in the container node and the instance deployed by the backup container corresponding to the above container.

[0116] Step S706: Set the instance state corresponding to the instance deployed by the container in the takeover node to a standby instance.

[0117] For example, when the server detects that there is an abnormality in the container node where the target container is located, it first stops the container node, and then calls the interface of the application containerization platform to perform the master-slave switching of the relevant instances. Since there is a new master instance providing relevant data processing services after the server performs the master-slave switching, the instance deployed by the container in the takeover node serves as the backup instance corresponding to the above new master instance.

[0118] The technical solution of this embodiment stops the instance deployed by the currently running container in the container node when an abnormality occurs in the container node, determines a takeover node for taking over the container node, and can timely deploy container resources in the power monitoring system, thereby improving the resource scheduling efficiency of the power monitoring system.

[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can 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.

[0120] Based on the same inventive concept, the embodiment of the present application also provides a device for switching multiple group service instances of a power monitoring system for implementing the method for switching multiple group service instances of a power monitoring system involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the device for switching multiple group service instances of a power monitoring system provided below can refer to the limitations of the method for switching multiple group service instances of a power monitoring system above, and will not be repeated here.

[0121] To facilitate the understanding of those skilled in the art, Figure 8 A framework diagram of a method for switching multiple group service instances of a power monitoring system is provided as an example. Figure 8 As shown, the SCADA scheduling communication module sends a heartbeat message to the SCADA processing module, the SCADA processing module processes the heartbeat message and generates a heartbeat response message, the SCADA processing module sends the heartbeat response message to the heartbeat module, the heartbeat module receives the heartbeat response message, and generates a heartbeat response result, the heartbeat module determines whether there is a heartbeat response message according to the heartbeat response result, if it is determined that there is a heartbeat response message, then after a preset time interval, the SCADA scheduling communication module sends the heartbeat message to the SCADA processing module again, if it is determined that there is no heartbeat response message, the active-standby switching module executes the active-standby switching, the active-standby switching module first determines whether to execute the standby upgrade operation or the standby restart operation, if the standby restart operation is executed, the active-standby switching module first determines whether to execute the standby upgrade operation or the standby restart operation, if the standby restart operation is executed, the active-standby switching module first determines whether to execute the standby upgrade operation or the standby restart operation, The standby switching module stops the standby instance and restarts the standby instance. If the standby-to-master operation is performed, the master-standby switching module stops the main container where the original master instance is deployed, and notifies the standby container deployed on the standby instance to be upgraded to the master container. At this time, the original standby instance is upgraded to the new master instance, and the original master instance is the new standby instance. The master-standby switching module starts the new master instance and determines whether the master-standby switching is successful. If the master-standby switching is unsuccessful, the master-standby switching module restarts all containers of the shard where the original master-standby instance is located to restart the new master instance and the new standby instance. If the master-standby switching is successful, the SCADA processing module updates the instance status corresponding to each instance, the SCADA scheduling communication module receives the standby-to-master success message, and the master-standby switching module restarts the new standby instance.

[0122] In one embodiment, Fig. 9 As shown, a multi-group service instance switching device for a power monitoring system is provided, comprising:

[0123] The target container determination module 902 is used to determine a target container where an abnormal instance providing the data processing service is deployed when there is an abnormality in the response status of at least one data processing service in the power monitoring system.

[0124] The backup container determination module 904 is used to determine a backup container of the target container when the container type of the target container is a primary container; the backup container is a container where an instance for providing the same data processing service as the data processing service is deployed.

[0125] The container state control module 906 is used to stop the target container and start the backup container, so that the instance deployed in the backup container becomes the main instance that provides the data processing service.

[0126] The target container restart module 908 is used to restart the target container so that the instance deployed in the target container is a standby instance that provides the data processing service.

[0127] In one of the embodiments, the above-mentioned device also includes a heartbeat response module, which is specifically used to send a heartbeat message to at least one data processing service in the power monitoring system at a preset time interval; the heartbeat message is used to instruct the instance corresponding to the data processing service to return a corresponding heartbeat response message, and if the heartbeat response message returned by the data processing service is not received within a preset waiting time, it is determined that there is an abnormality in the response status of the data processing service.

[0128] In one of the embodiments, the above-mentioned device also includes an information update module, which is specifically used to obtain the container running status corresponding to the started backup container when the backup container is successfully started, and update the instance information corresponding to the data processing service according to the container running status corresponding to the backup container.

[0129] In one of the embodiments, the information update module is further specifically used to set the instance state corresponding to the instance deployed in the backup container as the primary instance when the container running state indicates that the instance deployed in the backup container is running successfully, and to set the instance state corresponding to the instance deployed in the target container as the backup instance, and use the set instance state corresponding to the backup container and the set instance state corresponding to the target container as new instance information corresponding to the data processing service.

[0130] In one of the embodiments, the above-mentioned device also includes a container startup module, which is specifically used to start all containers in a container set; the container set is a set of containers associated with all data processing services in the power grid monitoring system, and for any container in the container set, the container startup parameters sent by the any container are received, and container configuration information is returned to the any container according to the container startup parameters; the container configuration information is used to determine whether the instance deployed in the any container is a main instance or a backup instance that provides the corresponding data processing service.

[0131] In one of the embodiments, the above-mentioned device also includes a node scheduling module, which is specifically used to determine a takeover node corresponding to the container node when there is an abnormality in the container node where the target container is located; the takeover node is used to provide the same data processing service as the data processing service provided by the container node, stop the container in the container node, and set the instance state corresponding to the instance deployed by the container in the takeover node to a standby instance.

[0132] Each module in the above-mentioned power monitoring system multi-group service instance switching 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 of 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 one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for switching multiple group service instances of a power monitoring system is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0134] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0135] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0136] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0137] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0138] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0141] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for switching multiple group service instances in a power monitoring system. It is characterized in that The method comprises: In the case where there is an abnormality in the response state of at least one data processing service in the power monitoring system, determining a target container in which the abnormal instance providing the data processing service is deployed; In the case where the container type of the target container is a primary container, determining a backup container of the target container; the backup container is a container in which an instance for providing the same data processing service as the data processing service is deployed; Stop the target container and start the standby container, so that the instance deployed in the standby container is the main instance that provides the data processing service; In the case where the standby container is successfully started, the container running state corresponding to the started standby container is obtained; according to the container running state corresponding to the standby container, the instance information corresponding to the data processing service is updated; in the case where the container running state indicates that the instance deployed in the standby container is successfully running, the instance state corresponding to the instance deployed in the standby container is set as the main instance, and the instance state corresponding to the instance deployed in the target container is set as the standby instance; the instance state corresponding to the standby container after the setting and the instance state corresponding to the target container after the setting are used as new instance information corresponding to the data processing service; The target container is restarted so that the instance deployed in the target container is a standby instance that provides the data processing service.

2. The method according to claim 1, It is characterized in that The method further comprises: Sending a heartbeat message to at least one data processing service in the power monitoring system at a preset time interval; the heartbeat message is used to instruct the instance corresponding to the data processing service to return a corresponding heartbeat response message; If the heartbeat response message returned by the data processing service is not received within the preset waiting time, it is determined that the response status of the data processing service is abnormal.

3. The method according to claim 1, It is characterized in that The method further comprises: Starting all containers in a container set; the container set is a set of containers associated with all data processing services in the power monitoring system; For any container in the container set, receiving a container startup parameter sent by the any container; According to the container startup parameters, container configuration information is returned to any of the containers; the container configuration information is used to determine whether the instance deployed in any of the containers is a primary instance or a backup instance that provides a corresponding data processing service.

4. The method according to claim 1, It is characterized in that The method further comprises: In the case that the container node where the target container is located is abnormal, determining a takeover node corresponding to the container node; the takeover node is used to provide the same data processing service as the data processing service provided by the container node; Stop the container in the container node; The instance state corresponding to the instance deployed by the container in the takeover node is set to a standby instance.

5. A multi-group service instance switching device for a power monitoring system, It is characterized in that The device comprises: A target container determination module, configured to determine, when there is an abnormality in the response state of at least one data processing service in the power monitoring system, a target container in which the abnormal instance providing the data processing service is deployed; a standby container determination module, configured to determine a standby container of the target container when the container type of the target container is a primary container; the standby container is a container in which an instance for providing a data processing service identical to the data processing service is deployed; A container state control module, used to stop the target container and start the standby container, so that the instance deployed in the standby container is the main instance providing the data processing service; an information updating module, for obtaining, when the standby container is successfully started, a container running state corresponding to the started standby container; updating the instance information corresponding to the data processing service according to the container running state corresponding to the standby container; setting the instance state corresponding to the instance deployed in the standby container as a primary instance, and setting the instance state corresponding to the instance deployed in the target container as a standby instance, when the container running state indicates that the instance deployed in the standby container is successfully running; and using the instance state corresponding to the standby container and the instance state corresponding to the target container after the setting as new instance information corresponding to the data processing service; The target container restart module is used to restart the target container so that the instance deployed in the target container is a standby instance that provides the data processing service.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.