A charging pile subsidy data management method based on blockchain

By adopting a blockchain-based method in the charging pile subsidy data management system, using the JavaEE framework and improved PBFT algorithm, combined with the public-private chain smart contract, the problems of high cost of subsidy data management and low data credibility are solved. , realizes high performance and low latency data management.

CN114036560BActive Publication Date: 2025-02-07STATE GRID HENAN INFORMATION & TELECOMM CO +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111359322.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-12
Publication Date
2025-02-07
Estimated Expiration
2041-11-12

AI Technical Summary

Technical Problem

The existing charging pile subsidy data management system has problems such as high management costs and low data credibility, and the PBFT algorithm is directly applied to blockchain, which has problems such as large network overhead, high latency and performance that need to be improved.

Method used

The blockchain-based charging pile subsidy data management method is adopted, and the data management model is built using the JavaEE framework, the PBFT algorithm is improved as an IPBFT algorithm, and the smart contracts of the public and private chains are combined to protect data, reduce network overhead and delay, and improve system performance.

Benefits of technology

The cost savings and data credibility of charging pile subsidy data management have been achieved, and the system performance is high and the response time is short, effectively protecting data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114036560B_ABST
    Figure CN114036560B_ABST
Patent Text Reader

Abstract

The present invention discloses a charging pile subsidy data management method based on blockchain, and the management method comprises four steps: S1: constructing a charging pile subsidy data management model by using a JavaEE framework, S2: improving the PBFT algorithm from the perspective of improving system performance and response time, S3: using a smart contract combining a public-private chain to protect data, and S4: executing the management method. The management method of the present invention saves a lot of management costs compared to the manual management of charging pile subsidies, and uses blockchain to improve the credibility of charging pile subsidy data. The system has high performance and short response time, and effectively solves the problems of high charging pile subsidy data management cost and low data credibility in the prior art, as well as the problems that the existing PBFT algorithm is not completely applicable to the charging pile subsidy data management based on blockchain, and has large network overhead, high latency, and performance that needs to be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of charging pile subsidy management based on blockchain, and in particular to a charging pile subsidy data management method based on blockchain. Background Art

[0002] Charging pile subsidy data management is an important part of financial management. However, the traditional manual subsidy management of charging piles consumes a lot of manpower and material resources, and also brings large management costs to enterprises. With the rapid development of electronic information and computer technology, the management of charging pile subsidies has gradually shifted from traditional manual operation to computer operation in recent years. The charging pile subsidy management system is widely used for its simplicity and efficiency. However, the current charging pile subsidy management system has some defects. For example, data needs to be backed up frequently to prevent accidents such as missing or even loss of charging pile subsidy information due to data storage omissions. In addition, the rapid development of information technology has also spawned illegal acts such as stealing and tampering with data using technical means, posing a great threat to the credibility and security of charging pile subsidy data.

[0003] In recent years, blockchain, as an emerging data security protection technology, has received more and more attention in the field of improving data credibility due to its decentralized and tamper-proof security features. The consensus mechanism is an important component of blockchain. With the continuous development of blockchain technology, PBFT has attracted the attention of researchers. PBFT is a Practical Byzantine Fault Tolerance (PBFT). PBFT is the abbreviation of Practical Byzantine Fault Tolerance. The PBFT algorithm can effectively reduce resource consumption and improve efficiency. It is suitable for smaller-scale alliance chains and private chain scenarios. However, there are still some shortcomings in directly applying the PBFT algorithm to the blockchain. The PBFT algorithm is not completely suitable for private chain scenarios. The shortcomings of the PBFT algorithm include the following points. First, the working mode of the PBFT algorithm is the request-response mode. The client sends a request to the master node and returns the result to the client after other nodes reach a consensus. Obviously, this mode is not suitable for the blockchain network. Secondly, in the three-stage protocol for reaching consensus, the whole network is broadcasted many times, which consumes a lot of communication resources and reduces system performance. Finally, the checkpoint protocol of the PBFT algorithm requires all nodes to delete logs through periodic timing negotiation, and the network overhead is large. In addition, the fault tolerance of the algorithm is 1 / 3, which is lower than the fault tolerance of 1 / 2 of the mainstream consensus algorithm.

