Networking method of multiple energy management units and related device
Patent Information
- Application Number
- CN202411533333.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2044-10-30
AI Technical Summary
同时基于对能量管理单元的数据安全性的考虑,不同地区的储能设备对应的能量管理单元不具有独立的公网IP,使得服务器无法直接基于互联网定位到每个能量管理单元,从而导致无法直接实现对每个能量管理单元的独立访问
[0012]可以看出,本申请中,目标能量管理单元通过向服务器发送调用请求,从而基于服务器返回的网络配置信息进行网络配置,而该网络配置信息中包括对应的局域网IP地址等用于可以定位目标能量管理单元的信息,以使服务器后续可以实现对目标能量管理单元的独立访问,并且,后续其他设备若想要实现对目标能量管理单元的访问,也可以基于服务器加入局域网,从而通过服务器来间接实现对目标能量管理单元的访问。同时,由于网络配置是基于服务器中配置的至少一个网络管理容器进行的,在至少一个网络管理容器为多个时,即使在单个网络管理容器故障时,也可以基于其他网络管理容器进行网络配置以及网络配置之后的网络管理,提高了服务器与多个能量管理单元进行组网的稳定性。
Smart Images

Figure CN119420644B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet communication technology, and in particular to a networking method and related apparatus for multiple energy management units. Background Technology
[0002] Currently, energy storage devices within the same energy storage system may be geographically dispersed, with each device in each region having its own Energy Management Unit (EMU) for management. Furthermore, due to data security considerations for the EMUs, the EMUs corresponding to energy storage devices in different regions do not have independent public IP addresses. This prevents servers from directly locating each EMU via the internet, thus hindering independent access to each EMU. Summary of the Invention
[0003] This application provides a networking method and related apparatus for multiple energy management units. The target energy management unit sends a call request to the server, so that the server returns network configuration information to the target energy management unit, thereby realizing the network configuration between the server and the target energy management unit, so that the server can independently access the target energy management unit based on the network configuration.
[0004] In a first aspect, this application provides a networking method for multiple energy management units, which is applied to a server configured with at least one network management container. The method includes:
[0005] In response to the target network management container receiving a call request from the target energy management unit, it determines whether the target energy management unit is a device that is being connected for the first time based on the call request. The call request includes the device identifier corresponding to the target energy management unit. The target energy management unit can be any one of multiple energy management units, and the target network management container can be any one of at least one network management container.
[0006] If the target network management container determines that the target energy management unit is a device that is accessing the network for the first time, it performs network configuration based on the second network configuration information corresponding to the server, and sends the first network configuration information corresponding to the target energy management unit to the target energy management unit so that the target energy management unit performs network configuration based on the first network configuration information.
[0007] The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server. The second network configuration information includes the public key, static tunnel IP address and subnet mask corresponding to the target energy management unit.
[0008] Secondly, this application provides another networking method for multiple energy management units, the method being applied to a target energy management unit, which is any one of multiple energy management units, the method comprising:
[0009] Send a call request to the server, the call request including the device identifier corresponding to the target energy management unit;
[0010] In response to receiving first network configuration information from the server, network configuration is performed according to the first network configuration information;
[0011] The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server.
[0012] As can be seen, in this application, the target energy management unit sends a call request to the server, thereby performing network configuration based on the network configuration information returned by the server. This network configuration information includes information such as the corresponding local area network (LAN) IP address, which is used to locate the target energy management unit. This allows the server to subsequently achieve independent access to the target energy management unit. Furthermore, other devices that wish to access the target energy management unit can join the LAN through the server, thus indirectly accessing the target energy management unit through the server. Simultaneously, since the network configuration is based on at least one network management container configured in the server, even if there are multiple network management containers, network configuration and subsequent network management can still be performed based on other network management containers, even if a single network management container fails. This improves the stability of the network formed by the server and multiple energy management units.
[0013] Thirdly, this application provides a networking device for multiple energy management units, which is applied to a server. The server is configured with at least one network management container, and the device includes:
[0014] In response to the target network management container receiving a call request from the target energy management unit through the first receiving unit, the first processing unit is used to determine whether the target energy management unit is a device accessing the network for the first time based on the call request. The call request includes the device identifier corresponding to the target energy management unit. The target energy management unit is any one of a plurality of energy management units, and the target network management container is any one of at least one network management container.
[0015] The first processing unit is also used to perform network configuration based on the second network configuration information corresponding to the server if it is determined that the target energy management unit is a device that is accessing for the first time;
[0016] The first sending unit is used to send the first network configuration information corresponding to the target energy management unit to the target energy management unit, so that the target energy management unit can perform network configuration based on the first network configuration information;
[0017] The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server. The second network configuration information includes the public key, static tunnel IP address and subnet mask corresponding to the target energy management unit.
[0018] Fourthly, this application provides another networking device for multiple energy management units, which is applied to a target energy management unit, which is any one of multiple energy management units. The device includes:
[0019] The second sending unit is used to send a call request to the server, and the call request includes the device identifier corresponding to the target energy management unit;
[0020] In response to the second receiving unit receiving the first network configuration information from the server, the second processing unit is used to perform network configuration based on the first network configuration information;
[0021] The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server.
[0022] Fifthly, this application provides an electronic device including a processor, a memory, and a communication interface. The processor, memory, and communication interface are interconnected and perform communication with each other. The memory stores executable program code, the communication interface is used for wireless communication, and the processor is used to retrieve the executable program code stored in the memory and execute some or all of the steps described in, for example, the methods of the first aspect and / or the second aspect.
[0023] In a sixth aspect, this application provides a computer-readable storage medium storing electronic data, which, when executed by a processor, is used to perform the electronic data to implement some or all of the steps described in the first and / or second aspects of this application.
[0024] In a seventh aspect, this application provides a computer program product including a computer program operable to cause a computer to perform some or all of the steps described in the first and / or second aspects of this application. The computer program product may be a software installation package. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic diagram of the structure of an energy storage system provided in an embodiment of this application;
[0027] Figure 2 A flowchart illustrating a networking method for multiple energy management units provided in an embodiment of this application;
[0028] Figure 3 This application provides a schematic diagram of a local area network (LAN) structure.
[0029] Figure 4 This is a schematic diagram of the structure of a network management container provided in an embodiment of this application;
[0030] Figure 5 A schematic flowchart illustrating a network management container expansion operation provided in this application embodiment;
[0031] Figure 6 A functional unit block diagram of a first networking device with multiple energy management units provided in an embodiment of this application;
[0032] Figure 7 A functional unit block diagram of a second networking device with multiple energy management units provided in an embodiment of this application;
[0033] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0035] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps is not limited to the steps listed, but may optionally include steps not listed, or may optionally include other steps inherent to these processes, methods, products, or apparatuses.
[0036] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0037] Because the multiple energy management units are geographically dispersed, they cannot be accessed independently via wired connections. Furthermore, due to data security considerations, each energy management unit lacks an independent public IP address, making direct internet access to each unit impossible and hindering independent access to each individual unit. Currently, the solution to this situation is to network the multiple devices. However, the conventional networking method relies on the server and other networked edge devices each having independent public IP addresses. This allows the server to directly add and configure network information for other edge devices, thus directly establishing a network between the server and other edge devices.
[0038] Since each energy management unit lacks an independent public IP address, it's impossible to directly add network configuration information for each unit on the server side. In this application, each energy management unit sends a request carrying a device identifier to the server. Upon receiving this request, the server creates corresponding network configuration information for both units and returns the network configuration information for each energy management unit. This allows for network configuration between both units, enabling networking between multiple energy management units and the server. Because the network configuration information includes IP addresses and other information that can be used for access and location, independent access to each energy management unit by the server is possible after networking.
[0039] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of an energy storage system provided in an embodiment of this application, as shown below. Figure 1 As shown, the energy storage system 100 includes a server 101 and multiple energy management units 102.
[0040] Server 101 has a public IP (Internet Protocol) address. Server 101 is configured with at least one network management container. Optionally, this at least one network management container may be configured based on a K8s (Kubernetes) cluster, and each network management container may include a Wireguard service container. Optionally, server 101 may refer to a single server, a server cluster, a cloud server, a cloud computing service center, or other form of computing-capable device.
[0041] Multiple energy management units 102 can be distributed across different areas, and generally, each energy management unit 102 does not have an independent public IP address, but shares a public IP address with other devices. Therefore, each energy management unit 102 can access the Internet through the public IP address shared with other devices, but the server 101 cannot directly locate the corresponding energy management unit 102 through the aforementioned public IP address shared by the energy management unit 102 with other devices after connecting to the Internet.
[0042] In addition, each energy management unit 102 can access the server, for example, by configuring a target interface service, such as an application programming interface (API) service, in the server, and configuring the target interface information in each energy management unit, so that after each energy management unit 102 is connected to the Internet, it can access the target interface based on the target interface information, thereby realizing initial communication with the server 101.
[0043] In this application, a target energy management unit among multiple energy management units sends a call request to the server. This call request includes a device identifier corresponding to the target energy management unit. Upon receiving the call request, the server determines whether the target energy management unit is a first-time user based on the device identifier in the call request. If it is determined that the target energy management unit is a first-time user, the server configures its own network according to its own second network configuration information and sends the first network configuration information corresponding to the target energy management unit to the target energy management unit. Upon receiving the first network configuration information, the target energy management unit also performs its own network configuration based on that first network configuration information.
[0044] The first network configuration information includes the private key, static tunnel IP address, and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address, and subnet mask corresponding to the server. The second network configuration information includes the public key, static tunnel IP address, and subnet mask corresponding to the target energy management unit.
[0045] Until multiple energy management units have configured their networks with the server using the above method, and the multiple energy management units have formed a network with the server, the server can independently access each energy management unit based on the IP address and other information in the network configuration information corresponding to each energy management unit.
[0046] Based on this, the embodiments of this application provide a networking method for multiple energy management units, and the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0047] Please see Figure 2 , Figure 2 This application provides a flowchart illustrating a networking method for multiple energy management units, applicable to the aforementioned energy storage system. Figure 2 As shown, the method includes the following steps:
[0048] In step S201, the target energy management unit sends a call request to the server. Correspondingly, the target network management container in the server receives the call request from the target energy management unit.
[0049] The call request includes the device identifier corresponding to the target energy management unit, which can be any one of multiple energy management units. For example, the target energy management unit can send the call request to the server based on an API interface service. This API interface service facilitates the transmission of call requests between the target energy management unit and the server before network deployment. Compared to traditional polling or manual configuration methods, the API interface service can respond to the energy management unit's call requests in real time and quickly return the required data or execution results, thereby improving network deployment efficiency. Specifically, the server is pre-configured with the API interface service, and the target energy management unit is pre-configured with the network address (e.g., IP address) of this API interface. After connecting to the internet, the target energy management unit can establish initial communication with the server based on this API interface address.
[0050] In step S202, the target network management container determines whether the target energy management unit is a first-time access device based on the call request.
[0051] Specifically, the target interface service on the server determines whether the target energy management unit has been previously connected based on the device identifier in the call request. Alternatively, the target interface service can call the server's database and determine this based on the previously connected device identifier information stored in the database. If the database does not contain the device identifier corresponding to the target energy management unit, then the target energy management unit is determined to be a first-time connected device. Furthermore, it can also determine whether there is a prior network configuration between the target energy management unit and the server. If no prior network configuration exists, it is determined to be a first-time connected device; if a prior network configuration exists, it is determined not to be a first-time connected device.
[0052] In step S203, if the target network management container determines that the target energy management unit is a device that is accessing for the first time, it performs network configuration based on the second network configuration information corresponding to the server.
[0053] If the server determines that the target energy management unit is a device that is being connected for the first time, it will add the target energy management unit to the database and create the second network configuration information and the first network configuration information corresponding to the server and the target energy management unit, respectively.
[0054] The first network configuration information includes the private key, static tunnel IP address, and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address, and subnet mask corresponding to the server. The second network configuration information includes the public key, static tunnel IP address, and subnet mask corresponding to the target energy management unit. The public and private keys are passwords or keys used for authentication when establishing a Virtual Private Network (VPN). The static tunnel IP address refers to a fixed IP address manually assigned to each end (or device on each end) in the VPN tunnel. The subnet mask is a value used to determine which part of the IP address is the network address (i.e., the part used to identify the network or subnet) and which part is the host address (i.e., the part used to identify the specific device within the network).
[0055] Furthermore, since network configuration based on the second network configuration information is performed in a target network management container within at least one network management container, the target network management container can be the currently idle network management container among the at least one network management containers. The at least one network management container may include a master network management container, and the target network management container can be the currently idle network management container selected by the master network management container from all network management containers. This idleness metric can be the network idle bandwidth, memory idle amount, or the number of energy management units managed by the network management container.
[0056] Furthermore, if there is no primary network management container, and network configuration is performed based on any one of the at least one network management containers, that network configuration management container can determine whether it has reached the maximum number of energy management units it can manage. If it has reached the maximum number of energy management units it can manage, the configuration can be randomly transferred to another network management container within the at least one network management container for processing; if it has not reached the maximum number of energy management units it can manage, it can continue with subsequent network configuration processing. At least one network management container can also set a priority for managing newly connected energy management units. This priority is determined based on the number of energy management units currently managed by each network management container; the lower the number of currently managed energy management units, the higher the priority.
[0057] In step S204, the target network management container sends the first network configuration information corresponding to the target energy management unit to the target energy management unit. Correspondingly, the target energy management unit receives the first network configuration information from the server.
[0058] Understandably, the server can also send the first network configuration information based on the API interface service.
[0059] Step S205: The target energy management unit performs network configuration based on the first network configuration information.
[0060] After the target energy management unit and the server are configured with networks, it is equivalent to establishing a virtual private network (VPN) between the target energy management unit and the server.
[0061] For example, the network configuration between the aforementioned target energy management unit and the server can be based on WireGuard. First, both the server and the target energy management unit need to have WireGuard software pre-installed. The server creates a WireGuard configuration file in each network management container to populate the corresponding configuration information, such as the public key, static tunnel IP address, and subnet mask corresponding to the target energy management unit created by the server, and adds iptables configuration based on this information. Understandably, if the target energy management unit is the first among multiple energy management units to communicate with the server, and a WireGuard configuration file already exists on the server, then the current iptables configuration needs to be refreshed and overwritten based on the aforementioned configuration information.
[0062] Similarly, a similar WireGuard configuration file will be created on the target energy management unit, or this WireGuard configuration file can be included when the server returns the initial configuration information. The configuration file will contain the server's private key, static tunnel IP address, and subnet mask returned via the API service, as well as the server's public key, static tunnel IP address, and subnet mask. Based on this configuration information, the current iptables configuration will be refreshed and overwritten. Finally, the WireGuard service will be started on both the server and the target energy management unit to make the aforementioned configuration effective. Furthermore, network testing tools can be used to check whether the server can successfully access other energy management units via VPN, ensuring secure and fast data transmission.
[0063] By configuring iptables rules, WireGuard can perform functions such as network address translation, traffic forwarding control, and firewall rule management. For example, by defining iptables rules, you can determine which packets can pass through the network interface and which packets should be blocked, thereby controlling traffic forwarding.
[0064] Understandably, given the high security of data associated with energy storage devices, to prevent data leakage caused by unrestricted data forwarding between energy management units, a master energy management unit can be set up among multiple energy management units. The master energy management unit's configuration information can store information such as the IP addresses of other energy management units, while the configuration information of other energy management units only stores their own configuration information and the master energy management unit's IP address. This allows users to forward data between other energy management units through the master energy management unit, but prevents data forwarding between other energy management units, thus avoiding the adverse effects of unrestricted data forwarding and improving the data security of the energy storage device. Simultaneously, the server-side can also disable data forwarding between other energy management units.
[0065] In addition, in one feasible embodiment, the server includes a status table that records the current network status of the energy management unit that has completed network configuration with the server. The method further includes: if the target network management container determines that the target energy management unit is not a device that is accessing for the first time, then if the current network status of the target energy management unit recorded in the status table is offline, the current network status of the target energy management unit is modified to online.
[0066] If it's determined that the target energy management unit is not a newly connected device, it means that both the target energy management unit and the server have stored the corresponding network configuration information, eliminating the need for cumbersome network configuration. Since the call request from the target energy management unit may be received through the aforementioned target interface, to ensure the server can monitor the network status of the target energy management unit, the network status of the target energy management unit in the server's status table needs to be updated. That is, if the network status information of the target energy management unit in the server's status table is offline, it should be changed to online. Simultaneously, the record of the call request sent by the current target energy management unit can be stored in the corresponding database. Understandably, if it's determined that the target energy management unit is not a newly connected device, the target network management container can transfer it to a pre-configured network management container for managing the target energy management unit for subsequent processing.
[0067] In this application, since the target energy management unit can only access the target interface when connected to the Internet, when it is determined that the target energy management unit is not the first device to be connected, the current network status of the target energy management unit in the server's status table can be changed from offline to online, thereby ensuring that the server can grasp the network status of the target energy management unit.
[0068] After completing the aforementioned network configurations between multiple energy management units and the server, these units form a Local Area Network (LAN). Users can access the LAN through the server and directly access the target energy management unit based on the network configuration between the server and the target energy management unit. For example, users can join the LAN by configuring the network between other devices and the server, or they can access the target energy management unit through other energy management units. This enables remote access to the target energy management unit.
[0069] Furthermore, after users connect to the local area network through the server, they can not only remotely access and control the target energy management unit, but also remotely access and control the corresponding energy storage devices, since the target energy management unit manages the corresponding energy storage devices. This enables the operation and maintenance personnel of the energy storage system to remotely operate and maintain the energy storage devices in different regions included in the energy storage system.
[0070] In addition, in one feasible embodiment, the server is also configured with an energy management system for managing multiple energy management units. The target network management container receives a call request from a target energy management unit, including: the target network management container receiving a call request forwarded by the energy management system.
[0071] In this application, the Energy Management System (EMS) is primarily used to manage multiple energy management units. The energy management system and the network management container can be two components existing in parallel on the server. Therefore, the server's reception of call requests from multiple energy management units is mainly based on the energy management system. After receiving the call request, the energy management system forwards it to the network management container, thereby performing network configuration for both parties based on the network management container. Subsequent remote management of specific single or multiple energy management units by the user is also primarily based on the energy management system.
[0072] In this application, an energy management system is used to manage multiple energy management units, which can improve the management efficiency of multiple energy management units.
[0073] Furthermore, this application also proposes a scheme for adjusting the number of network management containers.
[0074] In one feasible embodiment, the server is further configured with a container adjuster for adjusting the number of at least one network management container configured on the server. The method further includes: the container adjuster determining a first number of energy management units, the first number being the sum between the number of energy management units that have completed network configuration with the server and the number of energy management units that are currently being accessed for the first time; the container adjuster determining a second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage, such that the number of energy management units that the second number of network management containers can manage is not less than the first number of energy management units; and the container adjuster adjusting the number of at least one network management container configured on the server based on the second number of network management containers.
[0075] The network management container can be created based on a Kubernetes (K8s) cluster. The smallest unit that can be created and managed in a K8s cluster is a Pod, which is represented by the network management container in this application. The K8s cluster also includes a scheduler, which determines which node to schedule the Pod to run on based on factors such as the Pod's needs, the node's resource status, and scheduling policies. In this application, the network management container is used to manage the network of multiple energy management units connected to the server. For example, when accessing or sending data to an energy management unit is required, the network management container is invoked to achieve access or data transmission based on the corresponding network configuration.
[0076] To improve data forwarding efficiency between multiple energy management units (EMUs) and the server, the container adjuster in the server adjusts the number of at least one network management container configured on the server based on the sum of the number of EMUs currently configured with the server and the number of EMUs initially connected, as well as the number of EMUs that a single network management container can manage. The number of EMUs that a single network management container can manage can be determined empirically. A second required number of network management containers is determined based on the ratio between the first number of EMUs currently configured with the server and the number of EMUs that a single network management container can manage. Finally, the number of at least one network management container currently configured on the server is adjusted based on this second number.
[0077] Understandably, after adjusting the number of at least one network management container currently configured on the server, the scheduler will also schedule each network management container to the corresponding node based on the new number of network management containers, thereby performing network management on all energy management units in the local area network based on the scheduled network management containers.
[0078] For example, the current embodiment is executed through a container scaler, which can be a K8SHPA (Horizontal Pod Autoscaler) component. HPA can automatically scale the number of network management containers based on CPU utilization, memory utilization, or custom metrics. First, HPA collects metrics of the network management containers (i.e., the number of energy management units shown in this application) based on a monitoring system (e.g., a Metrics Server) in the Kubernetes cluster. The HPA controller periodically checks the metrics and compares them to preset target values. If the current metrics exceed or fall below the target value, HPA assesses whether the number of network management containers needs to be scaled up or down. Based on the metrics and preset rules, HPA calculates the required number of network management containers. Simultaneously, it ensures that a preset time has elapsed since the last adjustment to avoid frequent scaling up and down.
[0079] It is understood that the method shown in this embodiment can be performed according to a preset cycle, or it can be performed when a new energy management unit is first connected. Specifically, the settings can be configured according to the network setup stage. For example, if all energy management units are just beginning to network with the server, the number of energy management units initially connected will be large. If the method shown in this embodiment is performed when a new energy management unit is first connected, it will result in a large number of executions. In this case, the method shown in this embodiment can be performed according to a preset cycle, thereby reducing the number of executions. However, after all energy management units have completed the initial network setup with the server, subsequent energy management units may only be newly added when a new energy management unit is connected. In this case, the method shown in this embodiment can be configured to perform when a new energy management unit is first connected.
[0080] Meanwhile, if the method shown in this embodiment is performed according to a preset period, then the number of energy management units that are connected for the first time can refer to the number of energy management units that are connected for the first time within a preset period and have not yet completed network configuration. A preset period can be understood as the time from the completion of the current step in the previous execution until the execution of the current step in this current execution. The completion of network configuration by an energy management unit can be understood as the network management container having performed network configuration based on the second network configuration information and sent the first network configuration information to the energy management unit, and the energy management unit having also completed network configuration.
[0081] If the method shown in this embodiment occurs when an energy management unit is first connected, the number of energy management units initially connected is determined based on the number of energy management units connected at that moment. If only one energy management unit connects at any given time, the number of energy management units initially connected is one. If multiple energy management units connect simultaneously at any given time (e.g., when all energy management units are just beginning network configuration with the server), the number of energy management units initially connected is multiple.
[0082] For example, if the number of energy management units that have completed network configuration with the server is 1000, and the number of energy management units that are initially connected is 100, then the first number of energy management units is 1000 + 100 = 1100. If a single network management container can manage 500 energy management units, then the second number of network management containers required is 3.
[0083] In this application, the number of network management containers in the server is adjusted based on the number of energy management units that have completed network configuration with the server and the number of energy management units that a single network management container can manage, so that the adjusted number of network management containers can better meet the number requirements of network management containers for network management of the current energy management units.
[0084] Furthermore, in a feasible embodiment, before the container adjuster determines the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage, the method further includes: the container adjuster determining whether the absolute value of a first difference between the first number of energy management units and the third number of energy management units is greater than a preset difference, wherein the third number of energy management units is the sum of the number of energy management units when the number of at least one network management container configured on the server was adjusted previously, the number of energy management units after the server completed network configuration, and the number of energy management units initially connected; if the container adjuster determines that the absolute value of the first difference is greater than the preset difference, then the step of determining the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage is executed.
[0085] In this implementation, each time a new energy management unit (EMU) is configured to connect to the server via the local area network (LAN), the aforementioned operation to adjust the number of at least one network management container configured on the server is triggered. However, after each adjustment, the scheduler reschedules the EMUs, affecting system stability and consequently the overall efficiency of data forwarding between multiple EMUs and the server. Therefore, before adjusting the number of EMUs, or each time a new EMU is configured to connect to the server via the LAN, it is necessary to determine whether the absolute value of the first difference between the first number of EMUs and the third number of EMUs is greater than a preset difference. If the absolute value of the first difference is greater than the preset difference, then the step of adjusting the number of at least one EMU configured on the server continues. The third number of EMUs is the sum of the number of EMUs configured on the server during the previous adjustment, the number of EMUs configured on the server, and the number of EMUs that were first connected.
[0086] In addition to judging based on the absolute value of the first difference, a judgment can also be made alone or in combination with time. That is, it can be determined whether the first duration between the current time and the time when the number of network management containers was adjusted last time is greater than a preset duration. If the first duration is greater than the preset duration, then the subsequent step of adjusting the number of network management containers on the server can be executed. In other words, at least one of the aforementioned two conditions must be met before executing the subsequent step of adjusting the number of at least one network management container configured on the server.
[0087] For example, if the number of energy management units that completed network configuration with the server was 900 when the number of network management containers was adjusted last time, and the number of energy management units that were initially connected was 50, then the third number of energy management units is 900 + 50 = 950. If the current first number of energy management units is 1100, and the preset difference is 100, it can be determined that the difference between the first number of energy management units and the third number of energy management units is 150, which is greater than the preset difference of 100. At this time, the step of determining the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage, as shown in the aforementioned embodiment, can be executed.
[0088] In this application, before adjusting the number of at least one network management container configured on the server, it is also necessary to meet the condition that the absolute value of the difference between the current reference number of energy management units and the reference number of energy management units when the number of network management containers was adjusted last time is greater than a preset difference. This avoids frequent adjustments to the number of network management containers, which would affect the data forwarding between the energy management units and the server, and further improves the efficiency of data forwarding between multiple energy management units and the server.
[0089] Specifically, in one feasible embodiment, the container adjuster adjusts the number of at least one network management containers configured on the server based on a second number of network management containers, including: if the container adjuster determines that the second number of network management containers is greater than the number of at least one network management containers currently configured on the server, then the container adjuster adds a network management container of the second difference to the at least one network management container currently configured on the server, the second difference being the absolute value of the difference between the second number of network management containers and the number of network management containers currently configured on the server; if the container adjuster determines that the second number of network management containers is less than the number of at least one network management containers currently configured on the server, then the container adjuster deletes a network management container of the second difference from the at least one network management container currently configured on the server.
[0090] After determining the number of network management containers required by the current server, the number of network management containers currently configured on the server needs to be adjusted to match the required number. Specifically, if the required number of network management containers is greater than the currently configured number, then the corresponding number of network management containers needs to be added to the server; conversely, if the required number is less than the currently configured number, then the corresponding number of network management containers needs to be reduced. It's understandable that multiple network management containers can consist of a single network management container plus multiple copies of that container.
[0091] For example, if it is determined that scaling is needed, HPA adjusts the number of Pod (network management container) replicas in the Deployment or StatefulSet via the Kubernetes API. The Kubernetes scheduler starts or stops the corresponding Pod based on the new number of replicas, and then waits for the system to stabilize to ensure that the new WireGuard network management container runs normally and processes requests.
[0092] Continuing the previous example, if the required second number of network management containers is 6, and the current server is configured with at least 4 network management containers, then the second difference between the required second number of network management containers and the current server configuration is 6 - 4 = 2. In this case, 2 more network management containers need to be added. If the required second number of network management containers is 6, and the current server is configured with at least 9 network management containers, then the second difference between the current server configuration and the required second number of network management containers is 9 - 6 = 3. In this case, 3 network management containers can be removed.
[0093] For example, the following is by Figure 3 For a detailed description of the local area network (LAN) between the energy management unit and the server, please refer to [link / reference]. Figure 3 , Figure 3 This application provides a schematic diagram of a local area network (LAN) structure, as shown in the embodiments of the present application. Figure 3 As shown, this includes a local area network (LAN) connecting multiple energy management units and a server. The server has a public IP address, enabling data forwarding between the energy management units. The server also includes an energy management system, a network management container, and a container adjuster. The energy management system primarily controls and manages the multiple energy management units, while the network management container manages the network of these units. The container adjuster adjusts the number of network management containers.
[0094] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of a network management container provided in an embodiment of this application, as shown below. Figure 4 As shown, the network management container can be created within a Kubernetes (K8s) cluster. The server and multiple energy management units can be networked based on WireGuard. The WireGuard service on the server is deployed within the network management container (K8sContainer), and an interface service (API service) is also deployed within the same network management container to receive requests from the energy management units (Front), such as adding or modifying network configurations. The WireGuard configuration information is stored in a MySQL database and in a configuration file (wg0.conf) applied to the network application (WireGuard application). Kubernetes (K8s) is an open-source network management container orchestration system used for automating the deployment, scaling, and management of containerized network management applications.
[0095] Please see Figure 5 , Figure 5 This application provides a flowchart illustrating a network management container expansion operation, as shown in the embodiments below. Figure 5 As shown, the Container Regulator (HPA) configured on the server is connected to at least one network management container and monitors the network management container according to corresponding monitoring metrics. Simultaneously, the Container Regulator is also connected to a controller for coordinated scaling operations. This controller is also configured on the server. When the Container Regulator determines that scaling is needed, it issues a scaling operation command to the controller (Deployment). The controller then controls the creation of the original network management container (K8s Container), resulting in a new network management container. The new network management container is a copy of the original network management container and also includes an interface service (API service) and a networking program (WireGuard program).
[0096] In this application, when the number of network management containers configured on the current server is expanded according to the number of network management containers required by the current server, the high operating pressure on each network management container caused by insufficient number of network management containers can be avoided; and when the number of network management containers configured on the server is reduced according to the number of network management containers required by the current server, the waste of resources caused by excessive number of network management containers can be avoided.
[0097] In another feasible embodiment, the server is further configured with a container adjuster for adjusting the number of at least one network management container configured on the server. The method further includes: the container adjuster determining the number of energy storage devices corresponding to each energy management unit among the energy management units currently configured with the server and the energy management units initially connected; the container adjuster determining a fourth number of network management containers based on the number of energy storage devices corresponding to each energy management unit among the energy management units currently configured with the server and the energy management units initially connected, and the number of energy storage devices corresponding to energy management units that a single network management container can manage, so that after allocating the energy management units currently configured with the server and the energy management units initially connected to the server to the fourth number of network management containers, the number of energy storage devices corresponding to the energy management units allocated to each network management container is not greater than the number of energy storage devices corresponding to the energy management units that a single network management container can manage; and the container adjuster adjusting the number of at least one network management container configured on the server based on the fourth number of network management containers.
[0098] Since each energy management unit manages its corresponding energy storage device, but the number of energy storage devices managed by each energy management unit may vary, the amount of data generated by each energy management unit may also vary. Therefore, in addition to adjusting the number of network management containers configured on the server based on the first number of energy management units that have completed network configuration with the server, this embodiment can also adjust the number of network management containers configured on the server based on the number of energy storage devices managed by all energy management units.
[0099] Specifically, determine the number of energy storage devices corresponding to each energy management unit in the current energy management unit that has completed network configuration with the server and the energy management unit that has just connected, as well as the number of energy storage devices corresponding to each energy management unit that a single network management container can manage. Understandably, the number of energy storage devices corresponding to each energy management unit that a single network management container can manage can be determined based on empirical values. Since the number of energy storage devices managed by each energy management unit is fixed, when determining the fourth number of network management containers, it should also be considered that it may be difficult to allocate each network management container to the same number of energy management units corresponding to energy storage devices during subsequent energy management unit allocation.
[0100] Therefore, when determining the fourth number of network management containers, all energy management units can be randomly combined based on the number of energy storage devices corresponding to each energy management unit. Multiple combination methods can be obtained, provided that the total number of energy storage devices corresponding to each group of energy management units does not exceed the number of energy storage devices corresponding to an energy management unit that a single network management container can manage. The target combination method with the fewest groupings is then selected from these methods and determined as the fourth number of network management containers. Subsequently, the number of network management containers included in the current server is adjusted according to the required number of energy management units, as shown in the aforementioned embodiment. Furthermore, the scheduling of energy management units managed by each network management container can also be performed according to the aforementioned target grouping method.
[0101] For example, if there are three energy management units A, B, and C, where energy management unit A includes three energy storage devices, energy management unit B includes four energy storage devices, and energy management unit C includes two energy storage devices, then if a single network management container can manage five energy storage devices corresponding to each energy management unit, there are only two possible combinations. The first combination results in two groups: group 1 includes energy management units A and C, and group 2 includes energy management unit B. The second combination results in three groups: group 1 includes energy management unit A, group 2 includes energy management unit B, and group 3 includes energy management unit C. Therefore, the combination with the fewest groups is the first combination, and the fourth number of network management containers is determined to be two.
[0102] In this embodiment, the number of network management containers configured on the server is adjusted according to the number of energy storage devices managed by each energy management unit and the number of energy storage devices corresponding to the energy management unit that a single network management container can manage. This can make the adjusted number of network management containers better meet the requirements of the number of network management containers managing the current energy management unit, thereby improving the data forwarding efficiency between multiple energy management units and the server.
[0103] Understandably, before performing the network management container quantity adjustment step shown in the aforementioned embodiments, pre-execution conditions can also be added. These conditions can include: the difference between the current number of energy management units that have completed network configuration with the server and the number of energy management units that have initially connected to the server, and the number of energy management units that completed network configuration with the server and the number of energy management units that initially connected to the server when the network management container quantity was adjusted previously, is greater than a preset difference; and / or the duration between the current time and the time of the previous network management container quantity adjustment is greater than a preset duration. It can also include: the difference between the total number of energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that initially connected to the server, and the total number of energy storage devices corresponding to the energy management units that completed network configuration with the server and the energy management units that initially connected to the server when the network management container quantity was adjusted previously, is greater than a second difference.
[0104] Furthermore, due to the varying number of battery packs in each energy storage device, the capacity of each device may also differ. If an energy management unit corresponds to a higher-capacity energy storage device, then that energy management unit is likely to be more important. Therefore, in addition to adjusting the number of network management containers based on the number of energy storage devices corresponding to each energy management unit, the number can also be adjusted based on the capacity of those devices.
[0105] Specifically, in one feasible embodiment, the container adjuster determines the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. Based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage, the container adjuster determines a fifth number of network management containers, such that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time to the fifth number of network management containers, the capacity of the energy storage device corresponding to the energy management unit allocated to each network management container is not greater than the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. The container adjuster adjusts the number of network management containers configured on the server based on the fifth number of network management containers.
[0106] The capacity of the energy storage device corresponding to each energy management unit refers to the total capacity of all energy storage devices corresponding to each energy management unit. Furthermore, when determining the fifth number of network management containers based on the capacity of the energy storage devices corresponding to each energy management unit in the energy management units currently configured with the server, and the capacity of the energy storage devices corresponding to the energy management units that a single network management container can manage, the method described in the previous embodiment can also be used. That is, all energy management units can be randomly combined based on the capacity of the energy storage devices corresponding to each energy management unit. On the premise that the total capacity of the energy storage devices corresponding to each group of energy management units is not greater than the capacity of the energy storage devices corresponding to the energy management units that a single network management container can manage, multiple combination methods can be obtained. The combination method with the fewest groupings is selected from these multiple combination methods, and the combination with the fewest groupings is determined as the fourth number of network management containers.
[0107] It is understandable that before adjusting the number of network management containers according to the two methods mentioned above, execution conditions can be added according to the method shown in the aforementioned embodiments. In addition to the execution conditions shown in the aforementioned embodiments, the execution conditions may also include: the difference between the total capacity of the energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, and the total capacity of the energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time when the number of network management containers was adjusted last time, is greater than a third difference.
[0108] Similarly, after adjusting the number of network management containers according to the aforementioned embodiments, it is also necessary to adjust the energy management unit that each network management container needs to manage according to the corresponding indicators.
[0109] In addition, in a feasible embodiment, there are multiple servers, and each of the multiple servers is configured with at least one network management container. The multiple network management containers configured in the multiple servers are used to manage the energy management units that have completed network configuration with the multiple servers. When the target server among the multiple servers fails, the energy management units managed by at least one network management container configured in the target server are managed based on the network management containers configured in other servers. The other servers are the servers other than the target server among the multiple servers.
[0110] When there are multiple servers, the management of multiple energy management units can be evenly distributed among them. That is, the number of energy management units managed by the network management containers configured on each server is similar. Furthermore, multiple servers can share a unified database. This way, if a single target server fails, the network management containers configured on other servers can directly manage the energy management units managed by at least one network management container on the target server. Additionally, if a single network management container on any server fails, other network management containers can take over the operation of that single container.
[0111] In this application, when a target server among multiple servers fails, the operation of the target server can be taken over by other servers among the multiple servers, thereby avoiding the local area network becoming unusable due to the failure of a single server.
[0112] As can be seen in this embodiment, since the target energy management unit is pre-configured with target interface information, it can access the target interface based on this information to achieve initial communication with the server. Subsequently, a call request is sent to the target interface so that when the server determines the target energy management unit is a first-time access device based on the call request, it directly creates corresponding network configuration information for both and returns the network configuration information corresponding to the target energy management unit to the target energy management unit based on the target interface, allowing both to perform network configuration. This allows the target energy management unit to complete networking with the server even when it does not have an independent public IP address, thereby enabling the server to independently access the target energy management unit. Furthermore, the target interface is configured on each of at least one network management container within the server, ensuring that even if a single network management container fails, network configuration and subsequent access can still be performed based on other network management containers, improving the stability of the network between the server and multiple energy management units.
[0113] For embodiments consistent with those shown above, please refer to... Figure 6 , Figure 6 This application provides a functional unit block diagram of a first networking device for multiple energy management units, wherein the first networking device for multiple energy management units is a server or a part thereof, such as... Figure 6 As shown, the first networking device 60 of multiple energy management units includes:
[0114] In response to the target network management container receiving a call request from the target energy management unit through the first receiving unit 601, the first processing unit 602 is used to determine whether the target energy management unit is a device accessing for the first time based on the call request. The call request includes the device identifier corresponding to the target energy management unit. The target energy management unit is any one of a plurality of energy management units, and the target network management container is any one of at least one network management container.
[0115] The first processing unit 602 is further configured to perform network configuration based on the second network configuration information corresponding to the server if the target network management container determines that the target energy management unit is a device accessing for the first time;
[0116] The first sending unit 603 is used to send the first network configuration information corresponding to the target energy management unit to the target energy management unit, so that the target energy management unit can perform network configuration based on the first network configuration information;
[0117] The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server. The second network configuration information includes the public key, static tunnel IP address and subnet mask corresponding to the target energy management unit.
[0118] In one feasible embodiment, the server includes a status table that records the current network status of the energy management unit that has completed network configuration with the server. The first processing unit 602 is further configured to: if it is determined that the target energy management unit is not a device that is accessing for the first time, then if the current network status of the target energy management unit recorded in the status table is offline, modify the current network status of the target energy management unit to online.
[0119] In one feasible embodiment, the server is also configured with an energy management system, which manages multiple energy management units, and call requests from target management units are forwarded to the network management container via the energy management system.
[0120] In one feasible embodiment, the server is further configured with a container adjuster for adjusting the number of at least one network management container configured on the server. The first processing unit 602 is further configured to: determine a first number of energy management units, the first number being the sum of the number of energy management units that have completed network configuration with the server and the number of energy management units that are currently accessing for the first time; determine a second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage, such that the number of energy management units that the second number of network management containers can manage is not less than the first number of energy management units; and adjust the number of at least one network management container configured on the server based on the second number of network management containers.
[0121] In a feasible embodiment, before determining the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage, the first processing unit 602 is further configured to: determine whether the absolute value of the first difference between the first number of energy management units and the third number of energy management units is greater than a preset difference, wherein the third number of energy management units is the sum of the number of energy management units when the number of at least one network management container configured on the server was adjusted previously, the number of energy management units that the server completed network configuration, and the number of energy management units that were first connected; if it is determined that the absolute value of the first difference is greater than the preset difference, then the step of determining the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage is executed.
[0122] In a feasible embodiment, regarding the adjustment of the number of at least one network management containers configured on the server based on a second number of network management containers, the first processing unit 602 is specifically configured to: if it is determined that the second number of network management containers is greater than the number of at least one network management containers currently configured on the server, then add a network management container of the second difference to the at least one network management container currently configured on the server, the second difference being the difference between the second number of network management containers and the number of network management containers currently configured on the server; if it is determined that the second number of network management containers is less than the number of at least one network management containers currently configured on the server, then delete a network management container of the second difference from the at least one network management container currently configured on the server.
[0123] In one feasible embodiment, the server is further configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The first processing unit 602 is further configured to: determine the number of energy storage devices corresponding to each energy management unit among the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time; determine a fourth number of network management containers based on the number of energy storage devices corresponding to each energy management unit among the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the number of energy storage devices corresponding to the energy management units that a single network management container can manage, so that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time to the fourth number of network management containers, the number of energy storage devices corresponding to the energy management units allocated to each network management container is not greater than the number of energy storage devices corresponding to the energy management units that a single network management container can manage; and adjust the number of at least one network management container configured on the server based on the fourth number of network management containers.
[0124] In one feasible embodiment, there are multiple servers, and each of the multiple servers is configured with at least one network management container. The multiple network management containers configured in the multiple servers are used to manage the energy management units that have completed network configuration with the multiple servers. When the target server among the multiple servers fails, the energy management units managed by at least one network management container configured in the target server are managed based on the network management containers configured in other servers. The other servers are the servers other than the target server among the multiple servers.
[0125] For embodiments consistent with those shown above, please refer to... Figure 7 , Figure 7 This application provides a functional unit block diagram of a second networking device for multiple energy management units, where the second networking device for multiple energy management units is one or a part of the aforementioned energy management units, such as... Figure 7 As shown, the second networking device 70, comprising multiple energy management units, includes:
[0126] The second sending unit 701 is used to send a call request to the server, the call request including the device identifier corresponding to the target energy management unit;
[0127] In response to the second receiving unit 702 receiving the first network configuration information from the server, the second processing unit 703 is used to perform network configuration according to the first network configuration information;
[0128] The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server.
[0129] It is understood that since the method embodiments and the device embodiments are different presentations of the same technical concept, the content of the method embodiment section in this application should be adapted to the device embodiment section in a synchronous manner, and will not be repeated here.
[0130] All relevant content in each scenario involved in the above method embodiments can be referenced from the functional descriptions of the corresponding functional modules, and will not be repeated here. The first networking device 60 and the second networking device 70 of the multiple energy management units jointly execute the above. Figure 2 The networking method for multiple energy management units is shown.
[0131] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions according to the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. A computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. Semiconductor media can be solid-state drives.
[0132] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device 800 may include one or more of the following components: processor 801, memory 802, and communication interface 803. The processor 801, memory 802, and communication interface 803 are interconnected and perform communication between them. The memory 802 may store one or more computer programs, which may be configured to implement the methods described in the above embodiments when executed by one or more processors 801.
[0133] Processor 801 may include one or more processing cores. Processor 801 connects to various parts within the electronic device 800 using various interfaces and lines, and performs various functions and processes data of the electronic device 800 by running or executing instructions, programs, code sets, or instruction sets stored in memory 802, and by calling data stored in memory 802. Optionally, processor 801 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 801 may integrate one or more of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. It is understood that the aforementioned modem may also not be integrated into processor 801, but may be implemented separately through a communication chip.
[0134] The memory 802 may include random access memory (RAM) or read-only memory (ROM). The memory 802 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 802 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described above. The data storage area may also store data created by the electronic device 800 during use.
[0135] It is understood that the electronic device 800 may include more or fewer structural elements than those shown in the above block diagram, such as a power module, physical buttons, a WiFi (Wireless Fidelity) module, a speaker, a Bluetooth module, sensors, etc., without limitation.
[0136] The aforementioned electronic device 800 may include the aforementioned server or energy management unit.
[0137] This application provides a computer-readable storage medium storing program data, which, when executed by a processor, is used to perform some or all of the steps of any of the networking methods for multiple energy management units described in the above method embodiments.
[0138] This application also provides a computer program product comprising a computer program operable to cause a computer to perform some or all of the steps of any of the networking methods for multiple energy management units as described in the above method embodiments. The computer program product may be a software installation package.
[0139] It should be noted that, for the aforementioned method embodiments of networking multiple energy management units, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to this application.
[0140] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce a good effect.
[0141] Those skilled in the art will understand that all or part of the steps in the various method embodiments of the above-described networking method for multiple energy management units can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk, or an optical disk, etc.
[0142] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principle and implementation of a networking method and related device for multiple energy management units in this application. The description of the above embodiments is only for the purpose of helping to understand the method and its core ideas in this application. At the same time, for those skilled in the art, based on the idea of a networking method and related device for multiple energy management units in this application, there will be changes in the specific implementation and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
[0143] This application is described with reference to flowchart illustrations and / or block diagrams of methods, hardware products, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0144] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0145] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0146] It is understood that any product that is controlled or configured to perform the processing method of the flowchart described in the method embodiment of the networking method of multiple energy management units of this application, such as the terminal and computer program product of the above flowchart, falls within the scope of the related products described in this application.
[0147] Obviously, those skilled in the art can make various modifications and variations to the networking method and related apparatus for multiple energy management units provided in this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A networking method for multiple energy management units, characterized in that, The method is applied to a server, the server being configured with at least one network management container, the method comprising: In response to the target network management container receiving a call request from the target energy management unit, the container determines whether the target energy management unit is a first-time access device based on the call request. The call request includes a device identifier corresponding to the target energy management unit. The target energy management unit is any one of the plurality of energy management units, and the target network management container is any one of the at least one network management container. If the target network management container determines that the target energy management unit is a device accessing the network for the first time, it performs network configuration based on the second network configuration information corresponding to the server, and sends the first network configuration information corresponding to the target energy management unit to the target energy management unit, so that the target energy management unit performs network configuration based on the first network configuration information; The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server; the second network configuration information includes the public key, static tunnel IP address and subnet mask corresponding to the target energy management unit. The server is further configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The method further includes: The container adjuster determines the capacity of the energy storage device corresponding to each energy management unit in the energy management unit that has completed network configuration with the server and the energy management unit that has been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage; The container adjuster determines a fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. This ensures that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time to the fifth number of network management containers, the capacity of the energy storage device corresponding to the energy management unit allocated to each network management container is not greater than the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. The container adjuster adjusts the number of network management containers configured on the server based on the fifth number of network management containers; The method further includes, before the container adjuster determines the fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. If the container adjuster determines that the total capacity of the energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, and the total capacity of the energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time when the number of network management containers was adjusted, the difference between these two values is greater than a third difference. Then, the fifth step of determining the number of network management containers is executed based on the capacity of the energy storage devices corresponding to each energy management unit that has completed network configuration with the server and the energy management units that have been connected for the first time, and the capacity of the energy storage devices corresponding to the energy management units that a single network management container can manage. Among the plurality of energy management units, a master energy management unit is set up. The configuration information of the master energy management unit stores the IP addresses corresponding to the other energy management units. The configuration information of the other energy management units stores their own configuration information and the IP address of the master energy management unit, so that data forwarding between the master energy management unit and the other energy management units can be realized, but data forwarding between the other energy management units is not possible.
2. The method according to claim 1, characterized in that, The server includes a status table that records the current network status of the energy management unit that has completed network configuration with the server. The method further includes: If the target network management container determines that the target energy management unit is not a device accessing for the first time, then if the current network status of the target energy management unit recorded in the status table is offline, the current network status of the target energy management unit will be changed to online.
3. The method according to claim 1 or 2, characterized in that, The server is also configured with an energy management system, which manages the plurality of energy management units. The target network management container receives a call request from the target energy management unit, including: The target network management container receives the call request forwarded by the energy management system.
4. The method according to claim 1 or 2, characterized in that, The server is also configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The method further includes: The container adjuster determines a first number of energy management units, which is the sum of the number of energy management units that have completed network configuration with the server and the number of energy management units that are currently connected for the first time; The container adjuster determines a second number of network management containers based on a first number of energy management units and the number of energy management units that a single network management container can manage, so that the number of energy management units that the second number of network management containers can manage is not less than the first number of energy management units; The container adjuster adjusts the number of at least one network management container configured on the server based on a second number of network management containers.
5. The method according to claim 4, characterized in that, Before the container adjuster determines the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage, the method further includes: The container adjuster determines whether the absolute value of the first difference between the first number of energy management units and the third number of energy management units is greater than a preset difference. The third number of energy management units is the sum of the number of energy management units when the number of at least one network management container configured on the server was adjusted in the previous time, the number of energy management units after the server completed network configuration, and the number of energy management units that were first connected. If the container adjuster determines that the absolute value of the first difference is greater than the preset difference, it performs the step of determining the second number of network management containers based on the first number of energy management units and the number of energy management units that a single network management container can manage.
6. The method according to claim 4, characterized in that, The container adjuster adjusts the quantity of at least one network management container configured on the server based on the second quantity of the network management containers, including: If the container adjuster determines that the second number of network management containers is greater than the number of at least one network management containers currently configured on the server, then it adds a network management container of the second difference to the at least one network management container currently configured on the server. The second difference is the absolute value of the difference between the second number of network management containers and the number of network management containers currently included on the server. If the container adjuster determines that the second number of network management containers is less than the number of at least one network management containers currently configured on the server, then deletes the network management containers that represent the second difference from the number of network management containers currently configured on the server.
7. The method according to claim 1, characterized in that, The server is also configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The method further includes: The container adjuster determines the number of energy storage devices corresponding to each energy management unit among the energy management units that have completed network configuration with the server and the energy management units that have connected for the first time; The container adjuster determines a fourth number of network management containers based on the number of energy storage devices corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, as well as the number of energy storage devices corresponding to the energy management units that a single network management container can manage. This ensures that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time to the fourth number of network management containers, the number of energy storage devices corresponding to the energy management units allocated to each network management container is not greater than the number of energy storage devices corresponding to the energy management units that a single network management container can manage. The container adjuster adjusts the number of at least one network management container configured on the server based on the fourth number of network management containers.
8. The method according to claim 1, characterized in that, There are multiple servers, and each server is configured with at least one network management container. These network management containers on the servers are used to manage the energy management units that perform network configuration with the servers. When the target server among the plurality of servers fails, network management is performed on the energy management unit managed by at least one network management container configured in the target server based on the network management containers configured in other servers. The other servers are servers other than the target server among the plurality of servers.
9. A networking method for multiple energy management units, characterized in that, The method is applied to a target energy management unit, which is any one of a plurality of energy management units. The method includes: Send a call request to the server, the call request including the device identifier corresponding to the target energy management unit; In response to receiving first network configuration information from the server, network configuration is performed according to the first network configuration information; The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server. The server is also configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The container adjuster is used to determine the capacity of the energy storage device corresponding to each energy management unit in the energy management unit that has completed network configuration with the server and the energy management unit that has been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage; The container adjuster is used to determine a fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. This ensures that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time to the fifth number of network management containers, the capacity of the energy storage device corresponding to the energy management unit allocated to each network management container is not greater than the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. The container adjuster is used to adjust the number of network management containers configured on the server according to the fifth number of network management containers; The method further includes, before the container adjuster determines the fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. If the container adjuster determines that the total capacity of the energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, and the total capacity of the energy storage devices corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time when the number of network management containers was adjusted, the difference between these two values is greater than a third difference. Then, the fifth step of determining the number of network management containers is executed based on the capacity of the energy storage devices corresponding to each energy management unit that has completed network configuration with the server and the energy management units that have been connected for the first time, and the capacity of the energy storage devices corresponding to the energy management units that a single network management container can manage. Among the plurality of energy management units, a master energy management unit is set up. The configuration information of the master energy management unit stores the IP addresses corresponding to the other energy management units. The configuration information of the other energy management units stores their own configuration information and the IP address of the master energy management unit, so that data forwarding between the master energy management unit and the other energy management units can be realized, but data forwarding between the other energy management units is not possible.
10. A networking device for multiple energy management units, characterized in that, The apparatus is applied to a server, the server being configured with at least one network management container, and the apparatus includes: In response to the target network management container receiving a call request from the target energy management unit through the first receiving unit, the first processing unit is configured to determine whether the target energy management unit is a device accessing the network for the first time based on the call request. The call request includes a device identifier corresponding to the target energy management unit. The target energy management unit is any one of the plurality of energy management units, and the target network management container is any one of the at least one network management container. The first processing unit is further configured to perform network configuration based on the second network configuration information corresponding to the server if the target network management container determines that the target energy management unit is a device accessing for the first time; The first sending unit is configured to send the first network configuration information corresponding to the target energy management unit to the target energy management unit, so that the target energy management unit performs network configuration based on the first network configuration information; The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server; the second network configuration information includes the public key, static tunnel IP address and subnet mask corresponding to the target energy management unit. The server is also configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The container adjuster determines the capacity of the energy storage device corresponding to each energy management unit in the energy management unit that has completed network configuration with the server and the energy management unit that has been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage; The container adjuster determines a fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. This ensures that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time to the fifth number of network management containers, the capacity of the energy storage device corresponding to the energy management unit allocated to each network management container is not greater than the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. The container adjuster adjusts the number of network management containers configured on the server based on the fifth number of network management containers; Specifically, before the container adjuster determines the fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage, if the difference between the total capacity of the energy storage device corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the total capacity of the energy storage device corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, is greater than the third difference, then the step of determining the fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage is executed. Among the plurality of energy management units, a master energy management unit is set up. The configuration information of the master energy management unit stores the IP addresses corresponding to the other energy management units. The configuration information of the other energy management units stores their own configuration information and the IP address of the master energy management unit, so that data forwarding between the master energy management unit and the other energy management units can be realized, but data forwarding between the other energy management units is not possible.
11. A networking device for multiple energy management units, characterized in that, The device is applied to a target energy management unit, which is any one of the plurality of energy management units, and the device includes: The second sending unit is used to send a call request to the server, the call request including the device identifier corresponding to the target energy management unit; In response to the second receiving unit receiving first network configuration information from the server, the second processing unit is configured to perform network configuration based on the first network configuration information; The first network configuration information includes the private key, static tunnel IP address and subnet mask corresponding to the target energy management unit, and the public key, static tunnel IP address and subnet mask corresponding to the server. The server is also configured with a container adjuster, which is used to adjust the number of at least one network management container configured on the server. The container adjuster is used to determine the capacity of the energy storage device corresponding to each energy management unit in the energy management unit that has completed network configuration with the server and the energy management unit that has been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage; The container adjuster is used to determine a fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time, as well as the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. This ensures that after allocating the energy management units that have completed network configuration with the server and the energy management units that have been connected for the first time to the fifth number of network management containers, the capacity of the energy storage device corresponding to the energy management unit allocated to each network management container is not greater than the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage. The container adjuster is used to adjust the number of network management containers configured on the server according to the fifth number of network management containers; Specifically, before the container adjuster determines the fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage, if the difference between the total capacity of the energy storage device corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the total capacity of the energy storage device corresponding to the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, is greater than the third difference, then the step of determining the fifth number of network management containers based on the capacity of the energy storage device corresponding to each energy management unit in the energy management units that have completed network configuration with the server and the energy management units that have been accessed for the first time, and the capacity of the energy storage device corresponding to the energy management unit that a single network management container can manage is executed. Among the plurality of energy management units, a master energy management unit is set up. The configuration information of the master energy management unit stores the IP addresses corresponding to the other energy management units. The configuration information of the other energy management units stores their own configuration information and the IP address of the master energy management unit, so that data forwarding between the master energy management unit and the other energy management units can be realized, but data forwarding between the other energy management units is not possible.
12. An electronic device comprising a processor, a memory, and a computer program stored in the memory, characterized in that, The processor is configured to retrieve the computer program stored in the memory to perform the method as described in any one of claims 1-9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-9.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Remote access management platform and management method
CN116389105A