Control method, system and equipment of energy management system based on micro service and medium

Through the communication between the client and the station equipment, the calculation tasks are allocated reasonably, and the server-side high-performance resources and dynamic scaling mechanism are used to solve the problem of insufficient EMS computing resources, improve the computing efficiency and resource utilization rate, and reduce the system operation cost.

CN120377285APending Publication Date: 2025-07-25ZHEJIANG DAYOU INDUSTRIAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510608936.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing EMS on the equipment side of the station area adopts a centralized architecture, which lacks computing resources, resulting in low computing efficiency after high-permeability distributed energy access, and is unable to effectively deal with complex trend computing.

Method used

Through the communication between the client and the station device, the calculation resource consumption is judged, the calculation tasks are allocated reasonably, simple calculations are processed locally on the client, complex calculations call high-performance resources on the server, and the semaphore rules are used to select idle and fastest-responsive microservices for calculation, and dynamically scale the microservice unit to optimize resource utilization.

Benefits of technology

Improve computing efficiency, avoid computing delays and resource waste, reduce system operation costs, and improve resource utilization efficiency and system response capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120377285A_ABST
    Figure CN120377285A_ABST
Patent Text Reader

Abstract

The invention discloses a control method, system and device of an energy management system based on micro-service and a medium, and belongs to the field of electric power systems.The method comprises the steps that a client communicates with a transformer area device to obtain transformer area data of the transformer area device; based on the computing resource consumption corresponding to the transformer area data, whether a server side is called for data computing or not is judged; if not, calculating the transformer area data based on the client; if calling, controlling the client to send the transformer area data to a message queue of the server, and receiving a competition instruction of each micro-service for the transformer area data based on a semaphore rule of the server so as to determine a target micro-service for calculating the transformer area data, calculating the transformer area data through the target micro service; and controlling the transformer area equipment through the client according to the calculation result. Therefore, by implementing the method, the calculation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power systems, and particularly to a control method, system, device and medium for an energy management system based on microservices. Background Art

[0002] With the rapid development of new energy technologies, modern distribution networks have transformed from passive networks with unidirectional power flow, i.e., electric energy flowing unidirectionally from power plants to users, into active networks including power generation, transmission, and power consumption functions, i.e., electric energy flow becomes bidirectional or even multi-directional. However, the high-penetration access of intermittent power sources such as distributed photovoltaics and wind power to the distribution network has caused frequent reverse power flow phenomena in medium- and low-voltage distribution networks. The distribution transformers originally designed based on unidirectional power flow frequently experience heavy overload problems, resulting in an increase in the load volatility of the distribution system and a decrease in the new energy consumption capacity.

[0003] Therefore, the prior art uses an EMS (Energy Management System) to monitor, control, optimize, and manage the energy of active distribution networks. However, the existing EMS on the device side of the substation area adopts a centralized architecture, and all computing tasks rely on the computing resources of local devices. For complex power flow calculations after high-penetration distributed energy access, there are problems of insufficient computing resources and low computing efficiency. Summary of the Invention

[0004] The present invention provides a control method, system, device and medium for an energy management system based on microservices, which can improve the computing efficiency.

[0005] The present invention provides a control method for an energy management system based on microservices, including:

[0006] Communicating with the substation area device through the client to obtain the substation area data of the substation area device, where the client is integrated in the energy management system for data collection and control;

[0007] Based on the computing resource consumption corresponding to the substation area data, determining whether to call the server for data calculation;

[0008] If not, calculating the substation area data based on the client; if so, controlling the client to send the substation area data to the message queue of the server, receiving the competition instructions of each microservice for the substation area data based on the semaphore rules of the server to determine the target microservice for calculating the substation area data, and calculating the substation area data through the target microservice;

[0009] Controlling the substation area device through the client according to the calculation result.

[0010] In the embodiments of the present invention, data is collected by communicating between the client and the substation area device, and whether to invoke the server for calculation is determined based on the calculated resource consumption, realizing the reasonable allocation of calculation tasks. Simple calculation tasks are processed locally on the client, and complex calculation tasks invoke the high-performance computing resources of the cloud server, avoiding calculation delays caused by insufficient local computing resources and improving the overall calculation efficiency.

