Containerized power application management method and electronic equipment

By dynamically adjusting the container configuration to respond to fluctuations in power demand, the problem of low flexibility in power application management is solved, and resource utilization efficiency and management flexibility are improved.

CN119417146APending Publication Date: 2025-02-11CHINA SOUTHERN POWER GRID COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411503757.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the management process of power applications, the existing technology has problems of low flexibility and cannot effectively respond to fluctuations in power demand.

Method used

By acquiring multiple containers corresponding to the power application, predict the power demand of the microservice for each container in response to the power demand forecast instruction, and adjust the container configuration according to the predicted demand to achieve dynamic management of the power application.

Benefits of technology

It improves the resource utilization efficiency of containerized power applications under fluctuations in power demand, enhances the flexibility of the management process, and can effectively respond to changes in power demand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417146A_ABST
    Figure CN119417146A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a containerized power application management method and electronic equipment. The method comprises the steps that multiple containers corresponding to the power application are obtained, the multiple containers are obtained by packaging corresponding micro-services, and the multiple micro-services are obtained by splitting the power application; for each container, in response to the power demand prediction instruction, predicting a predicted power demand of the micro-service corresponding to the container, and determining a target resource demand of the container according to the predicted power demand; and adjusting the container configuration of the container according to the target resource demand so as to run the micro-service corresponding to the container under the adjusted container configuration, thereby realizing the management of the power application. According to the technical scheme provided by the embodiment of the invention, the resource utilization efficiency of the containerized power application under the power demand fluctuation is effectively improved through a dynamic adjustment mechanism, so that the problem of low flexibility caused by incapability of efficiently coping with the power demand fluctuation due to lack of dynamic adjustment capability in the management process of the power application is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of power technology, and in particular to a containerized power application management method and electronic device. Background Art

[0002] With the rapid development of cloud computing and microservice architecture, containerization technology has become an important means of building and deploying power applications. It is understandable that after building and deploying containerized power applications, the next top priority is the management of the power application.

[0003] In the process of realizing the present invention, the inventors found that the prior art has the following technical problems: currently in the management process of power application, there is a problem of low flexibility, which needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present invention provide a containerized power application management method and an electronic device, which solve the problem of low flexibility in the power application management process.

[0005] According to one aspect of the present invention, a containerized power application management method is provided, which may include:

[0006] Acquire multiple containers corresponding to the power application, wherein the multiple containers can be obtained by packaging corresponding microservices, and the multiple microservices are obtained by splitting the power application;

[0007] For each container, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand of the container according to the predicted power demand;

[0008] The container configuration of the container is adjusted according to the target resource demand, so as to run the microservice corresponding to the container under the adjusted container configuration to realize the management of the power application.

[0009] According to another aspect of the present invention, there is provided an electronic device, which may include:

[0010] at least one processor; and

[0011] a memory communicatively connected to at least one processor; wherein,

[0012] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor implements the containerized power application management method provided by any embodiment of the present invention when executing the computer program.

[0013] The technical solution of the embodiment of the present invention is to obtain multiple containers corresponding to the power application, the multiple containers are obtained by packaging the corresponding microservices, and the multiple microservices are obtained by splitting the power application; for each container, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand of the container according to the predicted power demand; adjust the container configuration according to the target resource demand to run the microservice corresponding to the container under the adjusted container configuration to achieve the management of the power application. The above technical solution effectively improves the resource utilization efficiency of containerized power applications under power demand fluctuations through a dynamic adjustment mechanism, thereby solving the problem of low flexibility caused by the lack of dynamic adjustment capabilities and the inability to efficiently respond to power demand fluctuations in the management of power applications, thereby improving flexibility.

[0014] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 is a flow chart of a containerized power application management method provided according to an embodiment of the present invention;

[0017] Figure 2 is a flow chart of another containerized power application management method provided according to an embodiment of the present invention;

[0018] Figure 3 is a flow chart of another containerized power application management method provided according to an embodiment of the present invention;

[0019] Figure 4 is a flow chart of another containerized power application management method provided according to an embodiment of the present invention;

[0020] Figure 5 It is a flowchart of an example of openEuler containerized power application management based on power demand drive in a flowchart of another containerized power application management method provided according to an embodiment of the present invention;

[0021] Figure 6 is a structural block diagram of a containerized power application management device provided according to an embodiment of the present invention;

[0022] Figure 7 It is a structural schematic diagram of an electronic device that implements the containerized power application management method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.

[0026] Before introducing the embodiments of the present invention, the application scenarios of the embodiments of the present invention are first exemplarily described.

[0027] For example, in the actual operation of power applications, the resource requirements of power applications are often uncertain and dynamically changing, which is particularly evident in application scenarios driven by power demand. Fluctuations in power demand will directly affect the resource allocation and management of data centers, so how to effectively deal with these fluctuations has become a technical challenge that needs to be solved urgently.

