Container isolation-based edge computing node deployment method and system

CN121704955BActive Publication Date: 2026-08-18WUHAN MOYUNTENG NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511896492.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-08-18
Estimated Expiration
2045-12-16

AI Technical Summary

Technical Problem

然而,电网拓扑瞬变具有毫秒级发生特性,而传统容器重建或热迁移需百毫秒至秒级完成,两者速度严重不匹配

Benefits of technology

[0016]本申请通过预部署影子容器、状态映射与原子切换协议,将电网拓扑变化后的模型切换时间缩短,解决拓扑瞬变与计算模型适配延迟问题,避免保护误判与越级跳闸风险;通过拓扑映射表与状态映射器实现跨容器数据无缝适配,结合接入代理的无感知切换,保障计算任务连续性与结果可靠性;同时,影子容器按需预置与动态资源调整,在保障主容器稳定运行的同时优化边缘节点资源利用率,适配电网多拓扑模式频繁切换场景;本发明针对性解决电网边缘计算实时性、兼容性难题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121704955B_ABST
    Figure CN121704955B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of power grid edge computing, and discloses an edge computing node deployment method and system based on container isolation, which comprises the following steps: deploying a main container matched with a current power grid topology on an edge computing node; pre-deploying at least one shadow container preloaded with a corresponding possible future power grid topology computing model and maintaining a ready state; after receiving a topology change instruction, determining a target shadow container, mapping a real-time running state of the main container into a required input format of the target shadow container based on a topology mapping table; injecting the mapped data into the target shadow container, and realizing that the target shadow container takes over a computing task and the main container stops outputting through an atomic switching protocol. Through the shadow container presetting and fast switching mechanism, the application solves the delay problem of traditional container switching when the power grid topology is transient, ensures that the switching is completed within a protection action window, guarantees the stable operation of the power grid, and has high practicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power grid edge computing technology, specifically to a method and system for deploying edge computing nodes based on container isolation. Background Technology

[0002] With the deepening of smart grid construction, the dynamics and complexity of power grid operation have significantly increased. Scenarios such as load switching, ring network opening and closing, line maintenance, and fault tripping frequently trigger transient changes in the power grid topology. These transients require edge computing nodes to quickly adapt to the new power grid topology and load corresponding real-time calculation models such as power flow calculation, protection verification, and bus differential criteria to ensure the timeliness and accuracy of power grid protection actions.

[0003] Currently, most power grid edge computing nodes adopt traditional container deployment solutions, adapting to service changes through container scaling, instance rebuilding, or image replacement. However, power grid topology transients occur on a millisecond-level scale, while traditional container rebuilding or hot migration takes hundreds of milliseconds to seconds, resulting in a severe speed mismatch. When the topology changes, the computing models running in the original containers quickly become invalid. If a timely switch to a model adapted to the new topology cannot be achieved, it will lead to protection misjudgments, voltage and power flow calculation errors, and even trigger cascading trips, seriously threatening the stable operation of the power grid.

[0004] Meanwhile, different power grid computing models for different topologies exhibit parameter differences and data conflicts. Traditional container scheduling lacks a dedicated state synchronization and model switching mechanism for real-time power grid computing scenarios, making it difficult to achieve cross-container state cache transfer, device parameter synchronization, and seamless switching of computing tasks. Furthermore, edge nodes have limited computing resources. How to achieve efficient pre-provisioning and rapid activation of backup models while ensuring the stable operation of the main container is also a significant challenge for existing technologies. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for deploying edge computing nodes based on container isolation, so as to solve the problems mentioned in the background art.

[0006] According to one aspect of this application, a method for deploying edge computing nodes based on container isolation is provided, comprising the following steps: A main container is deployed and run in an edge computing node, the main container executing a first power grid computing model that matches the current power grid topology; At least one shadow container is pre-deployed in the edge computing node, and each shadow container is pre-loaded with a second power grid computing model that matches a possible future power grid topology and kept in a ready state; In response to receiving a command about a change in the power grid topology, a target shadow container matching the changed power grid topology is determined. The real-time operating state of the main container is mapped to the input format required by the pre-defined topology mapping table for the second power grid calculation model preloaded in the target shadow container. The topology mapping table defines the correspondence and conversion rules between the state elements of the main container and the state elements of the target shadow container. The mapped state data is injected into the target shadow container, and an atomic switching protocol is executed, so that the target shadow container takes over the computing task and outputs the results, while the main container stops the computing task output.