[0011] Further, based on the semaphore rules of the server, competition instructions from each microservice for the substation area data are received to determine the target microservice for calculating the substation area data. Specifically:

[0012] Based on the message queue of the server, a semaphore corresponding to the substation area data is sent, and competition instructions corresponding to the semaphore from multiple microservices are received. Based on the idle states of each microservice and the sending time of the competition instructions, the target microservice is determined.

[0013] In this way, through the competition mechanism, the microservice that is idle and has the fastest response is preferentially selected to process the calculation task, ensuring that the calculation task can be processed at the fastest speed, further improving the calculation efficiency. It also avoids the situation where some microservices are overloaded while other microservices are idle due to unreasonable task allocation, enabling the resources of each microservice to be more balanced and effectively utilized, and improving the resource utilization efficiency of the entire system.

[0014] Further, based on the calculated resource consumption corresponding to the substation area data, whether to invoke the server for data calculation is determined. Specifically:

[0015] Determine the communication time consumed for data communication between the server and the client, and the first calculation time consumed by the server for calculating the substation area data. Based on the communication time and the first calculation time, determine the total time of the server;

[0016] Compare the total time with the second calculation time consumed by the client for calculating the substation area data. If the total time is greater than the second calculation time, perform data calculation through the client; if the total time is less than or equal to the second calculation time, invoke the server for data calculation.

[0017] By comparing the total time consumption of the server (communication time consumption + first calculation time consumption) with the second calculation time consumption of the client, it is possible to accurately determine which calculation method is more efficient in the current situation, and thus make a reasonable decision on the allocation of calculation tasks, ensuring that the calculation tasks are processed in an optimal manner, further improving the calculation efficiency. It also avoids blindly handing over all calculation tasks to the server for processing, reduces the dependence on the server's calculation resources, reduces the operating pressure and resource consumption of the server, and at the same time reduces the waste of resources during communication and calculation, thereby reducing the operating cost of the system.

[0018] Further, the control method of the microservice-based energy management system further includes:

[0019] Obtain and analyze the time-series change information of the average time consumption, idle time, and message queue length corresponding to each microservice call;

[0020] Determine the microservices with an increasing average call time consumption and a queuing situation in the message queue as the microservices to be expanded, and create microservice units for the microservices to be expanded based on the microservice control application programming interface.

[0021] In this way, when it is detected that the average call time consumption of the microservice becomes longer and there is a queuing situation in the message queue, the corresponding microservice is expanded in a timely manner, increasing the processing capacity of the microservice, being able to process the backlogged tasks faster, improving the response capacity and processing capacity of the system, reducing the waiting time of the tasks, and further enhancing the calculation efficiency.

[0022] Further, the control method of the microservice-based energy management system further includes:

[0023] If the resources of the server do not meet the expansion conditions, the creation of the microservice unit by the microservice to be expanded fails;

[0024] Determine the microservices with an idle time ratio exceeding a preset ratio as the microservices to be scaled down, and delete the microservice units in the microservices to be scaled down so that the microservices to be expanded can create the microservice units.

[0025] In this way, when the server resources do not meet the expansion conditions, by finding the microservices with an idle time ratio exceeding the preset threshold for scaling down, sufficient resources are released, so that the microservices to be expanded can successfully create microservice units, solving the server resource bottleneck problem and ensuring the normal operation of the system and the improvement of performance.

[0026] Further, the control method of the microservice-based energy management system further includes:

[0027] If there is no such microservice to be scaled down in the server, send a prompt message for prompting that the server is full.

[0028] When there is no service to be scaled down in the server, it indicates that the resources of the server have reached the limit. At this time, sending a prompt message indicating that the server is fully loaded can timely remind the operation and maintenance personnel to pay attention to the running status of the system and take corresponding measures, such as increasing server resources, optimizing the system architecture, etc., to avoid the further deterioration of system failures or performance problems caused by the server being fully loaded.

[0029] Furthermore, the control method of the energy management system based on microservices further includes:

[0030] When the server performs read and write operations on the substation area data, calculate the substation area data synchronously.

[0031] In this way, while the server performs read and write operations on the substation area data, calculate the substation area data synchronously, making full use of the computing resources of the server, reducing the time delay of data processing, improving the efficiency of data processing, and being able to obtain calculation results faster, further enhancing the calculation efficiency.