[0028] In the traditional resource management model, statically configured resource limits and the number of replicas may not meet the ever-changing load requirements, resulting in resource waste or performance bottlenecks. For example, during peak power demand periods, if microservices cannot be scaled in time to handle the increased load, microservices may become unavailable, affecting the power consumption experience; conversely, when power demand is low, idle resources will cause waste. Therefore, container management methods that lack dynamic adjustment capabilities cannot effectively cope with fluctuations in power demand, and this needs to be solved.

[0029] Figure 1 It is a flow chart of a containerized power application management method provided by an embodiment of the present invention. This embodiment can be applied to the management of containerized power applications, and is particularly applicable to the management of containerized power applications in scenarios where power demand fluctuates. The method can be executed by a containerized power application management device provided by an embodiment of the present invention, which can be implemented by software and / or hardware, and which can be integrated on an electronic device, which can be various user terminals or servers.

[0030] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:

[0031] S110. Acquire multiple containers corresponding to the power application, wherein the multiple containers are obtained by packaging corresponding microservices, and the multiple microservices are obtained by splitting the power application.

[0032] The power application can be understood as the power application to be managed. In combination with the application scenarios that may be involved in the embodiments of the present invention, the operating system running the power application can be the open source Euler operating system (openEuler); of course, it can also be other operating systems, which are not specifically limited here.

[0033] The power application is split into multiple microservices in advance, and each microservice is packaged as a container to realize containerization of the power application, thereby obtaining multiple containers corresponding to the power application.

[0034] S120. For each container among the multiple containers, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand of the container according to the predicted power demand.

[0035] Wherein, based on S120 and S130, each container in the plurality of containers is processed respectively.

[0036] Here, any container among multiple containers is taken as an example. In response to the power demand prediction instruction, the power demand of the microservice corresponding to the container is predicted to obtain the predicted power demand. In practical applications, optionally, pre-processing operations such as data cleaning can be performed on the power demand to ensure the validity of the power demand. Then, based on the predicted power demand, the target resource demand of the container is determined. In combination with the application scenarios that may be involved in the embodiments of the present invention, the target resource demand can be at least one of the target memory demand, the target central processing unit demand and the target number of replicas demand. This is related to the actual setting and is not limited here. In order to simplify the expression, CPU is used to represent the central processing unit (Central Processing Unit) in the following text.

[0037] S130. Adjust the container configuration of the container according to the target resource demand, so as to run the microservice corresponding to the container under the adjusted container configuration to achieve management of power applications.

[0038] The container configuration of the container is adjusted according to the target resource demand so that the adjusted container configuration can meet the target resource demand. Subsequently, the microservice corresponding to the container can be run under the adjusted container configuration to realize the management of the power application.

[0039] The technical solution of the embodiment of the present invention is to obtain multiple containers corresponding to the power application, the multiple containers are obtained by packaging the corresponding microservices, and the multiple microservices are obtained by splitting the power application; for each container, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand of the container according to the predicted power demand; adjust the container configuration according to the target resource demand to run the microservice corresponding to the container under the adjusted container configuration to achieve the management of the power application. The above technical solution effectively improves the resource utilization efficiency of containerized power applications under power demand fluctuations through a dynamic adjustment mechanism, thereby solving the problem of low flexibility caused by the lack of dynamic adjustment capabilities and the inability to efficiently respond to power demand fluctuations in the management of power applications, thereby improving flexibility.

[0040] Figure 2It is a flowchart of another containerized power application management method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the target resource demand includes a target number of replicas demand; determining the target resource demand of the container according to the predicted power demand includes: determining the target memory demand of the container according to the predicted power demand, and obtaining the basic memory demand pre-configured for the container, and determining the number of memory replicas demand of the container according to the basic memory demand and the target memory demand; determining the target CPU demand of the container according to the predicted power demand, and obtaining the basic CPU demand pre-configured for the container, and determining the number of CPU replicas demand of the container according to the basic CPU demand and the target CPU demand; determining the target number of replicas demand of the container according to the memory replica demand and the CPU replica demand. Among them, the explanations of the terms that are the same as or corresponding to the above-mentioned embodiments are not repeated here.

[0041] See also Figure 2 The method of this embodiment may specifically include the following steps:

[0042] S210. Acquire multiple containers corresponding to the power application, wherein the multiple containers are obtained by packaging corresponding microservices, and the multiple microservices are obtained by splitting the power application.

[0043] S220. For each container among the multiple containers, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target memory demand and target CPU demand of the container according to the predicted power demand.