[0007] Preferably, the pre-deployment of at least one shadow container includes: abstracting possible topology changes of the power grid into multiple topology patterns, constructing and pre-compiling an independent power grid computing model image for each topology pattern, creating and initializing corresponding shadow container instances on edge computing nodes based on the images, and allocating predetermined computing resources to each shadow container instance to maintain its ready state.

[0008] Preferably, the mapping operation specifically includes: capturing a complete state vector snapshot containing a sequence number and a timestamp from the main container, and performing identifier remapping, unit conversion, and boundary condition adjustment on the elements in the state vector based on the topology mapping table to generate state data that conforms to the input format of the second power grid calculation model.

[0009] Preferably, the atomic switching protocol includes the following stages executed sequentially: detection and preparation stage: parsing the instruction of the power grid topology change, confirming the identifier of the target shadow container, and verifying its readiness status; Preparation phase: Complete the capture, mapping and injection of the real-time running status into the target shadow container, and receive the ready confirmation from the target shadow container; Submission and Activation Phase: A submission instruction is broadcast to the main container and the target shadow container. The target shadow container starts calculation based on the injected state data and takes over the pre-agreed output port or communication channel. The main container enters an inactive state after receiving the submission instruction.

[0010] Preferably, during the submission and activation phase, the switching of the external output port is managed based on the access proxy; The calculation results of the main container and all shadow containers are output to the access proxy, which publishes them to the outside world. When a switch occurs, the access proxy will seamlessly switch the connection from the main container to the target shadow container.

[0011] Preferably, in the detection and preparation phase, in response to the target shadow container not being in a ready state, the computing resource quota allocated to the target shadow container is increased, a minimal initialization process is executed, only the core modules necessary to run the second power grid computing model are started, its readiness status is monitored, and the preparation phase continues after it is confirmed to be ready.

[0012] In another aspect, this application also provides a container-isolated edge computing node deployment system, including: A main container deployment module is used to deploy and run a main container in an edge computing node, wherein the main container executes a first power grid computing model that matches the current power grid topology; A shadow container deployment module is used to pre-deploy at least one shadow container in the edge computing node, each shadow container being preloaded with a second power grid computing model that matches a possible future power grid topology and kept in a ready state; The mapping module is used to respond to the received instruction of power grid topology change, determine the target shadow container that matches the changed power grid topology, and map the real-time operating state of the main container to the input format required by the pre-defined topology mapping table of the second power grid calculation model preloaded in the target shadow container. The topology mapping table defines the correspondence and conversion rules between the state elements of the main container and the state elements of the target shadow container. The switching output module is used to inject the mapped state data into the target shadow container and execute the atomic switching protocol, so that the target shadow container takes over the computing task and outputs the results, while the main container stops the computing task output.

[0013] This application also provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the container-isolated edge computing node deployment method described above.

[0014] In another aspect, this application provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor to implement the container-isolated edge computing node deployment method described above.

[0015] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the container-isolated edge computing node deployment method described above.

[0016] This application shortens the model switching time after power grid topology changes by pre-deploying shadow containers, state mapping, and atomic switching protocols, solving the problem of latency in adapting to topology transients and computational models, and avoiding the risks of protection misjudgment and cascading tripping. It achieves seamless data adaptation across containers through topology mapping tables and state mappers, and combined with seamless switching of access agents, ensures the continuity of computational tasks and the reliability of results. Simultaneously, shadow containers are pre-configured on demand and dynamically adjusted for resources, optimizing the resource utilization of edge nodes while ensuring the stable operation of the main container, adapting to scenarios with frequent switching of multiple power grid topology modes. This invention specifically addresses the challenges of real-time performance and compatibility in power grid edge computing. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the system framework consisting of edge computing nodes and a scheduling system provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of an edge computing node deployment method based on container isolation provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the shadow container deployment process provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the mapping process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the switching process provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an edge computing node deployment system based on container isolation provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of a device provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

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

[0020] According to an embodiment of the present invention, please refer to Figure 1 , Figure 1This is a schematic diagram of a system framework consisting of edge computing nodes and a scheduling system provided in an embodiment of the present invention. The scheduling system generates instructions for changes in the power grid topology and sends them to the edge computing nodes through a preset communication channel. The edge computing nodes return the computing structure to the scheduling system through deployed, isolated containers. The edge computing nodes carry the deployment and operation of all core modules, connect power grid-side equipment (not shown) to the external scheduling system, and are physical / logical carriers for performing real-time computing tasks. Each edge computing node includes at least a main container, at least one shadow container, a shadow manager, a health detection module, a state mapper, an access agent, and a fast synchronization bus.

