Container creation and management method based on concentrator
By creating independent containers on the concentrator and combining resource monitoring and self-healing management, the problems of resource conflicts and management complexity in the concentrator are solved, application isolation and fault self-recovery are achieved, and the stability and maintainability of the system are improved.
Patent Information
- Application Number
- CN202511576971.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-17
AI Technical Summary
Existing concentrators suffer from resource conflicts, operational environment interference, and complex management and maintenance issues in multi-application environments. Furthermore, existing container management solutions are insufficient to meet the resource constraints and real-time scheduling requirements of embedded devices.
By employing containerization technology, independent containers are created through configuration files. Combined with a fixed-size virtual file system and resource monitoring, application isolation and resource management are achieved, and self-healing management is performed using the MQTT protocol.
It improves the stability and maintainability of the concentrator system, realizes resource isolation and fault self-recovery between applications, and enhances the system's operational reliability and maintainability.
Smart Images

Figure CN121541970A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart grid terminal equipment management technology, and in particular to a container creation and management method based on a concentrator, specifically applied to a multi-tasking application environment running in a concentrator device. Background Technology
[0002] With the continuous advancement of smart grid technology, the deployment scale of power terminal equipment is expanding daily. As a key device in the power information acquisition system, the concentrator undertakes multiple functions, including power consumption information collection, communication protocol conversion, remote data transmission, and terminal equipment control. With the expansion of business needs, the number and types of applications running within the concentrator have increased significantly, leading to problems such as system resource conflicts, mutual interference between operating environments, and complex application upgrades and maintenance.
[0003] Currently, traditional concentrators typically employ a single-process or multi-threaded architecture, with various business modules sharing the same system resource space, lacking effective isolation and protection measures. When a functional module malfunctions, it can easily cause overall system instability or even crashes, affecting the normal operation of the equipment. Furthermore, due to differences in runtime environments, dependency library versions, and resource allocation strategies among different applications, concentrators face significant challenges in unified management and maintenance.
[0004] In recent years, containerization technology has been widely used in cloud computing and edge computing scenarios. Container technology achieves application-level isolation through lightweight virtualization, and features fast startup speed, low resource consumption, and strong cross-platform migration capabilities, making it particularly suitable for resource-constrained embedded terminal devices. However, existing container management solutions are mainly designed for cloud platforms, and when applied to embedded concentrator environments, they often fail to meet the stringent resource constraints, real-time scheduling requirements, and fault self-recovery requirements.
[0005] In view of this, there is an urgent need to propose a container creation and management method suitable for smart grid concentrators, so as to achieve effective isolation, resource quota control and dynamic scheduling between multiple application tasks, thereby improving the overall reliability and maintainability of the system. Summary of the Invention
[0006] The purpose of this invention is to address the above-mentioned problems by proposing a container creation and management method based on a concentrator. This method utilizes containerization technology to achieve efficient deployment, isolation, scheduling, and resource management of applications on the concentrator, thereby improving system stability and maintainability.
[0007] The technical solution of this invention is: This invention provides a method for creating and managing containers based on a concentrator, comprising: The container creation process involves the concentrator creating independent containers for each business application based on a configuration file. The configuration file defines the container's resource limit parameters, port mapping, device access, and directory sharing information. The system allocation process involves the concentrator using fixed-size files and a circular mounting method to create an independent virtual file system for each container to achieve storage space isolation and control. In the resource monitoring step, the concentrator collects the resource usage of containers in real time through the resource monitoring interface and triggers a resource limiting policy when the preset threshold is exceeded. The self-healing process is monitored by having containers periodically send heartbeat signals to the concentrator via the MQTT protocol. If the concentrator fails to receive a specified number of heartbeat signals consecutively, it determines that the container is abnormal and restarts the container to achieve self-healing management.
[0008] Furthermore, in the container creation step, the configuration file is in JSON format and includes; The volumes directory sharing information field is used to specify the directory mapping between the concentrator, which acts as the host machine, and the container. The devices field is used to list the host devices that the container can access; The ports field is used to define the port mapping between the host machine and the container. The CPU binding information field is used to bind the container to a specified CPU core; The RAM size field is used to limit the amount of memory available to the container. The flash storage space size field is used to set the maximum storage space of the container.
[0009] Furthermore, during the container creation process, the concentrator generates a fixed-size virtual disk file, formats it as a standard file system, and then mounts it to the specified directory in a loop.
[0010] Furthermore, the system allocation steps specifically include: Before starting the container, the concentrator creates a corresponding data directory based on the application identifier and generates a virtual disk file in that directory; the virtual disk file is created using a zero-fill command to control storage capacity; The virtual disk file is formatted as an ext4 file system to support reliable read / write and verification. Perform a circular mount operation to map the formatted virtual disk file to a virtual block device, thereby achieving physical storage isolation.
[0011] Furthermore, in the resource monitoring step, The concentrator periodically monitors the container's resource usage, including CPU, RAM, and FLASH, and executes resource limits or alarms when limits are exceeded. Meanwhile, the concentrator provides an API interface for querying and intervening in the CPU, RAM, and FLASH resource usage status of containers.
[0012] Furthermore, the monitoring self-healing step includes: Each business application sends a heartbeat signal carrying container running status information to assist the concentrator in performing health assessments and anomaly reporting; The concentrator receives a heartbeat signal every minute during container operation and resets the loss counter upon receiving it; if the loss counter reaches a threshold, it triggers container restart and event logging.
[0013] Furthermore, during the self-healing monitoring process, if three consecutive heartbeats are lost, the application is deemed abnormal, a restart operation is performed, and the counter is reset.
[0014] Furthermore, in the self-healing monitoring process, the container restart operation includes stopping the container process, cleaning up residual resources, and reloading the configuration file; the event log includes an exception timestamp, container identifier, and resource snapshot.
[0015] A concentrator configured to perform the container creation and management method described above.
[0016] The beneficial effects of this invention are: This invention discloses a container creation and management method based on embedded devices. In resource-constrained embedded environments, the host program automatically obtains resource limit parameters, port mappings, and device access information by parsing structured configuration files, creates isolated containers, and allocates fixed-size virtual file systems. This achieves resource independence between applications and precise storage control. The method integrates CPU binding and memory limit settings to avoid contention, combines port mapping and network namespaces to ensure communication isolation, and uses loops to mount fixed-size files. It solves the problems of resource contention, incomplete isolation, and fault recovery in embedded multi-application deployments, achieving stable and efficient system operation and secure application isolation.
[0017] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0018] The above and other objects, features and advantages of the present invention will become more apparent from the more detailed description of exemplary embodiments of the invention in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the invention.
[0019] Figure 1 A concentrator architecture diagram according to an embodiment of the present invention is shown.
[0020] Figure 2A flowchart illustrating a concentrator-based container creation and management method according to an embodiment of the present invention is shown. Detailed Implementation
[0021] Preferred embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0022] Example 1
[0023] Figure 2 A flowchart illustrating a concentrator-based container creation and management method according to an embodiment of the present invention is shown.
[0024] like Figure 2 As shown, the present invention provides a container creation and management method based on a concentrator, including: S1. Container creation steps: The concentrator creates independent containers for each business application according to the configuration file. The configuration file defines the container's resource limit parameters, port mapping, device access and directory sharing information. Specifically, during container creation, the concentrator generates a fixed-size virtual disk file, formats it as a standard file system, and then mounts it to a specified directory in a loop. The host program creates containers for applications based on a configuration file, which is in JSON format and includes... The volumes directory sharing information field is used to specify the directory mapping between the concentrator, which acts as the host machine, and the container. The devices field is used to list the host devices that the container can access; The ports field is used to define the port mapping between the host machine and the container. The CPU binding information field is used to bind the container to a specified CPU core; The RAM size field is used to limit the amount of memory available to the container. The flash storage space size field is used to set the maximum storage space of the container.
[0025] S2, System Allocation Steps: The concentrator uses fixed-size files and a circular mounting method to create an independent virtual file system for each container to achieve storage space isolation and control; Specifically, before starting the container, the concentrator creates a corresponding data directory based on the application identifier and generates a virtual disk file in that directory; the virtual disk file is created using a zero-fill command to control the storage capacity. For example, the host program generates a fixed-size virtual disk file for each application in the / data directory. This process is achieved by executing the command `dd if= / dev / zero of= / data / app_name_datafile bs=1M count=64`, which creates a 64MB blank file from the zero device ( / dev / zero). By adjusting the `count` parameter, the available FLASH space size for different containers can be flexibly set.
[0026] The virtual disk file is formatted as an ext4 file system to support reliable read, write, and verification; a circular mount operation is performed to map the formatted virtual disk file as a virtual block device to achieve physical storage isolation.
[0027] For example, the generated virtual disk file is formatted as an ext4 file system using the command `mkfs.ext4 / data / app_name_datafile`. This step gives the virtual disk file a standard file system structure, allowing it to be mounted, read, written, and verified normally.
[0028] The host program executes the command `mount -o loop,rw / data / app_name_datafile / data / app_name`, mounting the aforementioned virtual disk file to the container's data directory in loop mode. At this point, the virtual disk file is mapped to a virtual block device (such as ` / dev / loopX`). All write operations performed by the container under the ` / data / app_name` path occur within this virtual disk, thus achieving physical space isolation.
[0029] S3. Resource monitoring step: The concentrator collects the resource usage of the container in real time through the resource monitoring interface and triggers the resource limiting policy when the preset threshold is exceeded. Specifically, in the resource monitoring step, the concentrator periodically monitors the resource usage of the container, including CPU, RAM, and FLASH, and executes resource limits or alarms when limits are exceeded. At the same time, the concentrator provides an API interface for querying and intervening in the CPU, RAM, and FLASH resource occupancy status of the container.
[0030] S4. Monitoring self-healing steps: The container periodically sends heartbeat signals to the concentrator via the MQTT protocol. When the concentrator fails to receive a specified number of heartbeat signals, it determines that the container is abnormal and restarts the container to achieve self-healing management.
[0031] Specifically, the monitoring self-healing step includes: Each business application sends a heartbeat signal carrying container runtime status information to assist the concentrator in performing health assessments and anomaly reporting. If three consecutive heartbeats are lost, the application is deemed abnormal, triggering container restart and event logging. The restart operation is performed while resetting the counter. The container restart operation includes stopping the container process, cleaning up residual resources, and reloading the configuration file. The event log includes an anomaly timestamp, container identifier, and resource snapshot.
[0032] In this embodiment, containerization technology is used to achieve efficient deployment and isolated operation of multiple service modules on the concentrator. Combined with API-level resource monitoring, MQTT-based heartbeat detection mechanism, and configuration file-based automated creation method, unified management, security monitoring, and self-healing management of various applications within the concentrator are achieved, thereby improving the system's reliability, flexibility, and maintainability.
[0033] Example 2
[0034] Figure 1 A concentrator architecture diagram according to an embodiment of the present invention is shown.
[0035] like Figure 1 The present invention provides a concentrator configured to execute the container creation and management method.
[0036] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A method for creating and managing containers based on a concentrator, characterized in that, include: The container creation process involves the concentrator creating independent containers for each business application based on a configuration file. The configuration file defines the container's resource limit parameters, port mapping, device access, and directory sharing information. The system allocation process involves the concentrator using fixed-size files and a circular mounting method to create an independent virtual file system for each container to achieve storage space isolation and control. In the resource monitoring step, the concentrator collects the resource usage of containers in real time through the resource monitoring interface and triggers a resource limiting policy when the preset threshold is exceeded. The self-healing process is monitored by having containers periodically send heartbeat signals to the concentrator via the MQTT protocol. If the concentrator fails to receive a specified number of heartbeat signals consecutively, it determines that the container is abnormal and restarts the container to achieve self-healing management.
2. The container creation and management method based on a concentrator as described in claim 1, characterized in that, In the container creation step, the configuration file is in JSON format and includes: The volumes directory sharing information field is used to specify the directory mapping between the concentrator, which acts as the host machine, and the container. The devices field is used to list the host devices that the container can access; The ports field is used to define the port mapping between the host machine and the container. The CPU binding information field is used to bind the container to a specified CPU core; The RAM size field is used to limit the amount of memory available to the container. The flash storage space size field is used to set the maximum storage space of the container.
3. The container creation and management method based on a concentrator as described in claim 1, characterized in that... During container creation, the concentrator generates a fixed-size virtual disk file, formats it as a standard file system, and then mounts it to the specified directory in a loop.
4. The container creation and management method based on a concentrator as described in claim 3, characterized in that, The system allocation steps specifically include: Before starting the container, the concentrator creates a corresponding data directory based on the application identifier and generates a virtual disk file in that directory; the virtual disk file is created using a zero-fill command to control storage capacity; The virtual disk file is formatted as an ext4 file system to support reliable read / write and verification. Perform a circular mount operation to map the formatted virtual disk file to a virtual block device, thereby achieving physical storage isolation.
5. The container creation and management method based on a concentrator as described in claim 1, characterized in that, In the resource monitoring steps described above The concentrator periodically monitors the container's resource usage, including CPU, RAM, and FLASH, and executes resource limits or alarms when limits are exceeded. Meanwhile, the concentrator provides an API interface for querying and intervening in the CPU, RAM, and FLASH resource usage status of containers.
6. The container creation and management method based on a concentrator as described in claim 1, characterized in that, The monitoring self-healing steps include: Each business application sends a heartbeat signal carrying container running status information to assist the concentrator in performing health assessments and anomaly reporting; The concentrator receives a heartbeat signal every minute during container operation and resets the loss counter upon receiving it; if the loss counter reaches a threshold, it triggers container restart and event logging.
7. The container creation and management method based on a concentrator as described in claim 6, characterized in that... During the self-healing monitoring process, if three consecutive heartbeats are lost, the application is deemed abnormal, and a restart operation is performed while resetting the counter.
8. The container creation and management method based on a concentrator as described in claim 6, characterized in that... During the self-healing monitoring process, the container restart operation includes stopping the container process, cleaning up residual resources, and reloading the configuration file; the event log includes the exception timestamp, container identifier, and resource snapshot.
9. A concentrator, characterized in that, The concentrator is configured to perform the container creation and management method as described in any one of claims 1-8.