[0032] Another embodiment of the present invention further provides a control system for an energy management system based on microservices for electricity, including: a data acquisition module, a judgment module, a calculation module, and a control module;

[0033] The data acquisition module is used to communicate with the substation area equipment through the client to obtain the substation area data of the substation area equipment, wherein the client is integrated in the energy management system for data acquisition and control;

[0034] The judgment module is used to judge whether to call the server for data calculation based on the computing resource consumption corresponding to the substation area data;

[0035] The calculation module is used to, if not called, calculate the substation area data based on the client; if called, control the client to send the substation area data to the message queue of the server, and based on the semaphore rules of the server, receive the competition instructions of each microservice for the substation area data to determine the target microservice for calculating the substation area data, and calculate the substation area data through the target microservice;

[0036] The control module is used to control the substation area equipment through the client according to the calculation result.

[0037] In the embodiment of the present invention, data is collected through communication between the client and the substation area device, and it is judged whether to call the server for calculation according to the consumption of computing resources, realizing the reasonable allocation of computing tasks. Simple computing tasks are processed locally on the client, and complex computing tasks call the high-performance computing resources of the cloud server, avoiding computing delays caused by insufficient local computing resources and improving the overall computing efficiency.

[0038] Another embodiment of the present invention also provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the steps of the control method of the microservice-based energy management system of the present invention are implemented.

[0039] Another embodiment of the present invention also provides a computer-readable storage medium item, including: a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the steps of the control method of the microservice-based energy management system of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the present application, the drawings required for the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0041] Figure 1 It is a flowchart of an embodiment of the control method of the microservice-based energy management system;

[0042] Figure 2 It is a flowchart of an embodiment of the method for dynamically scaling the computing power server resources;

[0043] Figure 3 It is a structural diagram of an embodiment of the control system of the microservice-based energy management system. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs; the terms used herein are for the purpose of describing specific embodiments only and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.

[0046] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "a plurality of" is more than two, unless otherwise specifically defined.

[0047] Referring to "embodiments" herein means that the specific features, structures or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase does not necessarily refer to the same embodiment when it appears in various positions in the specification, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0048] In the description of the embodiments of this application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.

[0049] In the description of the embodiments of this application, the term "a plurality of" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0050] In the description of the embodiments of this application, unless otherwise clearly specified and limited, technical terms such as "installation", "connection", "connection", "fixation" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can also be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be the communication inside two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of this application can be understood according to specific circumstances.

[0051] To solve the problems of insufficient computing resources and low computing efficiency in the existing energy management system, a control method for an energy management system based on microservices provided by an embodiment of the present invention is as followsFigure 1 As shown, the method includes steps S101-S104, including:

[0052] Step S101: Communicate with a substation device through a client to obtain substation data of the substation device, wherein the client is integrated in an energy management system for data collection and control.

[0053] In this embodiment, the energy management system (EMS) side where the client is located is an embedded architecture, and data collection and communication microservices are deployed. The service is connected to the event-driven network (AOE) of the EMS, and based on the timing events and control delivery events of the AOE network, the communication events between the client and the substation equipment are triggered to collect the substation data of the substation equipment. Exemplarily, the substation equipment collects load / new energy output data regularly through its own collection capability, for example, once every 5 minutes, to obtain the substation data. Based on the timing events, the EMS communicates with the substation equipment through the client to obtain the substation data collected by the substation equipment.

[0054] Step S102: Based on the computing resource consumption corresponding to the station area data, determine whether to call the server to perform data calculation.

[0055] In this embodiment, the judgment is based on the consumption of computing resources. The local computing tasks of the client include numerical conversion and numerical comparison, such as photovoltaic maximum power point tracking and energy storage peak-shaving and valley-filling algorithms. Load forecasting, topology analysis, and power flow calculation algorithms that rely on deep learning algorithms or large-scale iterative calculations are called through the server.

[0056] As an example of an embodiment of the present invention, the determination of whether to call the server to perform data calculation based on the computing resource consumption corresponding to the station area data is specifically as follows: determining the communication time for data communication between the server and the client, and the first computing time for the server to calculate the station area data, and determining the total time for the server based on the communication time and the first computing time; comparing the total time with the second computing time for the client to calculate the station area data, if the total time is greater than the second computing time, performing data calculation through the client; if the total time is less than or equal to the second computing time, calling the server to perform data calculation.