[0021] The system comprises the following components: Main Container: Runs a first power grid computing model matching the current power grid topology, collects power grid data in real time, performs calculations, and outputs results; Shadow Container: Preloads a second power grid computing model corresponding to a specific possible topology, maintaining a ready state and quickly taking over computing tasks when the topology changes; Shadow Manager: Acts as the core control hub, coordinating topology change instruction parsing, target shadow container matching, switching process management, and audit log recording; Health Detection Module: Detects the ready status of the main container and shadow container through high-frequency heartbeats, feeds back status information to the shadow manager, and triggers a fast-ready sub-process; Fast Synchronization Bus: Enables low-latency data transmission based on shared memory, supporting efficient interaction of status data and control instructions between modules; State Mapper: Captures the real-time state vector of the main container, performs format conversion and adaptation according to the topology mapping table, and generates the input data required for the shadow container computing model; Access Proxy: Unifies the reception of calculation results from the main container and shadow container and publishes them externally, seamlessly switching backend connections during switching to ensure no awareness for external consumers.

[0022] The following section will elaborate on the deployment method of container-isolated edge computing nodes using the above system as an example. Please refer to [link / reference needed]. Figure 2 As shown, Figure 2 A schematic diagram of an edge computing node deployment method based on container isolation provided by an embodiment of the present invention includes the following steps: S1, Deploy and run a main container in an edge computing node, the main container executing a first power grid computing model that matches the current power grid topology; S2, at least one shadow container is pre-deployed in the edge computing node, each shadow container is pre-loaded with a second power grid computing model that matches a possible future power grid topology, and is kept in a ready state; S3, in response to receiving the instruction of power grid topology change, determine the target shadow container that matches the changed power grid topology, and map the real-time operating state of the main container to the input format required by the pre-defined topology mapping table for the second power grid calculation model preloaded in the target shadow container. The topology mapping table defines the correspondence and conversion rules between the state elements of the main container and the state elements of the target shadow container. S4. Inject the mapped state data into the target shadow container and execute the atomic switching protocol to make the target shadow container take over the computing task and output the results, while the main container stops the computing task output.

[0023] In some embodiments, specifically during the initialization process of the power grid edge computing node, the deployment and startup of the main container are completed first. For example, the edge computing node can create a main container instance based on a preset container deployment configuration file using a container runtime environment such as Docker or containerd. The creation process of this container instance includes basic operations such as resource allocation, image loading, and runtime environment initialization. Specifically, the resource allocation stage allocates a reasonable share of CPU, memory space, network bandwidth, and I / O resources to the container according to the computational requirements of the first power grid computing model corresponding to the current power grid topology, ensuring the stable operation of the first power grid computing model.

[0024] During the image loading process, the main container retrieves the first power grid computing model image that matches the current power grid topology from a pre-configured model repository. This image is pre-compiled and includes necessary computing algorithm modules such as power flow calculation, state estimation, relay protection verification, bus differential criteria, and local fault isolation logic. The container runtime environment decompresses this image and loads it into the designated storage area of ​​the edge computing node. Subsequently, it initializes the operating system kernel, network configuration, and process management environment within the container, giving the main container an independent running isolation space.

[0025] After the main container starts, it immediately loads and runs the first power grid calculation model. This model establishes connections with the dispatching system, SCADA system, and local relay devices through a preset communication interface, collecting real-time power grid operation data, including but not limited to node voltage, line current, switch status, transformer tap position, frequency, and frequency change rate. Based on the collected real-time data, the first power grid calculation model continuously executes calculation tasks and feeds back the calculation results to the dispatching system and related control equipment through a preset output channel, providing decision support for the stable operation of the power grid. It is understood that the main container continuously monitors its own operating status during operation, including resource utilization, calculation task execution progress, and communication link connectivity, to ensure the continuous and reliable operation of the first power grid calculation model.