[0044] On this basis, combined with the application scenarios that may be involved in the embodiments of the present invention, the target memory requirement of the container can be determined in the following manner: obtain the memory corresponding to the unit power demand, and determine the target memory requirement of the container based on the predicted power demand and the memory. For example, the product of the predicted power demand and the memory can be used as the target memory requirement, that is, M target =m×P t , where M target represents the target memory requirement, m represents the memory corresponding to the unit power requirement, P t Represents the predicted electricity demand.

[0045] Alternatively, the target CPU requirement of the container may be determined by obtaining the CPU corresponding to the unit power requirement, and determining the target CPU requirement of the container based on the predicted power requirement and the CPU. For example, the product of the predicted power requirement and the CPU may be used as the target CPU requirement, i.e., C target =k×P t , where C targetrepresents the target CPU demand, k represents the CPU corresponding to the unit power demand, P t Represents the predicted electricity demand.

[0046] S230: Obtain a basic memory requirement pre-configured for the container, and determine the memory replica number requirement of the container according to the basic memory requirement and the target memory requirement.

[0047] The basic memory requirement can be understood as the memory required to ensure the normal operation of the microservice corresponding to the container, and the memory replica number requirement can be understood as the number of replicas required for the container calculated based on the memory.

[0048] The memory replica number requirement is determined based on the basic memory requirement and the target memory requirement. In combination with the application scenarios that may be involved in the embodiments of the present invention, the ratio of the basic memory requirement to the target memory requirement may be used as the memory replica number requirement, that is, Among them, R m Indicates the number of memory replicas required, M target represents the target memory requirement, M base Indicates the base memory requirement.

[0049] S240: Obtain a basic CPU requirement preconfigured for the container, and determine the CPU replica number requirement of the container based on the basic CPU requirement and the target CPU requirement.

[0050] The basic CPU requirement can be understood as the CPU required to ensure the normal operation of the microservice corresponding to the container, and the CPU replica number requirement can be understood as the number of replicas required for the container calculated based on the CPU.

[0051] The CPU replica number requirement is determined based on the basic CPU requirement and the target CPU requirement. In combination with the application scenarios that may be involved in the embodiments of the present invention, the ratio of the basic CPU requirement to the target CPU requirement may be used as the CPU replica number requirement, that is, Among them, R c Indicates the number of CPU replicas required, C target Indicates the target CPU requirement, C base Indicates the basic CPU requirement.

[0052] S250: Determine the target number of copies required for the container according to the number of memory copies required and the number of CPU copies required.

[0053] The memory replica number requirement represents the number of replicas calculated based on the memory, and the CPU replica number requirement represents the number of replicas calculated based on the CPU. Based on these two requirements, the target replica number requirement of the final application that can meet both the memory replica number requirement and the CPU replica number requirement can be calculated.

[0054] On this basis, combined with the application scenarios that may be involved in the embodiments of the present invention, optionally, the maximum value of the memory copy number requirement and the CPU copy number requirement can be used as the target copy number requirement, that is, R = max(R c ,R m ), where R represents the target number of replicas required.

[0055] S260. Adjust the container configuration of the container according to the target number of replicas required, so as to run the microservice corresponding to the container under the adjusted container configuration to achieve management of power applications.

[0056] The technical solution of the embodiment of the present invention determines the target memory demand and target CPU demand of the container by predicting the power demand, and combines the basic memory demand and the basic CPU demand to achieve accurate determination of the target copy number demand that can simultaneously meet the memory copy number demand and the CPU copy number demand.

[0057] Figure 3 It is a flowchart of another containerized power application management method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, after predicting the predicted power demand of the microservice corresponding to the container, the above-mentioned containerized power application management method may also include: determining the target resource limit of the container according to the predicted power demand; adjusting the container configuration of the container according to the target resource demand, including: adjusting the container configuration of the container according to the target resource demand and the target resource limit. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0058] See also Figure 3 The method of this embodiment may specifically include the following steps:

[0059] S310. Acquire multiple containers corresponding to the power application, wherein the multiple containers are obtained by packaging corresponding microservices, and the multiple microservices are obtained by splitting the power application.

[0060] S320. For each container among the multiple containers, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand and target resource limit of the container according to the predicted power demand.

[0061] Among them, the target resource limit of the container is determined according to the predicted power demand. In combination with the application scenarios that may be involved in the embodiments of the present invention, the target resource limit may optionally be a target memory limit and / or a target CPU limit, etc. This is related to the actual setting and is not specifically limited here.

[0062] S330. Adjust the container configuration of the container according to the target resource demand and the target resource limit, so as to run the microservice corresponding to the container under the adjusted container configuration to achieve management of power applications.

[0063] Among them, the container configuration of the container is adjusted based on the target resource demand and combined with the target resource limit, thereby improving the accuracy of the container configuration adjustment.