[0004] The existing technology has the problems of high cost of charging pile subsidy data management and low data credibility. In addition, the direct application of the existing PBFT algorithm in the blockchain-based charging pile subsidy data management is not completely applicable. There are problems such as high network overhead, high latency, and performance that needs to be improved.

[0005] Therefore, the present invention provides a new solution to solve this problem. Summary of the invention

[0006] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a charging pile subsidy data management method based on blockchain, which effectively solves the problems of high charging pile subsidy data management cost and low data credibility in the prior art, as well as the problem that the existing PBFT algorithm is directly applied to the charging pile subsidy data management based on blockchain, which is not completely applicable and has the problems of large network overhead, high latency and performance that needs to be improved.

[0007] The technical solution is a charging pile subsidy data management method based on blockchain, which includes four steps:

[0008] S1: Use JavaEE framework to build charging pile subsidy data management model;

[0009] S2: Improve the PBFT algorithm from the perspective of improving system performance and response time;

[0010] S3: Use smart contracts that combine public and private chains to protect data;

[0011] S4: Execution management approach;

[0012] The JavaEE is a new name for J2EE, which stands for Java Enterprise Edition.

[0013] Beneficial effects achieved by the present invention:

[0014] The charging pile subsidy data management method based on blockchain proposed in the present invention saves a lot of management costs compared with the manual management method of charging pile subsidies, and adopts blockchain to improve the credibility of charging pile subsidy data. The system has high performance and short response time. The charging pile subsidy management personnel fill in the charging pile subsidy information and upload necessary related documents. After the management personnel complete the review, the information is uploaded to the MySQL database to realize the storage of charging pile subsidies. The charging pile subsidy management system can realize the electronic access of all the charging pile subsidy contents, including text information and electronic certification documents. In order to protect data security, a charging pile subsidy data protection module is designed and implemented. The data protection module uses an improved PBFT algorithm as the consensus algorithm of the blockchain, which is improved on the basis of the existing PBFT algorithm, namely the IPBFT algorithm, which reduces the phenomenon of large network overhead and high latency caused by repeated confirmation and sending of messages between nodes, ensures the accuracy of the consensus result, effectively saves computing power, improves consensus efficiency, and shortens consensus latency. At the same time, a smart contract data protection scheme combining public chain and private chain is proposed to protect the data security of local database and disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0016] Figure 2 This is a schematic diagram of the charging pile subsidy management module.

[0017] Figure 3 Schematic diagram of the data protection module.

[0018] Figure 4 Schematic diagram of data storage solution.

[0019] Figure 5 This is a schematic diagram of the PBFT algorithm flow.

[0020] Figure 6 This is a schematic diagram of the IPBFT algorithm flow.

[0021] Figure 7 Schematic diagram of the smart contract data protection solution.

[0022] Figure 8 This is a schematic diagram of the system throughput test.

[0023] Fig. 9 This is a schematic diagram comparing the consensus delays of the PBFT algorithm and the IPBFT algorithm. DETAILED DESCRIPTION