[0026] According to embodiments of the present invention, shadow containers can be pre-deployed to ensure rapid switching during power grid topology changes. See [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of the shadow container deployment process provided in an embodiment of the present invention.

[0027] Specifically, firstly, in S301, based on historical power grid operation data and engineering practice experience, a comprehensive analysis and summary of possible topology changes in the power grid is conducted, abstracting the complex and diverse topology changes into a finite number of topology patterns. For example, combining the different operating characteristics of the distribution network and the main grid, topology patterns can be divided into main grid normal operation mode, feeder switching mode A, feeder switching mode B, maintenance path 1 mode, maintenance path 2 mode, ring network open-loop to closed-loop mode, and fault trip reconfiguration mode, etc. Each topology pattern corresponds to a clear power grid structure and corresponding operating scenario.

[0028] In S302, for each partitioned topology pattern, an independent power grid computing model image, namely the second power grid computing model image, is built and pre-compiled. Specifically, based on the power grid structure parameters, equipment configuration information, and computing requirements of each topology pattern, corresponding power flow calculation, protection verification, and other algorithm modules are developed. These modules are integrated with necessary runtime dependency libraries and configuration files, and compiled into the second power grid computing model image using container image building tools such as Dockerfile. This image not only contains complete computing logic but also pre-configures the equipment parameter range, boundary condition constraints, and computing accuracy requirements matching the corresponding topology pattern, ensuring that the image can be directly put into operation after loading. It is understandable that designing corresponding computing models based on different power grid topology patterns is conventional knowledge in this field and will not be elaborated further here.

[0029] Subsequently, at S303, a corresponding shadow container instance is created on the edge computing node based on the aforementioned second power grid computing model image. Specifically, a container creation command is issued through the shadow manager. After receiving the command, the container runtime environment allocates predetermined computing resources to each shadow container instance, including but not limited to CPU share, memory soft limit, network interface queue, etc. This resource allocation is based on meeting the minimum operating requirements of the second power grid computing model, while avoiding excessive consumption of edge node resources that could affect the operation of the main container and other critical services. After the shadow container instance is created, an initialization process is executed, including loading the second power grid computing model, initializing the internal data cache space, and establishing communication connections with the fast synchronization bus and state mapper.

[0030] In S304, after initialization, the shadow container enters a ready state and maintains it continuously. For example, the shadow container performs a lightweight warm-up operation, starting the core modules of the computing model but not performing actual business calculations, keeping the model in a standby state. Simultaneously, it periodically sends a ready heartbeat signal to the shadow manager to report its own running status. The resource proxy module monitors the resource usage of each shadow container in real time and dynamically adjusts the resource allocation of the shadow containers based on the overall resource load of the edge nodes, ensuring that the shadow containers always have the ability to quickly respond to switching commands.

[0031] Optionally, the lifecycle of the shadow container can be managed using two strategies: long-term residence or time window rotation. For critical edge nodes with high topology switching frequency, the long-term residence strategy is adopted to ensure that the shadow container is always in a ready state. For nodes with scarce resources or low topology switching frequency, the time window rotation strategy can be adopted to update and rotate the shadow container according to a preset period, thereby optimizing resource utilization efficiency while ensuring switching needs.

[0032] In some embodiments, the number of shadow containers deployed needs to be configured according to actual needs. Preferably, for critical edge nodes undertaking important power supply tasks, at least two shadow containers should be deployed as primary and backup to cope with expected topology switching and the failure of a single shadow container; for ordinary edge nodes, the engineering recommendation is to deploy the number M equal to the number of the most likely topology patterns (…). The smaller of ) and 4, i.e. This satisfies common topology switching needs while avoiding resource waste caused by over-deployment.

[0033] According to an embodiment of the present invention, when the power grid experiences load switching, ring network opening / closing, line maintenance, or fault tripping, the power grid dispatching system generates a power grid topology change instruction and sends it to the shadow manager of the edge computing node through a preset communication channel. Specifically, the instruction includes key information such as the identifier of the changed power grid topology, the topology change timestamp, and the change type, ensuring that the edge node can accurately identify the topology change.

[0034] Upon receiving a topology change command, the shadow manager initiates a command parsing process. It extracts the topology identifier information from the command using a pre-defined parsing algorithm and compares it with pre-stored topology mode identifiers. For example, if the topology identifier in the command is "Feeder Switching A," the shadow manager quickly locates the corresponding Feeder Switching A mode topology and identifies the shadow container in the pre-deployed shadow containers that matches this topology mode as the target shadow container.

[0035] After identifying the target shadow container, the shadow manager verifies its readiness status through the health monitoring module. Specifically, the health monitoring module sends a status query request to the target shadow container. Upon receiving the request, the target shadow container reports its resource usage status, computation model running status, communication link connectivity, and other information. Based on the feedback information, the shadow manager determines whether the target shadow container meets the switching conditions. If the target shadow container's CPU utilization is below a preset threshold, memory usage is within a reasonable range, the computation model is in standby mode, and communication with the fast synchronization bus and state mapper is normal, it is determined to be in a ready state and subsequent switching operations can be performed. If the target shadow container is not in a ready state, a fast ready sub-process is triggered, and the switching process continues only after it reaches a ready state. The fast ready sub-process will be described in detail below and will not be repeated here.