[0064] The technical solution of the embodiment of the present invention determines the target resource limit by predicting the power demand, and further adjusts the container configuration in combination with the target resource demand and the target resource limit. The application of the target resource limit can ensure the reasonable allocation of resources among multiple containers.

[0065] In an optional technical solution, the target resource limit includes a target memory limit, and the target resource limit of the container is determined according to the predicted power demand, including:

[0066] Obtain the basic memory requirement of the container and the memory increase corresponding to the unit power requirement, and determine the target memory limit of the container based on the basic memory requirement, the memory increase, and the predicted power requirement.

[0067] The memory increase can be understood as the memory required to meet the unit power demand. The target memory limit is determined based on the basic memory demand, the memory increase, and the predicted power demand.

[0068] On this basis, combined with the application scenarios that may be involved in the embodiments of the present invention, optionally, the product of the memory increase and the predicted power demand and the sum of the basic memory demand can be used as the target memory limit, that is, M limit =M base +∈×P t , where M limit Indicates the target memory limit, M base represents the basic memory requirement, ∈ represents the memory increase, P t Represents the predicted electricity demand.

[0069] The above technical solution realizes the accurate determination of the target memory limit.

[0070] In another optional technical solution, the target resource limit includes a target CPU limit, and the target resource limit of the container is determined according to the predicted power demand, including:

[0071] Obtain the basic CPU demand of the container and the CPU increase corresponding to the unit power demand, and determine the target CPU limit of the container based on the basic CPU demand, the CPU increase, and the predicted power demand.

[0072] The CPU increase can be understood as the CPU that needs to be increased to meet the unit power demand. The target CPU limit is determined based on the basic CPU demand, the CPU increase, and the predicted power demand.

[0073] On this basis, combined with the application scenarios that may be involved in the embodiments of the present invention, optionally, the product of the CPU increase and the predicted power demand and the sum of the basic CPU demand can be used as the target CPU limit, that is, C limit =C base +δ×P t , where C limit Indicates the target CPU limit, C base represents the basic CPU requirement, δ represents the CPU increase, P t Represents the predicted electricity demand.

[0074] The above technical solution realizes the accurate determination of the target CPU limit.

[0075] Another optional technical solution is to adjust the container configuration of the container according to the target resource requirements and target resource constraints, including:

[0076] Get the actual resource usage of the container, and determine the current actual resource usage of the container based on the target resource limit and the actual resource usage;

[0077] A preset resource usage threshold is obtained, and the container configuration of the container is adjusted according to the target resource demand and the numerical relationship between the actual resource usage and the resource usage threshold.

[0078] The actual resource usage rate can be understood as the actual resource usage rate of the container. The actual resource usage of the container can be determined based on the target resource limit and the actual resource usage rate.

[0079] On this basis, still taking the above example as an example, optionally, the actual resource usage may include actual memory usage, which can be measured by Calculated. Among them, M current Indicates the actual memory usage, M usage Indicates the actual memory usage, M limit Indicates the target memory limit. Optionally, the actual resource usage may include actual CPU usage, which can be obtained by Calculated. Among them, C current Indicates the actual CPU usage, C usage Indicates the actual CPU usage, C limit Indicates the target CPU limit.

[0080] Furthermore, the actual resource usage is numerically compared with the preset resource usage threshold to obtain a numerical relationship between the two, and then the container configuration can be adjusted according to the numerical relationship and the target resource demand.

[0081] For example, here we still take the above example as an example, focusing on adjusting the container configuration according to the numerical relationship:

[0082] If M current >T M , then increase the number of copies or increase resource configuration; if M current <T M If the number of replicas is greater than the minimum number of replicas, reduce the number of replicas or reduce resource configuration, where T M Indicates the memory usage threshold.

[0083] If C current >T C , then increase the number of replicas or increase resource configuration; if C current <T C If the number of replicas is greater than the minimum number of replicas, reduce the number of replicas or reduce resource configuration, where T C Indicates the CPU usage threshold.

[0084] On this basis, combined with the application scenarios that may be involved in the embodiments of the present invention, optionally, the Kubernetes API can be used to dynamically adjust the number of replicas. If the number of replicas needs to be increased, the Kubernetes API can be called to expand the capacity; if the number of replicas needs to be reduced, the corresponding API can be called to reduce the capacity.

[0085] The above technical solution further improves the accuracy of container configuration adjustment by applying actual resource usage, avoiding resource waste or performance bottlenecks.

[0086] Figure 4 It is a flowchart of another containerized power application management method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the above-mentioned containerized power application management method also includes: splitting the power application into multiple microservices; for each microservice in the multiple microservices, creating an image for the microservice, and managing the dependencies of the image to package the microservice into a container. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0087] See also Figure 4 The method of this embodiment may specifically include the following steps:

[0088] S410. Split the power application into multiple microservices.

[0089] Among them, by splitting the power application into multiple microservices, it is ensured that each microservice is independent, so that the overall management of the power application can be achieved through the separate management of multiple microservices.

[0090] S420. For each microservice in the multiple microservices, create an image for the microservice, and manage dependencies of the image to package the microservice into a container.

[0091] Wherein, each of the multiple microservices is processed separately based on S420.

[0092] Here, we take any one of the multiple microservices as an example to create an image for the microservice. Specifically, we can create a Docker image and manage the dependencies of the image, so as to package the microservice into a container and realize flexible deployment and resource management of the microservice.

[0093] In combination with the application scenarios that may be involved in the embodiments of the present invention, optionally, a Dockerfile may be configured for each microservice, and then an image may be created for the corresponding microservice according to the Dockerfile. On this basis, optionally, taking the object microservice as an example, its Dockerfile may include the following contents:

[0094] Specify the base image;

[0095] Set the working directory so that subsequent operations can be performed in this working directory;

[0096] Copy the microservice application's JAR file into the container;

[0097] Expose the ports required for the application to run;

[0098] Defines the command to run when the container starts.

[0099] S430: For each container among the multiple containers, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand of the container according to the predicted power demand.

[0100] S440. Adjust the container configuration of the container according to the target resource demand, so as to run the microservice corresponding to the container under the adjusted container configuration to achieve management of power applications.

[0101] The technical solution of the embodiment of the present invention realizes flexible deployment and resource management of each microservice by splitting the power application into multiple microservices and packaging each microservice into a container.

[0102] An optional technical solution is to split the power application into multiple microservices, including:

[0103] Acquire application data in a power application, and analyze the application data to identify a plurality of key data entities from the application data;

[0104] Draw entity relationship diagram based on multiple key data entities and the relationships between multiple key data entities;

[0105] Based on the entity relationship diagram, the power application is split into multiple microservices, so that each of the multiple microservices obtained by splitting is responsible for different key data entities and related operations of the corresponding key data entities.

[0106] Among them, by analyzing the application data in the power application, multiple key data entities are obtained. On this basis, combined with the application scenarios that may be involved in the embodiments of the present invention, the multiple key data entities may optionally include at least one of an object, a device, a power demand record, and an order, etc. This is related to the actual situation and is not specifically limited here.

[0107] Based on the multiple key data entities and the relationships between the multiple key data entities, an entity-relationship (ER) diagram is drawn, which helps to clearly display the key data entities and the relationships between them, and helps to understand the dependencies and data flows.

[0108] Furthermore, based on the entity relationship diagram, the power application is split into multiple microservices, each of which is responsible for only one key data entity and its related operations, ensuring the independence and maintainability of the microservices. For example, after splitting the power application, the following microservices can be obtained:

[0109] Object microservice: responsible for operations such as object registration, login, and information update.

[0110] Device microservice: handles the creation, update, and query of device information.

[0111] Power demand microservice: responsible for the generation and statistical analysis of power demand records, etc.

[0112] Order microservice: manages data and business logic related to electricity orders, etc.

[0113] The above technical solution realizes the accurate segmentation of power applications through key data entity recognition and entity relationship diagram.

[0114] Another optional technical solution is that after splitting the power application into multiple microservices based on the entity relationship diagram, the containerized power application management method further includes:

[0115] For each of the multiple microservices, a data model is built for the microservice according to the data structure and relationship of the microservice, and a database is selected for the microservice according to the data structure and the access mode of the microservice, so that during the operation of the microservice, the data of the microservice is stored according to the data model and the database.

[0116] Among them, a data model containing an abstract representation of data structure and relationship is built for each microservice, that is, an independent data model is designed for each microservice to ensure the independence of the data.

[0117] Specifically, a data model is an abstract representation of data structures and relationships, which may include:

[0118] Entity: represents key targets in power applications, such as objects, equipment, and orders;

[0119] Attributes: characteristics or data fields of an entity, such as the detection time and detection status of a device;

[0120] Relationship: The connection between entities, such as the association between an object and an order.

[0121] Exemplary:

[0122] The data model of the power demand microservice is:

[0123] Entity: Electricity demand record;

[0124] Attributes: record ID, device ID, demand quantity, and timestamp;

[0125] Relationship: Power demand and equipment (get equipment information through API).

[0126] Select the corresponding database according to the data structure and access mode of each microservice, or determine the appropriate database type, such as a relational database or a NoSQL database, so that each microservice has its own database instance, avoiding multiple microservices sharing the same database and ensuring independent data storage.