[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present invention can be combined with each other. For the above and other technical contents, features and functions of the present invention, the following reference is made to the attached Figure 1-9 It will be clearly presented in the detailed description of the embodiments that the structural contents mentioned in the following embodiments are all referenced to the drawings in the specification.

[0025] The following will describe in detail a charging pile subsidy data management method based on blockchain provided by the present invention through an implementation method with reference to the accompanying drawings.

[0026] A charging pile subsidy data management method based on blockchain, the management method comprises four steps:

[0027] S1: Use JavaEE framework to build charging pile subsidy data management model;

[0028] S2: Improve the PBFT algorithm from the perspective of improving system performance and response time;

[0029] S3: Use smart contracts that combine public and private chains to protect data;

[0030] S4: Execution management approach;

[0031] The JavaEE is a new name for J2EE, which stands for Java Enterprise Edition.

[0032] The step S1: constructing a charging pile subsidy data management model using a JavaEE framework, which specifically includes two parts, namely, constructing a charging pile subsidy management module and constructing a blockchain-based data protection module;

[0033] The JavaEE is a new name for J2EE, which is Java Enterprise Application.

[0034] S1.1: The specific contents of the construction of the charging pile subsidy management module are as follows:

[0035] The charging pile subsidy management module adopts a three-layer logic architecture, namely the user interface layer, the business logic layer and the data interaction layer, to realize the basic logic functions of charging pile subsidy management, such as the attached Figure 2 As shown;

[0036] The user interface layer provides administrators and operators with functional operation entrances to the business logic layer. Administrators and operators have different permissions. Administrators are system maintenance personnel with full system permissions, while operators are charging pile subsidy operators with only charging pile subsidy data management permissions and cannot perform other logical operations except charging pile subsidy data management.

[0037] The business logic layer is the main body of the charging pile subsidy management module, which is provided with three submodules, namely system login, system management and subsidy data management. Except for the subsidy data management submodule, the other two are only open to administrators. The system login submodule realizes user registration, password modification and login verification request submission functions. The system management submodule realizes charging pile subsidy data backup and system recovery functions, as well as all account management functions. The subsidy data management submodule realizes the functions of file creation, entry modification, file verification, query, deletion and certification document management of charging pile subsidy data. Certification document management is the upload and download of electronic certification documents;

[0038] The data interaction layer implements data interaction with the local disk and MySQL database according to the request of the business logic layer, and connects to the blockchain and IPFS through the data protection module calling interface to implement data protection function. The IPFS is an InterPlanetary File System, a distributed file system;

[0039] S1.2: The specific contents of constructing the blockchain-based data protection module are as follows:

[0040] The inherent characteristics of the private chain determine that its operating cost is low, and the characteristic of the private IPFS that limits its own data interaction with the outside world enhances its security performance to a certain extent. Therefore, the blockchain and IPFS built by the present invention both use private solutions. In addition, in view of the shortcomings of the PBFT algorithm, from the perspective of data security and system latency, the present invention proposes an IPBFT algorithm. The IPBFT algorithm is an improved PBFT algorithm, and uses a smart contract data protection solution to achieve system optimization;

[0041] The architecture of the blockchain-based data protection module is shown in the attached Figure 3 As shown, the system application layer provides specific applications of the business logic layer, and the charging pile subsidy management module calls the functions in the business logic layer. The business logic layer designs a specific operation process, and completes the application layer's request through the access operation of the data interaction layer. The data management layer encapsulates the access operations of the blockchain and IPFS for the upper layer to call. The data protection module is developed in Java language. A total of five functions are designed in the business logic layer, namely, add, modify, verify, restore and delete functions. These functions jointly maintain the data in the private blockchain and private IPFS network. In order to protect the security of charging pile subsidy data and files, the data and files are stored in the private IPFS network, and the hash values ​​and IPFS addresses of the data and files are stored in the private blockchain. The private blockchain uses smart contracts to store data and uses the PoA consensus mechanism to reach a consensus; the POA is the abbreviation of Proof of Activity, which is a consensus algorithm for a blockchain.

[0042] The step S2: improving the PBFT algorithm from the perspective of improving system performance and response time, including two parts, namely, establishing a data storage solution and improving the PBFT algorithm to obtain the IPBFT algorithm;

[0043] S2.1: The data storage scheme specifically includes the following contents:

[0044] Since the charging pile subsidy data management system generally runs in the internal network environment of the enterprise and does not directly contact the external network, the focus of data security prevention should be on tampering with data or storing files through system intrusion. For this reason, the data storage of the present invention adopts a combination of private chain and private IPFS network, as shown in the attached Figure 4As shown in the figure, the private IPFS network stores each data record and related files, and the private blockchain stores the hash value and IPFS address of the charging pile subsidy data and the hash value and IPFS address of the file. The hash value is used to verify the data on the server, and the IPFS address is used to download files from the private IPFS network. After using the PoA consensus mechanism, the block packaging speed can also be controlled. IPFS has high access efficiency and is free, which solves the problem of low access efficiency and high cost of blockchain.

[0045] The present invention uses the strong tamper-proof property of blockchain data to ensure data security. Geth is a client program through which users can create accounts, deploy smart contracts and perform other operations. Users can also configure themselves according to usage requirements to create a private chain that meets the developer's requirements. This module uses the PoA consensus mechanism to build a private chain. First, a node account is created through the Geth client, and then a genesis file is generated (through puppeth, a wizard tool for creating a network), then the node is initialized, and finally the node is started and a private chain network is created;

[0046] IPFS is a globally interconnected distributed file system. go-ipfs is a client program developed by the official IPFS organization. The process of building a local private network is as follows: first enable the private module, then create a shared key, then remove the default startup node, and finally add other nodes in the IPFS private cluster;

[0047] S2.2: The specific contents of the improved PBFT algorithm to obtain the IPBFT algorithm are as follows:

[0048] The PBFT algorithm is a consensus algorithm that can be used to design blockchain projects. The algorithm requires all nodes in the decentralized network to communicate with each other and reach consensus after two votes. Therefore, the network scalability is poor and it is mostly used in alliance chains and private chains. The comparison of typical consensus algorithms is shown in Table 1. Compared with the current mainstream Proof of Work (PoW), Proof of Stake (PoS) and Delegated Proof of Stake (DpoS), the PBFT algorithm has the advantages of high throughput, high efficiency and low energy consumption.

[0049] Table 1 Comparison of typical consensus algorithms

[0050]

[0051] The consensus protocol of the PBFT algorithm includes five stages: request, sequence number allocation (pre-prepare), interaction (prepare), sequence number confirmation (commit) and response (reply). The three stages in the middle are the main stages. The PBFT algorithm process is as follows:

[0052] A1: Request: Client C sends a request to the master node 0 to start the service of the node;

[0053] A2: Sequence number allocation (pre-prepare): After the master node 0 receives the request from the client C, it assigns a number to the message and then broadcasts the message to all the slave nodes;

[0054] A3: Interaction (prepare): When receiving the message sent in the sequence number allocation phase, the slave node will verify it. If the verification passes, it will enter the sequence number confirmation phase. Otherwise, it will do nothing. After entering the preparation phase, the node will forward this message to other service nodes and write both the pre-prepare message and the preparation message into the message log. When 2f preparation messages consistent with the pre-prepare message are detected, this phase is completed;

[0055] A4: Sequence number confirmation (commit): The node sends a confirmation message to all nodes. The confirmation phase is completed when the node has received 2f confirmation messages that are the same as the pre-prepared message;

[0056] A5: Response (reply): The client counts the response messages from different service nodes. When it receives the same response from f+1 different nodes, it confirms that the request is executed successfully. Figure 5 The PBFT algorithm process is shown, where C is the client, 0 is the master node, 1 and 2 are slave nodes, and 3 is the failed node;

[0057] The PBFT algorithm is widely used in distributed systems and has the advantages of high efficiency, high throughput and energy saving, but it also has the problem of extended response time and mismatch with the blockchain environment. As for the PBFT algorithm used in the present invention, the existing problems and solutions are shown in Table 2;

[0058] Table 2 Problems and solutions of the present invention using the PBFT algorithm directly

[0059]

[0060] The improved PBFT algorithm, namely the IPBFT algorithm, has the following process:

[0061] B1: Initiate broadcasting. The master node collects requests within a period of time and sends them to all slave nodes with consensus authority, which is to initiate a consensus proposal.

[0062] B2: Proposal verification, that is, the slave nodes participating in the consensus verify the consensus proposal of the master node. If the verification is successful, the slave node will confirm the consensus information to the master node, otherwise the view will be changed;

[0063] B3: After the master node and the slave node reach a consensus, the master node broadcasts a consensus confirmation message, publishes the charging pile subsidy data to the block and joins the block. The condition for reaching consensus in the network is that the master node receives at least 2f identical consensus messages broadcast from other participating consensus nodes. After the node adds the block to the blockchain it maintains, it deletes the request information in the log according to the checkpoint protocol and starts the next round of consensus.

[0064] The step S3: using a smart contract combining public and private chains to protect data specifically includes the following contents:

[0065] After completing the private chain and private IPFS network, it is necessary to deploy smart contracts. The language used is Solidity, and the development tool is Remix online development tool, which is based on a web browser and is convenient for users to write contract codes. The present invention implements the data addition, modification, verification and recovery functions of the module through smart contracts. Since the security margin of the proposed IPBFT algorithm is reduced to 1 / 3, in order to ensure the authenticity of the data on the private chain, the public chain regularly checks and stores the height and hash value of the latest block of the private chain. The smart contract data protection scheme is as shown in the attached Figure 7 As shown;

[0066] In order to store information such as the height and hash value of the private chain block and realize the protection of the private chain, the present invention runs a private chain protection contract on the basis of the public chain smart contract to realize data protection. The private chain protection contract is represented by PCPC, which is the abbreviation of Private Chain Protection Contract. The id, number, digital fingerprint of the information and IPFS address of each record, the digital fingerprint and IPFS address of the file are stored in the information storage contract ISC, which is the abbreviation of InformationStorage Contract. Among them, the digital fingerprint verifies the consistency of the local data of the system and the data on the chain. The IPFS address is used for IPFS file downloads. The self-protection contract SPC is connected to the PCPC contract on the public chain at a certain period to realize data interaction, and the number of contract writes is counted at the same time; the SPC is the abbreviation of Self Protection Contract, which means a self-protection contract;

[0067] The charging pile subsidy data operation process is briefly described as follows:

[0068] C1: When it is necessary to add charging pile subsidy data, obtain the charging pile subsidy data from the charging pile subsidy management module and store it in the space corresponding to the IPFS module, and synchronously generate the IPFS address corresponding to the charging pile subsidy data. Then, store the IPFS address generated by the IPFS module and the digital fingerprint (hash value) of the charging pile subsidy data into the self-protection contract SPC pre-written in the ISC module, and realize data interaction with the private chain protection contract, and store the hash in the contract; the hash refers to the hash;

[0069] C2: When the charging pile subsidy data needs to be verified, the local charging pile subsidy data digital fingerprint (hash value) is calculated from the charging pile subsidy management module, and the digital fingerprint (hash value) corresponding to the same charging pile subsidy data is queried from the ISC module. By comparing the two, it can be determined whether the local charging pile subsidy data has been tampered with;

[0070] C3: When the charging pile subsidy data needs to be modified or restored, obtain the IPFS address of the charging pile subsidy data to be modified or restored from the ISC module, find the private IPFS cluster where the charging pile subsidy data to be modified or restored is stored according to the address, download the charging pile subsidy data to be modified or restored, and then carry out the modification or restoration operation as required.

[0071] The step S4: executing the management method is to conduct an experimental test on the system, and the specific contents are as follows:

[0072] The system was tested from the perspective of performance, and then the algorithm was tested from the perspective of fault tolerance and delay to verify the availability of the combination of the IPBFT algorithm and the charging pile subsidy management system. The test selected 6 computers with the same configuration in the same LAN in the laboratory as the test environment. The computer configuration is: the processor model is Intel (R) Core i7 7700k CPU, the main frequency is 4.2GHz, the memory size is 8GB, the operating system is Windows 10, and the JDK version is 1.8;

[0073] In order to verify the system's ability to cope with a large number of sudden data requests, the Apache JMeter stress test tool is used to test the system's throughput. The throughput refers to the number of transactions per second, which reflects the system's ability to handle transactions. The test method is to simulate the scenario of many users logging into the system at the same time by using multi-threaded simultaneous requests, and then obtain the throughput test value. According to the actual application scenario, 200, 300 and 400 virtual users are set to test the system, the number of cycles is 1, and the thread startup time is 1s. The test results are shown in the attached figure. Figure 8 As shown, in all tests, the error rate was 0.00%;

[0074] Fault tolerance refers to the ability of a system to operate without abnormality when some nodes fail or errors occur without seriously affecting system performance. It is one of the important indicators for testing the stability of a distributed system. The IPBFT algorithm designed in the present invention allows a maximum of 1 / 3 of the nodes to fail. In order to test the fault tolerance of the system, the number of failed nodes is increased in sequence. The test results are shown in Table 3.

[0075] Table 3 Fault tolerance test

[0076]

[0077] The results show that when the number of failed nodes is 2, which is 1 / 3 of the total number of nodes, the blockchain network runs normally. If it continues to increase, it will cause abnormal operation. It can be obtained that the maximum number of failed nodes that the network can tolerate is 1 / 3 of the total number of nodes, which proves that the IPBFT algorithm meets the fault tolerance requirements.

[0078] Since the PoW consensus mechanism of the PBFT algorithm has the problems of high bandwidth occupancy and high network overhead during operation, it will cause the system to run slowly when the system faces a large number of data access requirements. The present invention improves the existing PBFT algorithm, namely the IPBFT algorithm. First, a master node and several slave nodes are set, and some nodes are selected from the slave nodes as consensus nodes. Different from the PBFT algorithm in which the master node broadcasts data to all nodes, the master node in the IPBFT algorithm only broadcasts the consensus request data to the nodes with consensus authority. The nodes participating in the consensus complete the verification of the consensus data based on the local block information, and only return the verification result to the master node, which is different from the PBFT algorithm in which the verification result is sent to each node for confirmation. This greatly reduces the phenomenon of high network overhead and high latency caused by repeated confirmation and sending of messages between nodes, while ensuring the accuracy of the consensus result, effectively saving computing power, improving consensus efficiency, and shortening consensus latency. In order to test the shortened consensus latency effect, the present invention selects different numbers of consensus nodes to test the system latency. In order to avoid contingency, all tests are performed multiple times, and the results of multiple tests are averaged. The results are shown in the attached figure. Fig. 9 As shown, Fig. 9 In the figure, the latency of PBFT and IPBFT algorithms is compared when there are 4 nodes, 5 nodes and 6 nodes respectively. The comparison results show that IPBFT algorithm is better than PBFT algorithm.

[0079] The present invention described above in combination with the accompanying drawings is used in a specific application. A charging pile subsidy data management method based on blockchain comprises four steps:

[0080] S1: Use JavaEE framework to build charging pile subsidy data management model;

[0081] S2: Improve the PBFT algorithm from the perspective of improving system performance and response time;

[0082] S3: Use smart contracts that combine public and private chains to protect data;

[0083] S4: Execution management approach;

[0084] Beneficial effects achieved by the present invention:

[0085] 1. The charging pile subsidy data management method based on blockchain proposed in the present invention saves a lot of management costs compared with the manual management method of charging pile subsidies, and uses blockchain to improve the credibility of charging pile subsidy data, with high system performance and short response time;

[0086] 2. The charging pile subsidy management personnel fill in the charging pile subsidy information and upload the necessary relevant documents. After the management personnel complete the review, the information will be uploaded to the MySQL database to realize the storage of charging pile subsidies. The charging pile subsidy management system can realize the electronic storage and access of all the charging pile subsidy contents, including text information and electronic certification documents;

[0087] 3. In order to protect data security, a charging pile subsidy data protection module was designed and implemented. The data protection module uses the improved PBFT algorithm as the consensus algorithm of the blockchain. It is improved on the basis of the existing PBFT algorithm, namely the IPBFT algorithm. First, a master node and several slave nodes are set up, and some nodes are selected from the slave nodes as consensus nodes. Different from the PBFT algorithm in which the master node broadcasts data to all nodes, the master node in the IPBFT algorithm only broadcasts the consensus request data to the nodes with consensus authority. The nodes participating in the consensus complete the verification of the consensus data based on the local block information and only return the verification results to the master node, which is different from the PBFT algorithm that sends confirmation to each node. This greatly reduces the phenomenon of repeated confirmation and sending messages between nodes, resulting in large network overhead and high latency. While ensuring the accuracy of the consensus results, it effectively saves computing power, improves consensus efficiency, and shortens consensus latency;

[0088] 4. Propose a smart contract data protection solution that combines public and private chains to protect the data security of local databases and disks;

[0089] The blockchain-based charging pile subsidy data management method proposed in the present invention effectively solves the problems of high charging pile subsidy data management cost and low data credibility in the prior art, and directly applies the existing PBFT algorithm to the blockchain-based charging pile subsidy data management, which is not completely applicable and has the problems of large network overhead, high latency and performance that needs to be improved.

Claims

1. A charging pile subsidy data management method based on blockchain, characterized in that: The management method comprises four steps: S1: Use JavaEE framework to build charging pile subsidy data management model; S2: Improve the PBFT algorithm from the perspective of improving system performance and response time; S3: Use smart contracts that combine public and private chains to protect data; S4: Execution management approach; The JavaEE is a new name for J2EE, which is Java Enterprise Application. The PBFT is the abbreviation of Practical Byzantine Fault Tolerance, which is a practical Byzantine fault tolerance algorithm; The step S1: constructing a charging pile subsidy data management model using a JavaEE framework, which specifically includes two parts, namely, constructing a charging pile subsidy management module and constructing a blockchain-based data protection module; S1.1: The specific contents of the construction of the charging pile subsidy management module are as follows: The charging pile subsidy management module adopts a three-layer logic architecture, namely the user interface layer, the business logic layer and the data interaction layer; The user interface layer provides administrators and operators with functional operation entrances to the business logic layer. Administrators and operators have different permissions. Administrators are system maintenance personnel with full system permissions, while operators are charging pile subsidy operators with only charging pile subsidy data management permissions and cannot perform other logical operations except charging pile subsidy data management. The business logic layer is the main body of the charging pile subsidy management module, which is provided with three submodules, namely system login, system management and subsidy data management. Except for the subsidy data management submodule, the other two are only open to administrators. The system login submodule has the functions of user registration, password modification and login verification request submission. The system management submodule has the functions of charging pile subsidy data backup and system recovery, as well as all account management functions. The subsidy data management submodule has the functions of file creation, entry modification, file verification, query, deletion and certification document management of charging pile subsidy data. Certification document management is the upload and download of electronic certification documents; The data interaction layer implements data interaction with the local disk and MySQL database according to the request of the business logic layer, and connects to the blockchain and IPFS through the data protection module calling interface. The IPFS is an InterPlanetary FileSystem, a distributed file system; S1.2: The specific contents of constructing the blockchain-based data protection module are as follows: In the architecture of the blockchain-based data protection module, the system application layer provides specific applications of the business logic layer, and the charging pile subsidy management module calls the functions in the business logic layer. The business logic layer designs specific operation procedures, completes the application layer's request through access operations on the data interaction layer, and the data management layer encapsulates the access operations of the blockchain and IPFS for the upper layer to call. The data protection module is developed in Java language. A total of five functions are designed in the business logic layer, namely, add, modify, verify, restore and delete functions. These functions jointly maintain the data in the private blockchain and private IPFS network, store data and files in the private IPFS network, and store the hash values ​​and IPFS addresses of the data and files in the private blockchain. The private blockchain uses smart contracts to store data and uses the PoA consensus mechanism to reach consensus; the PoA is the abbreviation of Proof of Activity, which is a consensus algorithm for a blockchain; The step S2: improving the PBFT algorithm from the perspective of improving system performance and response time, including two parts, namely, establishing a data storage solution and improving the PBFT algorithm to obtain the IPBFT algorithm; S2.1: The data storage scheme specifically includes the following contents: The data storage solution adopts a combination of private chain and private IPFS network. The private IPFS network stores each data record and related files. The private blockchain stores the hash value and IPFS address of the charging pile subsidy data and the hash value and IPFS address of the file. The hash value verifies the data on the server. The IPFS address can be used to download files from the private IPFS network. The PoA consensus mechanism is used to control the block packaging speed. Geth is a client program that uses the PoA consensus mechanism to build a private chain. First, create a node account through the Geth client, then generate a genesis file, then initialize the node, and finally start the node and create a private chain network; IPFS is a globally interconnected distributed file system. go-ipfs is a client program developed by the official IPFS organization. The process of building a local private network is as follows: first enable the private module, then create a shared secret key, then remove the default startup node, and finally add other nodes in the IPFS private cluster; S2.2: The improved PBFT algorithm is obtained to obtain the IPBFT algorithm. The IPBFT algorithm process is as follows: B1: Initiate broadcasting. The master node collects requests within a period of time and sends them to all slave nodes with consensus authority, which is to initiate a consensus proposal. B2: Proposal verification, that is, the slave nodes participating in the consensus verify the consensus proposal of the master node. If the verification is successful, the slave node will confirm the consensus information to the master node, otherwise the view will be changed; B3: After the master node and the slave node reach a consensus, the master node publishes the charging pile subsidy data to the block and joins the block. The condition for reaching consensus in the network is that the master node receives at least 2f identical consensus messages broadcasted by other participating consensus nodes. After the node adds the block to the blockchain it maintains, it deletes the request information in the log according to the checkpoint protocol and starts the next round of consensus. The step S3: using a smart contract combining public and private chains to protect data specifically includes the following contents: Deploy smart contracts using Solidity, the Remix online development tool, and a web browser. Use smart contracts to add, modify, verify, and restore data. A private chain protection contract is run on the basis of the public chain's smart contract. The private chain protection contract is represented by PCPC, which is the abbreviation of Private Chain Protection Contract. The id, number, digital fingerprint of the information and IPFS address of each record, the digital fingerprint of the file and the IPFS address are stored in the information storage contract ISC, which is the abbreviation of InformationStorage Contract. The digital fingerprint verifies the consistency of the local data of the system and the data on the chain, and uses the IPFS address to download the IPFS file. The self-protection contract SPC is used to connect to the PCPC contract on the public chain at a certain period, and the number of contract writes is counted at the same time; the SPC is the abbreviation of Self Protection Contract, which means self-protection contract; The charging pile subsidy data operation process is as follows: C1: When it is necessary to add charging pile subsidy data, obtain the charging pile subsidy data from the charging pile subsidy management module and store it in the space corresponding to the IPFS module, and synchronously generate the IPFS address corresponding to the charging pile subsidy data. Then, store the IPFS address generated by the IPFS module and the digital fingerprint of the charging pile subsidy data into the self-protection contract SPC pre-written in the ISC module, and interact with the private chain protection contract to store the hash in the contract; the hash refers to the hash; C2: When the charging pile subsidy data needs to be verified, the digital fingerprint of the local charging pile subsidy data is calculated from the charging pile subsidy management module, and the digital fingerprint corresponding to the same charging pile subsidy data is queried from the ISC module. By comparing the two, it can be determined whether the local charging pile subsidy data has been tampered with; C3: When the charging pile subsidy data needs to be modified or restored, obtain the IPFS address of the charging pile subsidy data to be modified or restored from the ISC module, find the private IPFS cluster where the charging pile subsidy data to be modified or restored is stored according to the address, download the charging pile subsidy data to be modified or restored, and then carry out the modification or restoration operation as required.

2. A charging pile subsidy data management method based on blockchain as claimed in claim 1, characterized in that: The step S4: executing the management method is to conduct experimental testing on the system. The test selects 6 computers with the same configuration in the same local area network in the laboratory as the test environment, and performs fault tolerance test, system throughput test, PBFT algorithm and IPBFT algorithm consensus delay test.

Citation Information

Patent Citations

  • Data storage data processing method based on block chain

    CN110334053A

  • Virtual reality content distributed management method and system based on integral excitation

    CN113098941A