[0036] According to an embodiment of the present invention, the core step of enabling a target shadow container to quickly take over computing tasks is achieved through mapping the real-time running state of the main container. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of the mapping process provided in an embodiment of the present invention.

[0037] Specifically, firstly, in S401, the state mapper receives a state mapping instruction from the shadow manager. This instruction includes information such as the main container identifier, the target shadow container identifier, and the topology mapping table index. Based on the instruction information, the state mapper retrieves real-time runtime state data from the main container through a preset communication interface, forming a complete state vector. Specifically, the expression for the state vector SV is:

[0038]

[0039] in, ts is a global sequence number, generated by a time synchronization source or local event sequencer, used to identify the generation order of the state vector; ts is a high-precision timestamp, using nanosecond or microsecond granularity to ensure the time accuracy of the state data. This represents the voltage data of n nodes. This represents the current data for m lines. This represents the state information of k switches. This represents the tap position information of p transformers, where freq represents the power grid frequency. This represents the rate of change of frequency. Understandably, each element in the state vector includes a version number and unit declaration to ensure data consistency and identifiability.

[0040] Optionally, to avoid contention for reading and writing during the state data capture process, the state mapper adopts a double snapshot technique, that is, it continuously captures state vector snapshots of two adjacent sequence numbers, and by comparing the data consistency of the two snapshots, it ensures that the obtained state vectors are complete and accurate, without data loss or corruption.

[0041] Subsequently, in S402, the state mapper performs a mapping operation based on the topology mapping table associated with the target shadow container. For example, this topology mapping table is statically or semi-statically configured, generated by the model repository during shadow container deployment, and audited and signed by the shadow manager. Checksum verification ensures the consistency and security of the mapping rules. The topology mapping table defines the correspondence and transformation rules between the main container state elements and the target shadow container state elements, including... and Correspondence and The correspondence, the default fill value for missing fields, etc.

[0042] Specifically, the mapping operation includes identifier remapping, unit conversion, and boundary condition adjustment. During identifier remapping, the state mapper replaces the old identifiers of nodes, lines, switches, and other devices in the main container's state vector with the corresponding new identifiers in the target shadow container, based on the correspondence in the topology mapping table. This ensures that the state data is consistent with the device identifiers in the target shadow container's computational model. During unit conversion, considering the differences in data unit requirements under different topology modes, the units of each element in the state vector are converted to units supported by the target shadow container's computational model. For example, voltage data is converted from kV to pu, and current data from A to kA. During boundary condition adjustment, the data in the state vector is range-checked and adjusted according to the operational constraints of the target topology mode. This ensures that the mapped data conforms to the input boundary conditions of the target shadow container's computational model, preventing computational anomalies caused by data exceeding the range.

[0043] During the mapping process, if the state mapper finds that a critical field necessary for the target topology, such as the status information of a key switch, is missing from the state vector, it immediately returns a clear error code and triggers a predefined error handling path. For example, the error handling path may include obtaining the missing field data from an alternative data source, filling it with a default value preset in the topology mapping table, or switching to an alternative shadow container, to ensure the continuity and reliability of the mapping process and avoid interruption of the switching process due to missing fields.

[0044] According to an embodiment of the present invention, after the state mapper completes the mapping of the real-time running state of the main container, it injects the mapped state data into the target shadow container through a fast synchronization bus. Specifically, the fast synchronization bus is a high-priority local inter-process communication channel, preferably implemented based on a shared memory ring buffer to ensure low latency and high reliability of data transmission.

[0045] Specifically, the state mapper encapsulates the mapped state data according to a preset format, adding information such as data checksum, timestamp, and sequence number, and transmits the data to the input buffer of the target shadow container through the transmit interface of the fast synchronization bus. To improve transmission efficiency, a non-blocking write mode can be used, meaning that after the state mapper sends data, it does not need to wait for the target shadow container to receive confirmation and can immediately execute subsequent operations. At the same time, the target shadow container obtains data from the input buffer asynchronously, avoiding delays in the switching process due to data transmission.

[0046] After receiving the mapped state data, the target shadow container first verifies the integrity and accuracy of the data. It confirms that the data has not been lost or tampered with during transmission by comparing the checksum. If the data verification passes, the state data is stored in the local cache space and associated with the corresponding timestamp and sequence number to provide data support for the execution of subsequent computing tasks. If the data verification fails, an error message is sent to the state mapper, and the state mapper resends the data to ensure successful data injection.