[0127] On this basis, optionally, microservices can interact through APIs instead of directly accessing each other's databases. Each microservice only exposes necessary API interfaces to ensure data access control. That is, a clear API interface is defined for each microservice, including basic create (Create, C) operations, read (Read, R) operations, update (Update, U) operations, and delete (Delete, D) operations.

[0128] Alternatively, each microservice can use an independent persistence layer to handle its own data access, thereby avoiding cross-service data operations.

[0129] Alternatively, if services need to share data, you can use an event-driven architecture to synchronize data through an event publish / subscribe mechanism instead of direct queries. That is, use message queues (such as Kafka and RabbitMQ) for event publishing and subscription to ensure data synchronization between microservices.

[0130] Optionally, clear interface contracts can be defined to ensure that interactions between microservices follow the conventions, thus avoiding direct dependencies on data structures.

[0131] Alternatively, as the business evolves, the data model of the microservice may change. Version management can be used to control the compatibility of the API interface to ensure that the old version of the service can continue to be used.

[0132] The above technical solution realizes independent storage of data for each microservice and ensures data storage security by building a data model and selecting a database for each microservice.

[0133] Another optional technical solution is that after packaging the microservice into a container, the above-mentioned containerized power application management method may also include: creating a Kubernetes Deployment and Service for the microservice, defining the initial number of replicas and initial resource requirements, so as to ensure the normal operation of the microservice.

[0134] Specifically, first, you need to make sure that the Kubernetes command line tool is installed and configured so that you can interact with the Kubernetes cluster.

[0135] Deployment is then responsible for managing the running state of the microservices. You can create a Deployment for each microservice and specify the initial number of replicas (such as two replicas) to ensure high availability. In addition, Deployment contains a selector to ensure that traffic can be correctly routed to the corresponding Pod.

[0136] In the Deployment definition, you can specify the Docker image used by the microservice and the exposed ports. You can also set resource requests and resource limits to ensure that each microservice can obtain sufficient CPU and memory resources when running. For example, you can set a request of 256MB memory and 500mCPU for a microservice, and a limit of 512MB memory and 1 CPU.

[0137] Service is used to expose microservices so that other services or objects can access the microservice. Each Service is associated with a corresponding Deployment, and the label selector is used to ensure that the traffic is distributed correctly. Usually, the Service type can be set to ClusterIP, so that the Service is only visible within the cluster.

[0138] For each microservice Service, you can define a port that points to the specific port where the microservice runs, so that external requests can access the corresponding microservice through the Service.

[0139] Once the Deployment and Service definitions are complete, you can apply them to the Kubernetes cluster. This step creates the corresponding Pods and Service instances, making the microservices immediately operational.

[0140] After deploying the microservice, you can check the status of the Deployment and Service to ensure that all Pods are running properly and that the Service can receive requests correctly.

[0141] Finally, you can access the microservice through port forwarding or directly through the Service to verify whether its function is normal, so as to ensure the availability of the microservice.

[0142] On this basis, in order to better understand the above-mentioned technical solutions as a whole, an openEuler containerized power application management example driven by power demand is given here for illustration.

[0143] For example, see Figure 5 , specifically including the following steps:

[0144] Step 1: Split the power application into multiple microservices and ensure that each microservice is independent;

[0145] Step 2: Create a Docker image for each microservice and manage dependencies, so as to package it into a container for flexible deployment and resource management;

[0146] Step 3: Ensure the normal operation of the microservice by creating a Deployment and Service in Kubernetes and defining the initial number of replicas and initial resource requirements;

[0147] Step 4: Dynamically adjust the container configuration based on the predicted power demand, including the target number of replicas required, target CPU limit, and target memory limit to ensure reasonable allocation of resources;

[0148] Step 5: Use Prometheus to monitor the running status and resource usage of the container in real time, and further optimize the container configuration based on the monitoring data to avoid resource waste or performance bottlenecks.

[0149] The above example effectively improves the resource utilization efficiency and system stability of containerized power applications under power demand fluctuations through a dynamic adjustment mechanism, ensuring the high availability and flexibility of microservices.

[0150] Figure 6 This is a structural block diagram of a containerized power application management device provided in an embodiment of the present invention, and the device is used to execute the containerized power application management method provided in any of the above embodiments. The device and the containerized power application management method in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the containerized power application management device, please refer to the embodiment of the containerized power application management method. Figure 6 , the device may specifically include: a container acquisition module 510, a target resource requirement determination module 520 and a microservice operation module 530. Among them,

[0151] The container acquisition module 510 is used to acquire multiple containers corresponding to the power application, wherein the multiple containers are respectively obtained by packaging the corresponding microservices, and the multiple microservices are obtained by splitting the power application;

