Power grid distributed photovoltaic system based on Kademlia protocol communication
By adopting a communication mechanism based on the KADEMLIA protocol in the distributed photovoltaic system, the problem of high resources occupied and low efficiency during the grid of the grid in the grid of the grid, and achieved a more efficient and flexible distributed photovoltaic node access.
Patent Information
- Application Number
- CN202411535167.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-31
AI Technical Summary
Existing distributed photovoltaic systems require a large number of recursive operations during the grid connection process, resulting in high system resource occupation, low efficiency and poor network access flexibility.
Adopting a communication mechanism based on the KADEMLIA protocol, through the collaboration of the server and client, the network addition of distributed photovoltaic nodes is achieved, reducing the number of recursive operations, and improving the implementation efficiency and flexibility of the system.
By reducing the number of recursive operations, the time of the addition of nodes to join the network, reducing the occupation of system resources, and improving the flexibility of mesh in the new distributed photovoltaic node and the implementation efficiency of the system.
Smart Images

Figure CN119383131A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power and communication, and in particular to a distributed photovoltaic system of a power grid based on Kademlia protocol communication. Background Art
[0002] Global energy shortage and environmental pollution are becoming increasingly serious. As a safe and clean energy with huge reserves, solar energy is increasingly being utilized, among which photovoltaic power generation is the most mainstream application. Under the strategic influence of my country, distributed photovoltaic development has great potential.
[0003] However, with the continuous expansion of the scale of distributed photovoltaics, new distributed photovoltaics will be connected to the power grid system. Only by ensuring that the new distributed photovoltaics are accurately connected to the power grid system can the safe and efficient operation of the power grid and distributed photovoltaics be guaranteed. In the process of connecting new distributed photovoltaics to the grid, the existing scheme requires a large number of recursive operations to achieve grid connection. This process not only occupies a large amount of system resources and affects the execution efficiency of the system; the process of grid connection operation is also very cumbersome, resulting in poor flexibility in the connection of new distributed photovoltaics to the grid. Summary of the invention
[0004] In view of this, in order to address the above shortcomings, it is necessary to propose a grid-distributed photovoltaic system based on Kademlia protocol communication to improve the execution efficiency and flexibility of the system.
[0005] The present invention provides a distributed photovoltaic system for a power grid based on Kademlia protocol communication, the system comprising: a server and a plurality of clients; each client is configured at each distributed photovoltaic node in the power grid system; The server includes: a message processing module, a first routing table processing module and a resource publishing module; The message processing module is used to process and reply to messages sent by each client; The first routing table processing module is used to store and process node information of each distributed photovoltaic node; The resource publishing module is used to publish and transmit new resources; Any of the clients includes: a second routing table processing module, a network joining module, a self-information updating module and a resource message sending module; The second routing table processing module is used to process the node information where the current distributed photovoltaic is located; The network joining module is used to communicate with the server based on the Kademlia protocol, and based on the principle that a node at a distant distance does not reply to new node information and only adds the node to the K bucket, to achieve network joining of the distributed photovoltaic at the current node; The self-information updating module is used to update the node information of the node where the current distributed photovoltaic is located; The resource message sending module is used to send and download resources.
[0006] Preferably, the first routing table processing module includes 32 K buckets, and the number of nodes stored in each K bucket is unlimited.
[0007] Preferably, the second routing table processing module includes at least one K bucket, and each K bucket stores a maximum of 32 nodes.
[0008] Preferably, when executing the distributed photovoltaic network joining operation at the current A node, the network joining module is configured to perform the following operations: The client of node A communicates with the server; After receiving the message from node A, the server calls the first routing table processing module to calculate information of several online nodes within a first preset range from node A, and sends the information of these online nodes to node A; After receiving the reply from the server, node A sends its own information to each online node; For any online node that receives the information of node A, if the distance between the node and node A is within the second preset range, it selects from its own K bucket several nodes whose distances to node A are within the third preset range and sends the node information to node A; if the distance between the node and node A is not within the second preset range, it only replies confirmation information to node A; When node A no longer receives replies from other nodes, the server declares that the distributed photovoltaic of node A joins the distributed photovoltaic network of the power grid.
[0009] Preferably, when calculating the distance between nodes, if both nodes are nodes in the intranet, the gateway IP address is used to calculate the distance between the two nodes through IP XOR operation; if the IPs of the two nodes are located in different IP segments in the same region, the adjacent nodes are determined through a pre-configured adjacent node mechanism, and the distance between the two nodes is calculated based on the IP XOR operation.
[0010] Preferably, when the IP address of a node changes, the IP address is converted into a hash value through a hash algorithm, and the hash value is used as the unique identifier of the node.
[0011] Preferably, the routing tables in the K buckets in the client and the server are generated using linked lists.
[0012] Preferably, when the A node's own information changes, the own information update module is configured to perform the following operations: Node A sends an update message to the server and its neighbor nodes; For any neighbor node that receives an update message from node A, if the distance between the neighbor node and node A is within the fourth preset range, the neighbor node forwards the update information of node A to several neighbor nodes in its own K bucket; if the distance between the neighbor node and node A is not within the fourth preset range, only a confirmation message is sent to node A.
[0013] Preferably, the resource publishing module is configured to actively publish the corresponding resource of the new resource when the server has a new resource.<key,value> The information is published to each node so that the new resource can be gradually diffused in the network; wherein the key is generated by a hash function and the value is a list of node information containing the new resource.
[0014] Preferably, the resource message sending module is configured to actively send the corresponding resource of the new resource when the node has a new resource.<key,value> The information is published to neighboring nodes so that the new resource is gradually diffused in the network; wherein the key is generated by a hash function and the value is a list of node information containing the new resource; and, The resource message sending module is also configured to, after downloading the new resource, add the node's own information to the value list and publish a new<key,value> information.
[0015] It can be seen from the above technical scheme that the grid distributed photovoltaic system based on Kademlia protocol communication provided by the present invention includes a server and several clients, and each client is configured at each distributed photovoltaic node in the grid system. The server specifically includes a message processing module, a first routing table processing module and a resource publishing module. The message processing module can process and reply to messages sent by each client, the first routing table processing module can store and process the node information of each distributed photovoltaic node, and the resource publishing module can publish and transmit new resources; and the client specifically includes a second routing table processing module, a network joining module, a self-information updating module and a resource message sending module. The second routing table processing module can process the node information where the current distributed photovoltaic is located, the network joining module can communicate with the server based on the Kademlia protocol, and based on the principle that the node at a longer distance does not reply to the new node information, and only adds the node to the K bucket, the network joining of the distributed photovoltaic at the current node is realized, the self-information updating module can update the node information of the current distributed photovoltaic node, and the resource message sending module can send and download resources. It can be seen that this scheme communicates with the server based on the Kademlia protocol through the network joining module, and based on the principle that nodes at a distant distance do not reply to new node information and only add the node to the K bucket, it can reduce the number of recursive operations, which not only shortens the time for nodes to join the network, but also reduces the occupation of system resources, facilitates the access of new distributed photovoltaic nodes to the network, and greatly improves the execution efficiency and flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a grid-distributed photovoltaic system based on Kademlia protocol communication provided by an embodiment of the present invention.
[0017] Figure 2 A flow chart of network joining of a distributed photovoltaic node provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] like Figure 1 As shown, the present invention provides a distributed photovoltaic system for a power grid based on Kademlia protocol communication, the system comprising: a server and a plurality of clients; each client is configured at each distributed photovoltaic node in the power grid system; The server includes: a message processing module, a first routing table processing module and a resource publishing module; Message processing module, used to process and reply to messages sent by each client; A first routing table processing module, used to store and process node information of each distributed photovoltaic node; Resource publishing module, used to publish and transmit new resources; Any client includes: a second routing table processing module, a network joining module, a self-information updating module and a resource message sending module; The second routing table processing module is used to process the node information where the current distributed photovoltaic is located; The network joining module is used to communicate with the server based on the Kademlia protocol and based on the principle that nodes far away do not reply to new node information and only add the node to the K bucket, so as to achieve the network joining of the distributed photovoltaic at the current node; The self-information update module is used to update the node information of the node where the current distributed photovoltaic is located; The resource message sending module is used to send and download resources.
[0020] In this embodiment, the grid distributed photovoltaic system includes a server and a client. The server provides query services to the client. When the node uses the client to intervene in the network, it first communicates with the server to obtain information about several command nodes. The client is the main part of the system, which is used to build a distributed communication network and publish and download resources. Specifically, this scheme communicates with the server based on the Kademlia protocol through the network joining module, and based on the principle that nodes at a longer distance do not reply to new node information, and only add the node to the K bucket, for example, nodes below 24 rows do not reply to new node information. In this way, the number of recursive operations can be reduced, which not only shortens the time for nodes to join the network, but also reduces the occupation of system resources, facilitates the access of each new distributed photovoltaic node to the network, and greatly improves the execution efficiency and flexibility of the system. In this way, the convergence of the network can also be guaranteed, that is, the closer the distance is, the more nodes there are in the routing table, and the farther the distance is, the fewer nodes there are.
[0021] For the server, the functional modules of the server can be divided into a message processing module, a first routing table processing module and a resource publishing module. The message processing module can further include two parts: UDP message processing and TCP message processing, which are used to process and reply to various messages sent by the client. The first routing table processing module is used to store and process node information, which can include 32 K buckets, and the number of nodes stored in each K bucket is unlimited.
[0022] The resource publishing module is used to publish and transmit new resources. For example, it can be configured to actively send the corresponding<key,value> Information is published to each node so that new resources can be gradually spread in the network; the key is generated by a hash function, and the value is a list of node information containing new resources, such as IP, PORT, and ID, where PORT is the listening port for resource downloads.
[0023] For the client, the functional modules of the client can be divided into a second routing table processing module, a network joining module, a self-information updating module and a resource message sending module. The second routing table processing module can process the node information of the node where the current distributed photovoltaic is located, which can specifically include at least one K bucket, and each K bucket can store up to 32 nodes.
[0024] For the K-bucket in the routing table processing module, consider improving Kademlia's K-bucket storage. Specifically, consider not using the K-bucket splitting technology to generate the routing table, but using a linked list. Since the IP XOR algorithm is used to calculate the distance and the IP address length is 32 bits, the routing table only contains 32 table rows. Compared with 160 table rows, 32 table rows occupy much less storage space.
[0025] The network joining module is used to perform the network joining operation of distributed photovoltaic. Figure 2 As shown, for the distributed photovoltaic network joining operation at node A, the network joining module can be configured to perform the following steps: Step S1: The client of node A communicates with the server; Step S2: after receiving the message from node A, the server calls the first routing table processing module to calculate information of several online nodes within a first preset range from node A, and sends the information of these online nodes to node A; Step S3: After receiving the reply from the server, node A sends its own information to each online node; Step S4: For any online node that receives the information of node A, if the distance between the node and node A is within the second preset range, the node information of several nodes whose distances to node A are within the third preset range are selected from its own K bucket and sent to node A; if the distance between the node and node A is not within the second preset range, only the confirmation information is replied to node A; Step S5: When node A no longer receives replies from other nodes, the server declares that the distributed photovoltaic of node A joins the distributed photovoltaic network of the power grid.
[0026] In this embodiment, when node A joins the network, it first communicates with the server. After receiving the message from node A, the server calculates and transmits the information of online nodes that are closer to node A (up to 32). After receiving the reply, node A continues to publish its own information to the replying node. If the node that receives the information finds that it is close to node A, it selects several (up to 32) nodes that are closer to node A from its own K bucket and sends them to node A. If it is far away from node A, it only replies with confirmation information. When node A no longer receives replies from other nodes, the server declares that node A has joined the network. The judgment of farther and closer can be determined by setting a judgment threshold.
[0027] When calculating the distance between nodes, the node IP address can be used for calculation. Specifically, if both nodes are nodes in the intranet, the gateway IP address is used to calculate the distance between the two nodes through IP XOR operation; if the IPs of the two nodes are located in different IP segments in the same region, the adjacent nodes are determined through the pre-configured adjacent node mechanism, and the distance between the two nodes is calculated based on IP XOR operation.
[0028] In this embodiment, since the node IP has obvious regionality, the distance obtained by IP XOR operation is related to the actual distance. In the Internet, nodes with similar IP must be in the same region. For nodes in the intranet, the gateway IP can be used for example measurement; for different IP segments in the same region, a special mechanism can be set to set nodes in different IP segments in the same region as adjacent nodes, so that the node distance can be calculated for adjacent nodes based on IP XOR operation.
[0029] In addition, since the node IP will change, consider converting the IP address into a hash value through a hash algorithm, and using the hash value as the unique identification ID of the node. In this way, when the node IP changes, the node ID can be used to publish an IP update message to ensure the consistency of the node correspondence, thereby ensuring the consistency and accuracy of data interaction.
[0030] The self-information update module is used to update the node information of the node where the distributed photovoltaic is located. For example, when the self-information of node A changes, the self-information update module can be configured to perform the following operations: Node A sends an update message to the server and its neighbor nodes (up to 32); For any neighbor node that receives an update message from node A, if the distance between the neighbor node and node A is within the fourth preset range, the neighbor node forwards the update information of node A to several neighbor nodes in its own K bucket; if the distance between the neighbor node and node A is not within the fourth preset range, only a confirmation message is sent to node A.
[0031] The resource message sending module is used for publishing, transmitting and downloading new resources. Specifically, it can be configured to actively send the corresponding resource of the new resource to the node when the node has a new resource.<key,value> The information is published to neighboring nodes so that the new resource can be gradually diffused in the network. The key is generated by a hash function, and the value is a list of node information containing the new resource. For example, the node information may include IP, PORT, and ID, where PORT is the listening port for resource download. In this way, when a node needs the resource, it can locate the resource download point more quickly.
[0032] The resource message sending module is also configured to add the node's own information to the value list after downloading new resources and publish new<key,value> Information to increase resource download points.
[0033] The present invention also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it runs any of the above-mentioned grid distributed photovoltaic systems based on Kademlia protocol communication.
[0034] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is enabled to run any of the above-mentioned grid-distributed photovoltaic systems based on Kademlia protocol communication.
[0035] Since the device embodiment provided by the present invention is based on the same inventive concept as the system embodiment of this specification, the specific content can be found in the description of the system embodiment of this specification, and will not be repeated here.
[0036] The modules or units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. The above disclosure is only the preferred embodiment of the present invention, and of course it cannot be used to limit the scope of the rights of the present invention. Those skilled in the art can understand that all or part of the processes of the above embodiment are implemented, and the equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A grid distributed photovoltaic system based on Kademlia protocol communication, characterized in that: The system includes: a server and several clients; each client is configured at each distributed photovoltaic node in the power grid system; The server includes: a message processing module, a first routing table processing module and a resource publishing module; The message processing module is used to process and reply to messages sent by each client; The first routing table processing module is used to store and process node information of each distributed photovoltaic node; The resource publishing module is used to publish and transmit new resources; Any of the clients includes: a second routing table processing module, a network joining module, a self-information updating module and a resource message sending module; The second routing table processing module is used to process the node information where the current distributed photovoltaic is located; The network joining module is used to communicate with the server based on the Kademlia protocol, and based on the principle that a node at a distant distance does not reply to new node information and only adds the node to the K bucket, to achieve network joining of the distributed photovoltaic at the current node; The self-information updating module is used to update the node information of the node where the current distributed photovoltaic is located; The resource message sending module is used to send and download resources.
2. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 1, characterized in that: The first routing table processing module includes 32 K buckets, and the number of nodes stored in each K bucket is unlimited.
3. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 1, characterized in that: The second routing table processing module includes at least one K bucket, and each K bucket stores a maximum of 32 nodes.
4. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 1, characterized in that: When executing the distributed photovoltaic network joining operation at the current A node, the network joining module is configured to perform the following operations: The client of node A communicates with the server; After receiving the message from node A, the server calls the first routing table processing module to calculate information of several online nodes within a first preset range from node A, and sends the information of these online nodes to node A; After receiving the reply from the server, node A sends its own information to each online node; For any online node that receives the information of node A, if the distance between the node and node A is within the second preset range, it selects from its own K bucket several nodes whose distances to node A are within the third preset range and sends the node information to node A; if the distance between the node and node A is not within the second preset range, it only replies confirmation information to node A; When node A no longer receives replies from other nodes, the server declares that the distributed photovoltaic of node A joins the distributed photovoltaic network of the power grid.
5. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 4 is characterized in that: When calculating the distance between nodes, if both nodes are nodes in the intranet, the gateway IP address is used to calculate the distance between the two nodes through IP XOR operation; if the IPs of the two nodes are located in different IP segments in the same region, the adjacent nodes are determined through the pre-configured adjacent node mechanism, and the distance between the two nodes is calculated based on the IP XOR operation.
6. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 5, characterized in that: When the IP address of a node changes, the IP address is converted into a hash value through a hash algorithm, and the hash value is used as the unique identifier of the node.
7. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 4, characterized in that: The routing tables in the K buckets on the client and server are generated using linked lists.
8. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 4, characterized in that: When the A node's own information changes, the own information update module is configured to perform the following operations: Node A sends an update message to the server and its neighbor nodes; For any neighbor node that receives an update message from node A, if the distance between the neighbor node and node A is within the fourth preset range, the neighbor node forwards the update information of node A to several neighbor nodes in its own K bucket; if the distance between the neighbor node and node A is not within the fourth preset range, only a confirmation message is sent to node A.
9. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 4, characterized in that: The resource publishing module is configured to actively publish the corresponding resource of the new resource when the server has new resources.<key,value> The information is published to each node so that the new resource can be gradually diffused in the network; wherein the key is generated by a hash function and the value is a list of node information containing the new resource.
10. The grid distributed photovoltaic system based on Kademlia protocol communication according to claim 4, characterized in that: The resource message sending module is configured to actively send the corresponding new resource to the node when the node has new resources.<key,value> The information is published to neighboring nodes so that the new resource is gradually diffused in the network; wherein the key is generated by a hash function and the value is a list of node information containing the new resource; and, The resource message sending module is also configured to, after downloading the new resource, add the node's own information to the value list and publish a new<key,value> information.
Citation Information
Patent Citations
Method, apparatus and system for selecting super node, searching network node or resource
CN101064649A
Autonomous method for peer-to-peer network, node device and system
CN101106503A
Limited decentralized distributed hash table resource searching method in CNFS protocol
CN112256638A
Method for constructing block chain fully-distributed node routing network
CN114363247A
Systems and methods for geographically distributed node replication
US20230336623A1