[0047] According to an embodiment of the present invention, a lightweight atomic switching protocol enables rapid takeover of computing tasks, which is executed sequentially in the order of detection and pre-preparation phase, preparation phase, and submission and activation phase. See also... Figure 5 , Figure 5 This is a schematic diagram of the switching process provided in an embodiment of the present invention.

[0048] Specifically, in S501, the detection and preparation phase mainly involves parsing the topology change command, confirming the target shadow container identifier, and verifying the ready state. Specifically, after receiving a power grid topology change command, the shadow manager initiates the command parsing process, extracting core information from the command within a preset time, including the identifier of the changed power grid topology, the reason for the change, and the expected completion time. By comparing this information with pre-stored topology pattern information, the identifier of the target shadow container is quickly confirmed.

[0049] Subsequently, the shadow manager verifies the readiness status of the target shadow container through the health monitoring module. The health monitoring module sends heartbeat requests to the target shadow container at a high frequency, such as once every 1ms. Upon receiving the request, the target shadow container provides real-time feedback on its operational status parameters, including CPU utilization, memory usage, computing model standby status, and communication link connectivity. Based on the feedback status parameters, the shadow manager determines whether the target shadow container meets the switching requirements according to preset readiness criteria, such as CPU utilization below 50%, memory usage below a preset threshold, computing model in standby state, and communication link latency below 1ms.

[0050] If the target shadow container meets the readiness criteria, the shadow manager records its status information and enters the preparation phase; if the target shadow container is not in a ready state (e.g., the image is in memory but has not yet been initialized), the fast readiness sub-process is triggered. Specifically, the fast readiness sub-process includes the following steps: First, the resource agent instantly increases the computing resource quota allocated to the target shadow container, doubling its CPU share. The increase factor can be configured according to actual needs, preferably not exceeding 2 times to avoid affecting the operation of other containers. At the same time, it increases its IO weight to ensure that the target shadow container can obtain computing and IO resources first.

[0051] Secondly, the target shadow container executes a minimal initialization process, starting only the core modules necessary for running the second power grid calculation model, including the core calculation algorithm, data input / output module, and communication module, while postponing the startup of secondary services such as log compression and long-series data storage, thus shortening the initialization time.

[0052] Furthermore, the health monitoring module uses a higher frequency heartbeat detection, such as monitoring the readiness of the target shadow container every 1ms. After the target shadow container completes the startup of the core module, it immediately sends a readiness confirmation signal to the shadow manager.