[0152] The target resource demand determination module 520 may be used to predict the predicted power demand of the microservice corresponding to each container in response to the power demand prediction instruction, and determine the target resource demand of the container according to the predicted power demand;

[0153] The microservice running module 530 is used to adjust the container configuration of the container according to the target resource demand, so as to run the microservice corresponding to the container under the adjusted container configuration to realize the management of power application.

[0154] Optionally, the target resource requirement includes a target number of replicas requirement;

[0155] The target resource requirement determination module 520 includes:

[0156] A memory replica number requirement determination unit, which may be used to determine a target memory requirement of the container according to the predicted power requirement, obtain a basic memory requirement pre-configured for the container, and determine a memory replica number requirement of the container according to the basic memory requirement and the target memory requirement;

[0157] a CPU replica number requirement determination unit, configured to determine a target CPU requirement of the container according to the predicted power requirement, obtain a basic CPU requirement preconfigured for the container, and determine a CPU replica number requirement of the container according to the basic CPU requirement and the target CPU requirement;

[0158] The target replica number requirement determination unit is used to determine the target replica number requirement of the container according to the memory replica number requirement and the central processing unit replica number requirement.

[0159] On this basis, optionally, the memory replica number requirement determination unit may include:

[0160] A target memory requirement determination subunit may be used to obtain memory corresponding to a unit power requirement and determine a target memory requirement of a container based on the predicted power requirement and memory;

[0161] And / or, the CPU replica number requirement determination unit may include:

[0162] The target CPU requirement determination subunit is used to obtain the CPU corresponding to the unit power requirement and determine the target CPU requirement of the container according to the predicted power requirement and the CPU.

[0163] Optionally, the containerized power application management device further includes:

[0164] a target resource limit determination module, configured to determine a target resource limit of a container according to the predicted power demand after predicting the predicted power demand of a microservice corresponding to the container;

[0165] The microservice operation module 530 includes:

[0166] The container configuration adjustment unit is used to adjust the container configuration of the container according to the target resource requirement and the target resource limit.

[0167] On this basis, optionally, the target resource limit may include a target memory limit and / or a target CPU limit; the target resource limit determination module is specifically used to:

[0168] Obtaining a basic memory requirement of the container and a memory increase corresponding to a unit power requirement, and determining a target memory limit of the container based on the basic memory requirement, the memory increase, and the predicted power requirement; and / or,

[0169] A basic CPU demand and a CPU increase corresponding to a unit power demand of the container are obtained, and a target CPU limit of the container is determined based on the basic CPU demand, the CPU increase, and the predicted power demand.

[0170] Alternatively, the container configuration adjustment unit is specifically used to:

[0171] Get the actual resource usage of the container, and determine the current actual resource usage of the container based on the target resource limit and the actual resource usage;

[0172] A preset resource usage threshold is obtained, and the container configuration of the container is adjusted according to the target resource demand and the numerical relationship between the actual resource usage and the resource usage threshold.

[0173] Optionally, the containerized power application management device further includes:

[0174] The power application splitting module is used to split the power application into multiple microservices;

[0175] The microservice packaging module is used to create an image for each microservice in multiple microservices and manage the dependencies of the image to package the microservice into a container.

[0176] On this basis, optional power application splitting modules may include:

[0177] A key data entity identification unit, used for acquiring application data in the power application and analyzing the application data to identify a plurality of key data entities from the application data;

[0178] An entity relationship diagram drawing unit, used for drawing an entity relationship diagram based on a plurality of key data entities and the relationships between the plurality of key data entities;

[0179] The power application splitting unit is used to split the power application into multiple microservices based on the entity relationship diagram, so that each of the multiple split microservices is responsible for different key data entities and related operations of the corresponding key data entities.

[0180] On this basis, optionally, the containerized power application management device further includes:

[0181] The database selection module is used to build a data model for each microservice in the multiple microservices according to the data structure and relationship of the microservice after splitting the power application into multiple microservices based on the entity relationship diagram, and select a database for the microservice according to the data structure and access mode of the microservice, so as to store the data of the microservice according to the data model and database during the operation of the microservice.

[0182] The containerized power application management device provided by the embodiment of the present invention obtains multiple containers corresponding to the power application through the container acquisition module, and the multiple containers are obtained by packaging the corresponding microservices respectively, and the multiple microservices are obtained by splitting the power application; through the target resource demand determination module, for each container, in response to the power demand prediction instruction, predicts the predicted power demand of the microservice corresponding to the container, and determines the target resource demand of the container according to the predicted power demand; through the microservice operation module, adjusts the container configuration according to the target resource demand, so as to run the microservice corresponding to the container under the adjusted container configuration, and realizes the management of the power application. The above device effectively improves the resource utilization efficiency of the containerized power application under power demand fluctuations through the dynamic adjustment mechanism, thereby solving the problem of low flexibility caused by the lack of dynamic adjustment capability and the inability to efficiently respond to power demand fluctuations in the power application management process, and improves the flexibility of the power application management process.