[0057] In this embodiment, the purpose of invoking the server for calculation is to compress the calculation time. When the embedded calculation time is less than the communication time plus the server calculation time, the client local calculation is used; when the embedded calculation time is greater than or equal to the communication time plus the server calculation time, the server calculation is invoked. Among them, the server includes a computing power server and an application server, which are deployed and managed by Kubernetes. The computing power server runs algorithm microservices involving complex calculations as a worker node, and the application server runs web services and related management policies as a management node. Among them, Kubernetes, abbreviated as k8s, is an abbreviation formed by replacing the 8 characters "ubernete" in the middle of the name with 8, and is used to manage containerized applications on multiple hosts in cloud servers. The algorithm for invoking the server for calculation needs to be pre-implemented and deployed on the server. For example, load / new energy prediction algorithms, situation awareness algorithms, topology analysis algorithms, fault handling algorithms, etc. are deployed on the server.

[0058] Step S103: If not invoked, calculate the substation area data based on the client; if invoked, control the client to send the substation area data to the message queue of the server, and based on the semaphore rules of the server, receive the competition instructions of each microservice for the substation area data to determine the target microservice for calculating the substation area data, and calculate the substation area data through the target microservice.

[0059] In this embodiment, if the client does not need to invoke the server for calculation, the substation area data is calculated through the local calculation resources of the client. If it is necessary to invoke the server for calculation, the client generates an algorithm call request based on the substation area data to be calculated and sends it to the server; when the application server of the server receives the algorithm call request sent by the client, the web service of the server creates a coroutine, stores the substation area data corresponding to the algorithm call request in the message queue of the corresponding algorithm microservice and waits for a response; when there is substation area data in the message queue, a semaphore is sent; if the algorithm microservice of the server monitors the semaphore sent by its affiliated message queue, it triggers the message reading event of the algorithm microservice and sends a competition instruction; based on the competition instructions sent by each algorithm microservice, determine the target microservice for processing the substation area data. The target microservice calculates the substation area data corresponding to the algorithm call request, and after completion, stores the calculation result back to the message queue, which is consumed by the web service and the calculation result is returned to the client.

[0060] As an example of an embodiment of the present invention, based on the semaphore rule of the server, receiving competition instructions from each microservice for the substation area data to determine the target microservice for calculating the substation area data, specifically: sending a semaphore corresponding to the substation area data based on the message queue of the server, and receiving competition instructions corresponding to the semaphore from multiple microservices, and determining the target microservice based on the idle state of each microservice and the sending time of the competition instructions.

[0061] In this embodiment, through the semaphore rule, the message reading tasks in all algorithm microservices are converted into events, which are triggered by specific semaphores. For each algorithm microservice, if it receives the semaphore corresponding to the substation area data sent by the message queue, the algorithm microservice reads the substation area data and sends a competition instruction. The target microservice that competes successfully fastest is responsible for calculating the substation area data to ensure the fastest calculation speed. It should be noted that the computing capabilities of each pod of specific microservices belonging to the same message queue are the same. Whether the competition is successful only depends on whether the pod is idle and the order in which the idle pods execute the competition instructions. Here, a pod is the smallest basic unit of deployment and management in Kubernetes, referring to one or a group of containers that implement a microservice and is a unit of a microservice.

[0062] Step S104, controlling the substation area equipment by the client according to the calculation result.

[0063] In this embodiment, the client also deploys an optimization control microservice, which is triggered by the data collection success event and the algorithm call success event to implement the control algorithm. For the substation area data calculated by the client, based on the data collection success event, the client directly controls the substation area equipment according to the calculation result. This control algorithm can be the photovoltaic maximum power point tracking and energy storage peak shaving and valley filling algorithms. For the substation area data called from the server for calculation, the client sends an algorithm call request to the server. After the call is successful, based on the algorithm call success event, according to the calculation result returned by the server, the subsequent control issuance event is triggered by AOE to control the substation area equipment.