[0053] Finally, if the target shadow container is within the maximum allowed preparation time ( Ideally, the ready state should be reached within 10ms, in which case the shadow manager records its state and enters the preparation phase; if it exceeds 10ms... If it is still not ready, abandon the alternative shadow container, select the next available shadow container, or enter the safe rollback process to ensure that the switching process is not blocked for a long time.

[0054] In S502, the preparation phase. This phase mainly involves capturing, mapping, and injecting the real-time running state of the main container, and receiving the readiness confirmation from the target shadow container. Specifically, the state mapper captures a complete snapshot of the state vector from the main container according to the aforementioned steps, performs mapping operations through the topology mapping table, generates state data that conforms to the input format of the target shadow container's computing model, and injects the mapped data into the input buffer of the target shadow container through the fast synchronization bus.

[0055] After receiving and verifying the state data, the target shadow container initiates its internal preprocessing flow. It integrates the state data with its pre-stored device parameters, boundary conditions, and other information, initializes the input parameters of the computation model, and completes the pre-computation preparations. Once preparation is complete, the target shadow container sends a readiness confirmation signal to the shadow manager, along with a data checksum and timestamp, to prove that it has successfully received and processed the mapped state data.

[0056] After receiving the readiness confirmation signal, the shadow manager verifies the checksum and timestamp in the signal. Once it confirms that the data matches the previously sent status data, it determines that the preparation phase is complete and proceeds to the submission and activation phase. If the readiness confirmation signal is not received within the preset time, the state mapping and data injection process is retried to ensure the successful completion of the preparation phase.

[0057] In S503, the submission and activation phase is crucial for task takeover and output switching. Specifically, the shadow manager first broadcasts a submission command to both the main container and the target shadow container. This command includes key information such as the switching sequence number and activation timestamp, used to synchronize the switching actions between the two. To ensure timely command transmission, the submission command is sent via a fast synchronization bus, and the main container and the target shadow container receive and parse the command in real time.

[0058] Upon receiving the submission command, the target shadow container immediately initiates a computation task based on the injected state data, executing the computational logic of the second power grid computation model in "takeover" mode. Specifically, based on information such as node voltages, line currents, and switch states in the state data, combined with its own pre-configured equipment parameters and boundary conditions, the target shadow container quickly initiates computational processes such as power flow calculation, state estimation, and relay protection verification, ensuring the continuity of the computational task. Simultaneously, the target shadow container performs an output port takeover operation, switching the communication channel through a preset access proxy, enabling its computational results to be published externally through the original main container's output port.

[0059] During the output port takeover process, an access proxy mechanism is employed to achieve seamless switching. Specifically, the computation results of the main container and all shadow containers are output to the access proxy, which then publishes the computation results externally. External consumers, such as scheduling systems and control devices, only establish communication connections with the access proxy and do not interact directly with the main container or shadow containers. When a switch occurs, the access proxy receives the switch instruction from the shadow manager and seamlessly switches its backend connection from the main container to the target shadow container. During the switch, the access proxy caches the last valid computation result of the main container to avoid output interruption due to the switch, ensuring that external consumers are unaware of the switch.

[0060] After receiving the commit command, the main container enters an inactive (passive) or teardown state, ceasing to output computation results to avoid data conflicts caused by simultaneous output from two containers. To handle failover scenarios, the main container maintains a brief rollback window (e.g., 2-5ms). Within this window, the main container maintains its current computation state. If it receives a failover command from the shadow manager, it resumes outputting computation results. If no failover command is received within the rollback window, the computation task is completely stopped, releasing some occupied resources such as CPU and memory, retaining only necessary state information for subsequent auditing or rollback operations.

[0061] The Shadow Manager monitors the state transitions of the main container and the computation startup status of the target shadow container in real time. Once it is confirmed that the target shadow container has successfully started the computation task and completed the backend connection switch after connecting to the agent, the activation signal is marked as successful. Key information during the switch process, such as the switch sequence number, startup timestamp, main container status, and target shadow container status, is written to the audit log for subsequent troubleshooting and process replay.

[0062] Optionally, to ensure the atomicity and observability of the switching process, a dual-snapshot technique is used to capture the state vector of the main container during the preparation phase to ensure contention-free read and write of state data; during the commit and activation phases, a sequence number lock is used to lock the output port within a small range to avoid write races, and the holding time of the sequence number lock is controlled within 1ms to reduce the impact on computing performance; all critical events such as instruction reception, state mapping completion, commit instruction sending, and successful activation are written to the audit log, carrying the corresponding sequence number and timestamp, to ensure that the switching process is traceable and replayable.

[0063] Figure 6 An edge computing node deployment system 600 based on container isolation is illustrated. This system embodiment is similar to... Figure 2 Corresponding to the illustrated method embodiments, this system can be specifically applied to various electronic devices. The system specifically includes: The main container deployment module 601 is used to deploy and run a main container in an edge computing node, wherein the main container executes a first power grid computing model that matches the current power grid topology; The shadow container deployment module 602 is used to pre-deploy at least one shadow container in the edge computing node, each shadow container being preloaded with a second power grid computing model that matches a possible future power grid topology and kept in a ready state; The mapping module 603 is used to respond to the received instruction of power grid topology change, determine the target shadow container that matches the changed power grid topology, and map the real-time operating state of the main container to the input format required by the pre-defined topology mapping table of the second power grid calculation model preloaded in the target shadow container. The topology mapping table defines the correspondence and conversion rules between the state elements of the main container and the state elements of the target shadow container. The switching output module 604 is used to inject the mapped state data into the target shadow container and execute the atomic switching protocol, so that the target shadow container takes over the computing task and outputs the results, while the main container stops the computing task output.

[0064] Based on the same inventive concept, this application also provides an electronic device. The method corresponding to the electronic device can be the method in the foregoing embodiments, and its problem-solving principle is similar to that method. The electronic device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.

[0065] The electronic device can be a user device, or a device formed by integrating user devices and network devices through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and smart bands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.

[0066] Figure 7The diagram illustrates the structure of an apparatus suitable for implementing the methods and / or technical solutions in the embodiments of this application. The apparatus 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0067] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 708 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 709 including a network interface card such as a LAN (local area network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet.

[0068] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 701, it performs the functions defined in the methods of this application.

[0069] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.

[0070] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0071] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0072] Furthermore, the inclusion of a single word does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any particular order.

Claims