[0183] The containerized power application management device provided in the embodiment of the present invention can execute the containerized power application management method provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0184] It is worth noting that in the embodiment of the above-mentioned containerized power application management device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0185] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0186] like Figure 7As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0187] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0188] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the containerized power application management method.

[0189] In some embodiments, the containerized power application management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the containerized power application management method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the containerized power application management method in any other appropriate manner (e.g., by means of firmware).

[0190] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0191] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0192] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0193] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0194] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0195] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0196] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0197] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A containerized power application management method, characterized in that: include: Acquire multiple containers corresponding to the power application, wherein the multiple containers are obtained by packaging corresponding microservices, and the multiple microservices are obtained by splitting the power application; For each of the containers, in response to the power demand prediction instruction, predict the predicted power demand of the microservice corresponding to the container, and determine the target resource demand of the container according to the predicted power demand; The container configuration of the container is adjusted according to the target resource demand, so as to run the microservice corresponding to the container under the adjusted container configuration to achieve management of the power application.

2. The method according to claim 1, characterized in that: The target resource requirement includes a target number of copies requirement; The determining the target resource requirement of the container according to the predicted power requirement includes: Determine a target memory requirement of the container according to the predicted power requirement, obtain a basic memory requirement preconfigured for the container, and determine a memory replica number requirement of the container according to the basic memory requirement and the target memory requirement; Determine a target CPU requirement for the container according to the predicted power requirement, obtain a basic CPU requirement preconfigured for the container, and determine a CPU replica number requirement for the container according to the basic CPU requirement and the target CPU requirement; The target number of copies required for the container is determined according to the memory copy number requirement and the central processing unit copy number requirement.

3. The method according to claim 2, characterized in that: The determining the target memory requirement of the container according to the predicted power requirement comprises: Acquire memory corresponding to unit power demand, and determine target memory demand of the container according to the predicted power demand and the memory; and / or, The determining the target CPU requirement of the container according to the predicted power requirement comprises: A central processing unit corresponding to a unit power demand is obtained, and a target central processing unit demand of the container is determined according to the predicted power demand and the central processing unit.

4. The method according to claim 1, characterized in that: After predicting the predicted power demand of the microservice corresponding to the container, the method further includes: determining a target resource limit for the container based on the predicted power demand; The adjusting the container configuration of the container according to the target resource requirement includes: A container configuration of the container is adjusted according to the target resource requirement and the target resource limit.

5. The method according to claim 4, characterized in that The target resource limit includes a target memory limit and / or a target CPU limit; The determining the target resource limit of the container according to the predicted power demand comprises: Obtaining a basic memory requirement of the container and a memory increase corresponding to a unit power requirement, and determining a target memory limit of the container according to the basic memory requirement, the memory increase, and the predicted power requirement; and / or, A basic CPU requirement of the container and a CPU increase corresponding to a unit power requirement are obtained, and a target CPU limit of the container is determined according to the basic CPU requirement, the CPU increase and the predicted power requirement.

6. The method according to claim 4, characterized in that The adjusting the container configuration of the container according to the target resource requirement and the target resource limit includes: Obtaining a current actual resource usage rate of the container, and determining a current actual resource usage amount of the container according to the target resource limit and the actual resource usage rate; A preset resource usage threshold is obtained, and a container configuration of the container is adjusted according to the target resource demand and a numerical relationship between the actual resource usage and the resource usage threshold.

7. The method according to claim 1, characterized in that Also includes: Splitting the power application into a plurality of microservices; For each of the multiple microservices, an image is created for the microservice, and dependencies of the image are managed to package the microservice into the container.

8. The method according to claim 7, characterized in that The splitting of the power application into a plurality of microservices comprises: Acquiring application data in the power application, and analyzing the application data to identify a plurality of key data entities from the application data; Based on the multiple key data entities and the relationships between the multiple key data entities, draw an entity relationship diagram; Based on the entity relationship diagram, the power application is split into a plurality of the microservices, so that each of the split microservices is responsible for different key data entities and related operations of the corresponding key data entities.

9. The method according to claim 8, characterized in that After splitting the power application into a plurality of microservices based on the entity relationship diagram, the method further includes: For each of the multiple microservices, a data model is constructed for the microservice according to the data structure of the microservice and the relationship, and a database is selected for the microservice according to the data structure and the access mode of the microservice, so that during the operation of the microservice, the data of the microservice is stored according to the data model and the database.

10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the containerized power application management method according to any one of claims 1 to 9.