[0064] As an example of an embodiment of the present invention, the control method of the energy management system based on microservices further includes: obtaining and analyzing the time-series change information of the average call duration, idle time, and message queue length corresponding to each microservice call; determining the microservice with a prolonged average call duration and a queuing situation in the message queue as the service to be expanded, and creating a microservice unit for the service to be expanded based on the microservice control application programming interface.

[0065] In this embodiment, the algorithm microservices in the computing power server can be controlled by the management policy of the management node. By invoking the control API (Application Programming Interface), the scaling of the same microservice can be achieved, and thus the dynamic management of the resources of the computing power server can be realized. For example, Figure 2 As shown, by reading the statistical log information of the server, the sequential change information of the average call duration, idle time, and message queue length of each algorithm microservice call is analyzed. Then, using a rule-based discrimination method, through the algorithm microservice control API, the algorithm microservices with a longer average call duration and a message queue length greater than the number of pods are scaled out, that is, new corresponding microservice pods are created to speed up the processing speed of the message queue.

[0066] As an example of the embodiment of the present invention, the control method of the microservice-based energy management system further includes: if the resources of the server do not meet the scaling-out conditions, the microservice unit creation of the service to be scaled out fails; the microservice with an idle time ratio exceeding a preset ratio is determined as the service to be scaled in, and the microservice unit in the service to be scaled in is deleted so that the service to be scaled out can create the microservice unit.

[0067] In this embodiment, as Figure 2 shown, when the server resources cannot meet the scaling-out conditions, that is, the creation of microservice pods fails, the algorithm microservices with an idle time ratio exceeding a preset ratio are searched for scaling in, and the service pods are deleted to release the resources of the computing power server so that the service to be scaled out can create the microservice unit, where the preset ratio is 1 / (the number of service pods - 1). It should be noted that at least one group of pods is reserved for each microservice.

[0068] As an example of the embodiment of the present invention, the control method of the microservice-based energy management system further includes: if the service to be scaled in does not exist in the server, a prompt message for indicating that the server is full is sent.

[0069] In this embodiment, as Figure 2 shown, when there is no microservice that can be scaled in and the algorithm microservices with high load still cannot be scaled out, a prompt message for indicating that the server is full is sent, such as sending an alarm email to prompt the operation and maintenance personnel that the system is full.

[0070] As an example of the embodiment of the present invention, the control method of the microservice-based energy management system further includes: when the server reads and writes the substation area data, the substation area data is synchronously calculated.

[0071] In this embodiment, during the calculation process of the algorithm microservice, it is necessary to read and write the substation area data. When performing the read and write operations on the substation area data in this embodiment, the substation area data is calculated synchronously to implement the read operation and write operation of asynchronous data. In the scenario where the calculation steps and IO tasks are independent of each other, the time consumption of reading and writing data is saved, and the calculation time is further reduced. Among them, the read operation includes reading a data file and a model file, and the write operation refers to writing a record file.

[0072] As Figure 3 shown, based on the above method item embodiment, a corresponding system item embodiment is provided;

[0073] An embodiment of the present invention provides a control system 300 for an energy management system based on microservices, including: a data acquisition module 301, a judgment module 302, a calculation module 303, and a control module 304;

[0074] The data acquisition module 301 is used to communicate with the substation area equipment through a client to obtain the substation area data of the substation area equipment. Among them, the client is integrated in the energy management system for data acquisition and control;

[0075] The judgment module 302 is used to judge whether to call the server for data calculation based on the calculation resource consumption corresponding to the substation area data;

[0076] The calculation module 303 is used to, if not called, calculate the substation area data based on the client; if called, control the client to send the substation area data to the message queue of the server, and based on the semaphore rule of the server, receive the competition instructions of each microservice for the substation area data to determine the target microservice for calculating the substation area data, and calculate the substation area data through the target microservice;

[0077] The control module 304 is used to control the substation area equipment through the client according to the calculation result.

[0078] It can be understood that the above device item embodiment corresponds to the method item embodiment of the present invention, and it can implement the control method of the energy management system based on microservices provided by any one of the above method item embodiments of the present invention.

[0079] It should be noted that the system embodiments described above are merely illustrative. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the system embodiments provided by the present invention, the connection relationships between the modules indicate that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement this without creative efforts.

