Disclosure of Invention
In view of this, the present application provides a distributed power generation quality evaluation method and apparatus based on a block chain technology, so as to reduce the risk of data loss, thereby implementing the distributed power generation quality evaluation.
In order to achieve the above object, the following solutions are proposed:
a distributed power generation quality evaluation method based on a block chain technology comprises the following steps:
classifying nodes of a distributed power generation system, the classification of the nodes comprising: the system comprises child nodes, partial nodes and full nodes, wherein a child partition where the partial nodes are located comprises a plurality of child nodes, and a partition where the full nodes are located comprises a plurality of partial nodes;
constructing corresponding distributed power generation internet quality evaluation functions according to different distributed power generation devices;
sending the evaluation function and the internet transaction records of all the child nodes to partial nodes and all complete nodes of the partition to which the child nodes belong;
and generating a partial node block chain at the partial nodes according to the internet transaction records and the evaluation function, and generating a complete node block chain at the complete nodes.
Preferably, the classifying the nodes of the distributed power generation system includes:
dividing all nodes of the distributed power generation system into a plurality of partitions according to regions, and selecting one node from the partitions as a complete node for each partition;
dividing the part of the partition except the complete node into a plurality of sub-partitions, and selecting one node from the sub-partitions as a partial node;
and taking the rest other nodes as the child nodes.
Preferably, the generating a partial node block chain at the partial node and a full node block chain at the full node according to the internet transaction record and the evaluation function includes:
and writing the online transaction record and the evaluation function into a block through a hash algorithm to generate a plurality of blocks according to a preset block generation speed so as to generate the partial node block chain and the complete node block chain.
Preferably, the evaluation function is:
wherein λ is
a,γ,κ,χ
p,χ
qThe weight is represented by a weight that is,
representing the rate of fluctuation, Δ f, of three-phase voltage
iRepresenting the frequency ripple rate, Δ P, of three phases
iRepresenting the active power fluctuation ratio, Δ Q
iWhich represents the rate of fluctuation of the reactive power,
representing the total distortion rate of the harmonics.
A distributed power generation quality evaluation device based on a block chain technology comprises:
the node dividing unit is used for classifying nodes of the distributed power generation system, and the classification of the nodes comprises the following steps: the system comprises child nodes, partial nodes and full nodes, wherein a child partition where the partial nodes are located comprises a plurality of child nodes, and a partition where the full nodes are located comprises a plurality of partial nodes;
the evaluation function building module is used for building corresponding distributed power generation internet quality evaluation functions according to different distributed power generation devices;
the data sending unit is used for sending the evaluation function and the internet transaction records of all the sub-nodes to the partial nodes and all the complete nodes to which the sub-nodes belong;
and the block chain generating unit is used for generating a partial node block chain at the partial node according to the internet transaction record and the evaluation function and generating a complete node block chain at the complete node.
Preferably, the node dividing unit includes:
the complete node selection module is used for dividing all nodes of the distributed power generation system into a plurality of partitions according to areas, and for each partition, selecting one node from the partitions as a complete node;
a partial node selection module, configured to divide a part of the partition excluding the complete node into a plurality of sub-partitions, and select a node from the sub-partitions as a partial node;
and the child node selection module is used for taking the rest other nodes as the child nodes.
Preferably, the block chain generating unit is specifically configured to write the internet transaction record and the evaluation function into a block through a hash algorithm to generate a plurality of blocks according to a preset block generating speed, so as to generate the partial node block chain and the complete node block chain.
Preferably, the evaluation function is:
wherein λ is
a,γ,κ,χ
p,χ
qThe weight is represented by a weight that is,
representing the rate of fluctuation, Δ f, of three-phase voltage
iRepresenting the frequency ripple rate, Δ P, of three phases
iRepresenting the active power fluctuation ratio, Δ Q
iWhich represents the rate of fluctuation of the reactive power,
representing the total distortion rate of the harmonics.
Through the technical scheme, the application discloses a distributed power generation quality evaluation method and device based on a block chain technology. The method comprises the steps of classifying each node of the distributed power generation system, and dividing sub-nodes, partial nodes and complete nodes. And further, sending the online transaction records and the evaluation functions of the sub-nodes to the affiliated partial nodes and all the complete nodes to be stored in a block chain mode. Compared with the prior art, the distributed power generation evaluation function of each node and the transaction information data thereof are sent to partial nodes and all complete nodes of the area where the distributed power generation evaluation function is located, random hashing is carried out on the partial nodes and the complete nodes, time stamps are added to the distributed power generation related data information, block packing is carried out, and block chains of the complete nodes and block chains of the partial nodes are generated respectively. Therefore, the risk of data loss can be reduced, the data can be prevented from being tampered, and the cost of a database framework is saved properly.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flow chart of a distributed power generation quality evaluation method based on a blockchain technique according to an embodiment of the present invention is shown.
As can be seen from fig. 1, the method includes:
s101: the nodes of the distributed power generation system are classified.
Referring to fig. 2, a schematic diagram of node partitioning of a distributed power generation system is shown.
The method comprises the steps of completely dividing all nodes of the distributed power generation system into a plurality of partitions according to regions, selecting a complete node from each partition, removing the complete node from each partition, subdividing the complete node into a plurality of sub-partitions, and finally selecting a partial node from the sub-partitions. As shown in fig. 2, the dotted square is two partitions, and four dotted circles included in each partition are sub-partitions.
S102: and constructing a corresponding distributed power generation network quality evaluation function according to different distributed power generation devices.
The related parameters of the evaluation function comprise three-phase voltage fluctuation rate, three-phase frequency fluctuation rate, active power fluctuation rate, reactive power fluctuation rate and total harmonic distortion rate, and are defined as follows:
the three-phase voltage fluctuation ratio is defined as
Wherein
For the a-phase voltage at node i where distributed generation is located,
rated voltage of a phase of node i for distributed power generation
The frequency fluctuation rate of three-phase electricity is defined as
Wherein f is
iFor the frequency of the node i where the distributed generation is located,
is the rated frequency of the node i where the distributed power generation is located.
The active power fluctuation ratio is defined as
Wherein Δ P
iFor the active power of node i where distributed generation is located,
the rated active power of the node i where the distributed power generation is located.
The reactive power fluctuation ratio is defined as
Wherein Δ Q
iFor the reactive power of node i where the distributed generation is located,
the rated reactive power of the node i where the distributed power generation is located.
The total distortion rate of the harmonic is the sum of the harmonic divided by the fundamental wave, representing the severity of the harmonic, and the formula is
The evaluation function of the node is as follows:
wherein λ isa,γ,κ,χp,χqRepresenting the weight, N representing the time number of the corresponding block, the generation speed of a particular block can be set according to the actual situation, e.g. one block per hour, FiN is the evaluation function value for that time period.
In other embodiments of the present invention, an average evaluation function value of M blocks may be defined to evaluate the power generation quality, where the average evaluation function is:
s103: and sending the evaluation function and the internet transaction records of all the sub-nodes to the partial nodes and all the complete nodes to which the sub-nodes belong.
S104: and generating a partial node block chain at the partial nodes according to the internet transaction records and the evaluation function, and generating a complete node block chain at the complete nodes.
Referring to fig. 3, a block diagram is shown. Each block in the general block chain consists of a block head and a block body, wherein the block head is internally packaged with an address, a timestamp, a hash value and a random number of the previous block, and the block body comprises parameter values and evaluation function values related to the distributed power generation and supply evaluation function in the current block time and other transaction information data. The method comprises the following specific steps:
step one, the distributed generation nodes generate internet surfing transactions, and the distributed generation nodes request timestamp information from a timestamp server.
And step two, storing parameter values, evaluation functions and morning transaction record data related to the distributed power generation and supply evaluation function into a database of the node where the parameter values, the evaluation functions and the morning transaction record data are located.
And step three, sending parameter values and evaluation functions related to the distributed power generation evaluation functions of all the nodes and online transaction records thereof to partial nodes and all complete nodes of the area where the nodes are located, carrying out random hash on the partial nodes and the complete nodes, adding timestamps to distributed power generation related data information, carrying out block packing, and respectively generating block chains of the complete nodes and block chains of the partial nodes. Therefore, the risk of data loss can be reduced, the data can be prevented from being tampered, and the cost of a database framework is saved properly. When all full nodes are corrupted, the stored data of some nodes can be enabled, typically only the data of the full nodes is utilized.
Referring to fig. 4, a schematic structural diagram of a distributed power generation quality evaluation device based on a blockchain technology according to another embodiment of the present invention is shown.
As can be seen from fig. 4, the apparatus includes: a node dividing unit 1, an evaluation function constructing unit 2, a data transmitting unit 3, and a block chain generating unit 4.
Specifically, the node division unit 1 is configured to classify nodes of the distributed power generation system.
The node division unit includes:
the complete node selection module is used for dividing all nodes of the distributed power generation system into a plurality of partitions according to areas, and for each partition, selecting one node from the partitions as a complete node;
a partial node selection module, configured to divide a part of the partition excluding the complete node into a plurality of sub-partitions, and select a node from the sub-partitions as a partial node;
and the child node selection module is used for taking the rest other nodes as the child nodes.
The evaluation function building module 5 is used for building corresponding distributed power generation network quality evaluation functions according to different distributed power generation devices.
The data sending unit 6 is configured to send the evaluation function and the internet transaction records of all the child nodes to the partial nodes and all the complete nodes to which the child nodes belong.
The block chain generating unit 7 is configured to generate a partial node block chain at the partial node according to the internet transaction record and the evaluation function, and generate a complete node block chain at the complete node.
And sending parameter values and evaluation functions related to the distributed power generation evaluation functions of all the nodes and the online transaction records thereof to partial nodes and all complete nodes of the area, randomly hashing the partial nodes and the complete nodes, adding timestamps to distributed power generation related data information, performing block packing, and respectively generating a block chain of the complete nodes and a block chain of the partial nodes.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.