1. A method for deploying edge computing nodes based on container isolation, characterized in that, Includes the following steps: A main container is deployed and run in an edge computing node, the main container executing a first power grid computing model that matches the current power grid topology; At least one shadow container is pre-deployed in the edge computing node, and each shadow container is pre-loaded with a second power grid computing model that matches a possible future power grid topology and kept in a ready state; In response to a received instruction regarding a change in power grid topology, a target shadow container matching the changed power grid topology is determined. The real-time operating state of the main container is mapped, based on a predefined topology mapping table, to the input format required by the preloaded second power grid computing model in the target shadow container. The topology mapping table defines the correspondence and conversion rules between the state elements of the main container and the state elements of the target shadow container. Specifically, the mapping operation includes: capturing a complete state vector snapshot containing a sequence number and a timestamp from the main container; and performing identifier remapping, unit conversion, and boundary condition adjustment on the elements in the state vector based on the topology mapping table to generate state data conforming to the input format of the second power grid computing model. The sequence number is a global sequence number used to identify the generation order of the state vector. The mapped state data is injected into the target shadow container, and an atomic switching protocol is executed, so that the target shadow container takes over the computing task and outputs the results, while the main container stops the computing task output.

2. The method for deploying edge computing nodes based on container isolation according to claim 1, characterized in that, The pre-deployment of at least one shadow container includes: The possible topology changes of the power grid are abstracted into multiple topology patterns. An independent power grid computing model image is built and pre-compiled for each topology pattern. Based on the image, a corresponding shadow container instance is created and initialized on the edge computing node, and a predetermined computing resource is allocated to each shadow container instance to maintain its ready state.

3. The method for deploying edge computing nodes based on container isolation according to claim 1, characterized in that, The atomic switching protocol includes the following stages executed sequentially: Detection and preparation phase: Analyze the instructions for the power grid topology change, confirm the identifier of the target shadow container, and verify its readiness status; Preparation phase: Complete the capture, mapping and injection of the real-time running status into the target shadow container, and receive the ready confirmation from the target shadow container; Submission and Activation Phase: A submission instruction is broadcast to the main container and the target shadow container. The target shadow container starts calculation based on the injected state data and takes over the pre-agreed output port or communication channel. The main container enters an inactive state after receiving the submission instruction.

4. The method for deploying edge computing nodes based on container isolation according to claim 3, characterized in that, During the submission and activation phase, the switching of external output ports is managed based on the access proxy; The calculation results of the main container and all shadow containers are output to the access proxy, which publishes them to the outside world. When a switch occurs, the access proxy will seamlessly switch the connection from the main container to the target shadow container.

5. The method for deploying edge computing nodes based on container isolation according to claim 4, characterized in that, During the detection and preparation phase, in response to the target shadow container not being in a ready state, the computing resource quota allocated to the target shadow container is increased, a minimal initialization process is executed, only the core modules necessary to run the second power grid computing model are started, its readiness status is monitored, and the preparation phase continues after it is confirmed to be ready.

6. A container-isolated edge computing node deployment system, characterized in that, include: A main container deployment module is used to deploy and run a main container in an edge computing node, wherein the main container executes a first power grid computing model that matches the current power grid topology; A shadow container deployment module is used to pre-deploy at least one shadow container in the edge computing node, each shadow container being preloaded with a second power grid computing model that matches a possible future power grid topology and kept in a ready state; The mapping module, in response to a received instruction regarding a change in power grid topology, determines a target shadow container that matches the changed power grid topology. It then maps the real-time operating state of the main container to the input format required by the pre-defined topology mapping table for the second power grid computing model preloaded in the target shadow container. The topology mapping table defines the correspondence and conversion rules between the state elements of the main container and the target shadow container. Specifically, the mapping operation includes: capturing a complete state vector snapshot containing a sequence number and a timestamp from the main container; and performing identifier remapping, unit conversion, and boundary condition adjustment on the elements in the state vector based on the topology mapping table to generate state data conforming to the input format of the second power grid computing model. The sequence number is a global sequence number used to identify the generation order of the state vector. The switching output module is used to inject the mapped state data into the target shadow container and execute the atomic switching protocol, so that the target shadow container takes over the computing task and outputs the results, while the main container stops the computing task output.

7. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.

8. A computer-readable medium having computer program instructions stored thereon, characterized in that, The computer program instructions can be executed by a processor to implement the method as described in any one of claims 1-5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • A software upgrading method and device

    CN108984195A

  • Container switching method and node equipment

    CN114760192A