[0080] Based on the above embodiments of the control method of the microservice-based energy management system, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the control method of the microservice-based energy management system according to any embodiment of the present invention.

[0081] Exemplarily, in this embodiment, the computer program can be divided into one or more modules. The one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more module elements can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the terminal device.

[0082] The terminal device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory.

[0083] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the terminal device, and connects various parts of the entire terminal device through various interfaces and lines.

[0084] Based on the above method embodiments, another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the control method of the microservice-based energy management system described in any one of the above method embodiments of the present invention.

[0085] Among them, if the modules / units integrated in the device / terminal device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0086] The above is the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications are also regarded as the protection scope of the present invention.

Claims

1. A control method for an energy management system based on microservices, characterized in that, Including: Communicating with the substation area devices through the client to obtain the substation area data of the substation area devices, where the client is integrated in the energy management system for data collection and control; Judging whether to call the server for data calculation based on the calculated resource consumption corresponding to the substation area data; If not called, calculating the substation area data based on the client; if called, controlling the client to send the substation area data to the message queue of the server, receiving the competition instructions of each microservice for the substation area data based on the semaphore rules of the server to determine the target microservice for calculating the substation area data, and calculating the substation area data through the target microservice; Controlling the substation area devices through the client according to the calculation result.

2. The control method of the microservice-based energy management system according to claim 1, characterized in that The receiving the competition instructions of each microservice for the substation area data based on the semaphore rules of the server to determine the target microservice for calculating the substation area data is specifically: Sending the semaphore corresponding to the substation area data based on the message queue of the server, receiving the competition instructions corresponding to the semaphore of multiple microservices, and determining the target microservice based on the idle state of each microservice and the sending time of the competition instructions.

3. The control method of the microservice-based energy management system according to claim 1, characterized in that, The judging whether to call the server for data calculation based on the calculated resource consumption corresponding to the substation area data is specifically: Determining the communication time consumed for data communication between the server and the client, and the first calculation time consumed by the server for calculating the substation area data, and determining the total time consumed by the server based on the communication time consumed and the first calculation time consumed; Comparing the total time consumed with the second calculation time consumed by the client for calculating the substation area data. If the total time consumed is greater than the second calculation time consumed, data calculation is performed through the client; if the total time consumed is less than or equal to the second calculation time consumed, the server is called for data calculation.

4. The control method of the microservice-based energy management system according to claim 1, characterized in that Also including: Obtaining and analyzing the time series change information of the average time consumed, idle time, and message queue length corresponding to each microservice call; Determining the microservices with a prolonged average call time and a queuing situation in the message queue as the microservices to be expanded, and creating microservice units for the microservices to be expanded based on the microservice control application programming interface.

5. The control method of the microservice-based energy management system according to claim 4, characterized in that Also including: If the resources of the server do not meet the expansion conditions, the creation of the microservice unit by the microservice to be expanded fails; Determining the microservices with an idle time ratio exceeding a preset ratio as the microservices to be scaled down, and deleting the microservice units in the microservices to be scaled down so that the microservices to be expanded can create the microservice units.

6. The control method of the microservice-based energy management system according to claim 5, characterized in that Also including: If there is no microservice to be scaled down in the server, sending a prompt message for prompting that the server is full.

7. The control method of the microservice-based energy management system according to claim 1, characterized in that Also including: When the server performs read and write operations on the substation area data, synchronously calculating the substation area data.

8. A control system for an energy management system based on microservices, characterized in that, Including: A data collection module, a judgment module, a calculation module, and a control module; The data collection module is used to communicate with the substation area devices through the client to obtain the substation area data of the substation area devices, where the client is integrated in the energy management system for data collection and control; The judgment module is used to judge whether to call the server for data calculation based on the computing resource consumption corresponding to the substation area data; The calculation module is used to, if not called, calculate the substation area data based on the client; if called, control the client to send the substation area data to the message queue of the server, and based on the semaphore rule of the server, receive the competition instructions of each microservice for the substation area data to determine the target microservice for calculating the substation area data, and calculate the substation area data through the target microservice; The control module is used to control the substation area equipment through the client according to the calculation result.

9. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the control method of the microservice-based energy management system according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It includes: A stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the control method of the microservice-based energy management system according to any one of claims 1-7.