Blockchain-based privacy data encryption access method and system for communities
By adopting the private data encryption access method of blockchain technology in community data management, data security and privacy issues are solved, distributed storage and transparent management of data are realized, the risk of user data leakage is reduced, and a reliable system is established. trustworthy data circulation environment.
Patent Information
- Application Number
- CN202010938232.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-09-09
AI Technical Summary
There are data security and privacy issues in community data management. Especially under centralized data storage, the risk of user data leakage is high and trust issues are serious. Users lack transparency in the data storage and processing process, making data collection difficult.
Adopt private data encrypted access methods and systems based on blockchain technology, realize distributed storage and encrypted access of data by registering terminal nodes, storage nodes, user nodes and management nodes, and use consensus nodes for data upload, access and operation. Consensus process to ensure data traceability and privacy.
It improves the security of data storage, reduces the risk of single-point attacks, ensures that data can only be accessed by authorized personnel, achieves transparent management of data and user trust, and establishes a trusted data circulation environment between community residents and management agencies.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data security and emergency management, and in particular, relates to a method and system for encrypted access to privacy data based on blockchain technology for a community. Background Art
[0002] Current community management relies heavily on various types of data, which mainly come from the following sources: (1) manual collection by community managers; (2) active reporting by community residents; (3) passive collection by various electronic devices such as electronic monitoring and water and electricity sensors. At the same time, in the construction of future smart communities, a large number of IoT devices will be widely used in the community, and a large amount of data will be generated. In addition, in the event of an emergency, such as during an epidemic, the amount of data and data demand in the community will surge. The huge amount of data support facilitates daily community management and provides decision-making support for community emergency management, but it also brings many data security risks. How to safely and efficiently manage these multi-source heterogeneous data has become an important research topic in the field of data security and community emergency management.
[0003] The big data platform provides a solution for data integration and fusion. All kinds of data are connected to the same platform and managed in a unified manner. The security of the data mainly depends on the security of the database built, and the privacy of the data depends on the encryption method used in the data collection and storage process. When centralized data storage is attacked by a network attack, the risk of data leakage is much higher than that of distributed data storage. At the same time, the smart community big data platform will also carry a large number of IoT devices. Once the main node is attacked, the IoT devices connected to it will also be exposed to network attacks, which poses a great challenge to the security and privacy of the data. Data centralization will also cause trust issues. After user data is actively reported or passively collected, users will no longer have control over their own data, which is mainly reflected in the following aspects: (1) users do not know where the data is stored and where it goes; (2) users do not know how the data will be analyzed and processed; (3) users do not know who will access and operate the data. On the other hand, the data manager has almost unlimited rights and can do anything with the data. However, there are many management loopholes in the collection, sharing, storage, and analysis process, such as not restricting data access rights and not performing personal information de-identification processing, which can easily lead to privacy leakage. These concerns have also made people unwilling to actively cooperate or disclose too much personal information during the data collection process, causing difficulties in data collection. Therefore, it is necessary to find a data encryption method that can balance the security and privacy of data while meeting the data collection needs of the management party and solve the user's trust problem.
[0004] After technical retrieval and research, blockchain-related technologies can effectively meet the above needs. Its distributed data structure can solve the vulnerability problem of a single node and improve the robustness of the system; smart contracts and chain code technology can realize the automation of data access and reduce the repetitive and tedious workload of manual review; in addition, the chain-like characteristics of blockchain make data operations traceable, ensuring that data is not tampered with at will, and users can also know the whereabouts of their own data. In the current method and technology research results, no blockchain-based privacy data encryption access methods and technologies for the community were found. Summary of the invention
[0005] The purpose of this invention is to propose a method and system for encrypted access to privacy data based on blockchain technology for the community, so as to solve the security and privacy issues in community data management and establish a data circulation environment of mutual trust between community management departments and community residents.
[0006] The method for encrypted access to private data based on blockchain technology for a community proposed in the present invention comprises the following steps:
[0007] (1) Community managers register data collection terminals in the community as terminal nodes in the community network, register databases in the community as storage nodes in the community network, register community residents as user nodes in the community network, and register community managers as management nodes in the community network. They also assign a unique identifier, “node ID”, to the terminal nodes, storage nodes, user nodes, and management nodes, respectively. They assign data access rights to user nodes to limit the data content that user nodes are allowed to access, and assign data operation rights to management nodes to limit the data content that management nodes are allowed to operate.
[0008] (2) The management node periodically randomly selects some user nodes and management nodes from the multiple user nodes and multiple management nodes in step (1), and registers these user nodes and management nodes as consensus nodes. At the same time, the community administrator periodically randomly selects some consensus nodes from the registered consensus nodes and cancels the consensus node identities of these consensus nodes.
[0009] (3) The terminal nodes collect various types of data in the community network and upload the data to the storage nodes;
[0010] (4) User nodes access data in storage nodes according to their own needs, and management nodes operate on data in storage nodes according to the needs of user nodes themselves;
[0011] (5) The consensus nodes conduct a consensus process on the data upload, access, and operation records generated in steps (3) and (4).
[0012] In step (1) of the above-mentioned privacy data access method, the terminal nodes include: community monitoring cameras, water meters, electricity meters, gas meters, smoke alarms, Internet of Things devices, managers in the community and community residents.
[0013] In step (1) of the above-mentioned private data access method, the storage node includes:
[0014] (1) A surveillance video database, which is used to store video data and image data captured by surveillance cameras in the community;
[0015] (2) Static database, which is used to store various static data in the community, including building and road information, water, electricity, and gas pipeline line information;
[0016] (3) Sensor database, which is used to store real-time data from various sensors deployed in the community, including data recorded by water meters, electricity meters, and gas meters;
[0017] (4) Community resident database, which is used to store data related to community residents, including name, gender, age, ID number, address, contact information, and health status;
[0018] (5) IoT device database, used to store data from IoT devices deployed in the community, including data collected by smart access control and security robots;
[0019] In step (3) of the above private data access method, the data uploading process is:
[0020] (1) The terminal node uploads the data collected by the surveillance camera to the surveillance video database in the storage node, uploads the data recorded by the water meter, electricity meter, and gas meter to the sensor database in the storage node, uploads the building road information and water, electricity, and gas pipeline line information collected by the community management personnel to the static database in the storage node, uploads the personal information actively reported by the residents to the community resident database in the storage node, and uploads the data collected by the IoT device to the IoT device database in the storage node;
[0021] (2) The storage node saves the data uploaded by the terminal node and regularly generates a data upload log, which includes "terminal node ID", "upload time", "storage address" and "data tag", and sends the generated data upload log to the server;
[0022] (3) After receiving the data upload log, the server stores the data upload log in the log pool in the data manager of the server.
[0023] In step (4) of the above-mentioned private data access method, the process of the user node accessing the data in the storage node is as follows:
[0024] (1) The user node fills in the data access requirements on the mobile terminal, including: data type, data content and access purpose;
[0025] (2) The mobile terminal generates a pair of keys for the user node. The private key in the key pair is kept by the user node. The mobile terminal sends the public key in the key pair together with the data access requirements filled in by the user node to the server.
[0026] (3) After receiving the user's data access request, the server determines whether the user node has the right to access the data content requested by the user node based on the specified access rights of the user node. If the user node does not have such permission, a "no access" message notification is sent to the user node's mobile terminal. If the user node meets the permission requirements, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the user node's mobile terminal.
[0027] (4) The server generates a data access log, the content of which includes "access user node ID", "access time", "access content" and "access purpose", and stores the generated data access log in the log pool in the data manager on the server;
[0028] (5) The user node enters the private key on the mobile program, decrypts the received encrypted data, and views the data content.
[0029] In step (4) of the above-mentioned privacy data access method, the process of the management node operating the data in the storage node is as follows:
[0030] (1) The management node submits data operation instructions on the server side and selects the data to be operated;
[0031] (2) The server determines whether the management node has the right to operate the data content requested by the management node based on the data operation authority of the management node. If the management node does not have such authority, the server sends a message notification of "no authority to operate" to the management node; if the management node meets the authority, the server retrieves the data content requested by the management node from the storage node and temporarily stores the retrieved data content on the server. The management node then views or modifies the data on the server;
[0032] (3) The server saves the data modified by the management node in step (2) to the storage node, and generates a data operation log, which includes "management node ID", "operation time", "operation data label" and "operation content summary", and stores the generated data operation log in the log pool in the server-side data manager.
[0033] In step (5) of the above private data access method, the consensus process performed by the consensus node is:
[0034] (1) When the number of log files in the log pool of the data manager on the server reaches the set number, all log files in the log pool are sent to all consensus nodes in the community network;
[0035] (2) After receiving the log file, the consensus node saves the log file in the log pool of the consensus node, randomly extracts some log files from the log pool of the consensus node, and generates the root hash value Hash_root for the log file according to the Merkle tree structure;
[0036] (3) The consensus node obtains the hash value Hash_pre of the previous block. The previous block is the block generated in the previous round of consensus. If the previous block does not exist, Hash_pre is set to 0.
[0037] (4) Select a random number Nonce, and combine the random number Nonce with the "log tree root hash value Hash_root", "previous block hash value Hash_pre", and "block generation time ts" to form a block header. Use the hash algorithm to calculate the hash value Hash_block of the block header, and compare the hash value Hash_block of the block header with a specified large integer Num. Num can be a 256-bit large integer. If the hash value Hash_block of the block header is greater than the large integer Num, select a new random number and repeat step (4) until the hash value Hash_block of the block header is less than or equal to the large integer Num.
[0038] (5) The consensus node packages the block header generated in step (4) and part of the log file extracted in step (2) into a block. The block header hash value Hash_block becomes the hash value of this block, and the block is sent to all other consensus nodes in the community network;
[0039] (6) After receiving the block in step (5), other consensus nodes verify the validity of the block, including: verifying whether the hash value of the block is less than the specified large integer, and whether the log file contains a hash value that matches the log tree root. When the hash value of the block being verified is less than the specified large integer, and the log file contains a hash value that matches the log tree root, the verification is passed;
[0040] (7) After the block verification is passed, the consensus node adds the block to the blockchain file of this consensus node, ending this round of consensus.
[0041] The privacy data access system based on blockchain technology for the community proposed in the present invention includes a community network, a server end and a mobile end, wherein:
[0042] The community network is composed of various nodes in the community and the network relationships between the nodes. The nodes include:
[0043] Terminal nodes include community surveillance cameras, water meters, electricity meters, gas meters, smoke alarms, IoT devices, community managers and community residents for data collection; storage nodes include surveillance video databases, static databases, sensor databases, community resident databases and IoT device databases for data storage; user nodes are registered by community residents; management nodes are composed of community managers; consensus nodes are composed of a part of nodes randomly extracted from user nodes and management nodes for data consensus process; the network relationship between nodes is as follows: surveillance camera terminal nodes establish a network relationship with surveillance video database storage nodes through network cables; IoT device terminal nodes establish a wireless network relationship with IoT database storage nodes through 4G / 5G signals; water meters, electricity meters, gas meters and smoke alarm terminal nodes are connected to signal processing terminals through signal lines, and then establish a network relationship with sensor databases through network cables or wireless networks; all storage nodes establish a network connection with the server where the community data management system is deployed through network cables; community residents or community managers establish a network connection with the server where the community data management system is deployed through mobile devices;
[0044] The mobile terminal is used to provide a way for user nodes to access community data. The user node fills in the data access request including "data type", "data content" and "access purpose" in the community data access program installed on the mobile terminal. The community data access program will generate a pair of keys for the user. The private key in the key pair is kept by the user. The private key will be packaged with the data access request filled in by the user node and sent to the server. After receiving the user's data access request, the server determines whether the user node has the right to access the data content requested by the user node based on the user node's access rights. If there is no such permission, a "no access" message notification is sent to the user node's mobile terminal; if the user node meets the permission, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the user node's mobile terminal; the server generates a data access log, the log content includes "access user node ID", "access time", "access content" and "access purpose", and stores the generated data access in the log pool in the data manager on the server; the user node enters the private key on the mobile terminal program, decrypts the received encrypted data, and views the data content;
[0045] The server side is used to manage nodes in the community network. In the community data management program deployed on the server side, the community manager registers the data collection terminal in the community as the terminal node in the community network, registers the database in the community as the storage node in the community network, registers the community residents as the user nodes in the community network, and registers the community manager as the management node in the community network. A unique identifier "node ID" is assigned to the terminal node, storage node, user node and management node respectively, and data access rights are assigned to the user node to limit the data content that the user node is allowed to access, and data operation rights are assigned to the management node to limit the data content that the management node is allowed to operate. The server side provides a way for the management node to operate the storage node data. The management node submits the data operation instructions on the server side and selects the data to be operated. The server side determines whether the management node has the right to operate the data content requested by the management node based on the data operation rights of the management node. If there is no such right, the server side sends a "no right to operate" message notification to the management node. If the management node meets the authority, the data content requested by the management node to access is retrieved in the storage node, and the retrieved data content is temporarily stored on the server side. The management node views or modifies this part of the data on the server side. The server saves the modified data of the management node to the storage node, and generates a data operation log. The log content includes "management node ID", "operation time", "operation data label", and "operation content summary". The generated data operation log is stored in the log pool in the data manager on the server.
[0046] The method and system for encrypted access to private data based on blockchain technology for a community proposed in the present invention have the following advantages:
[0047] The privacy data encryption access method and system based on blockchain technology of the present invention registers community residents, managers, data acquisition terminal devices, and databases in the community as nodes in the community network, so that the data upload, storage, access, and operation processes can be associated with the corresponding devices or people, thereby realizing the traceability of data upload, easy retrieval of data storage, and traces of data access and operation. The method of the present invention uses a distributed data storage solution instead of a centralized data storage solution to improve the security of data storage, reduce the risk of a single node being attacked and leaking a large number of numbers, and also improve the compatibility of the system with different databases. The method uses key pair encryption technology in the data access process, so that the data can only be accessed by designated people, and the privacy of the data is maintained. The log records generated during the data upload, access, and operation process are subjected to a consensus process, and the log file is quickly compared and verified by establishing a hash binary tree of the log file. Once a block is generated, all consensus nodes in the entire network will verify it. After the verification is passed, all nodes will save this block, and the consistency of this node data is used to ensure that the data cannot be tampered with. Through the chain-like data structure between blocks, each record can be traced. Users can query the storage location of the data associated with them, who has accessed and operated it, thereby realizing the supervision of privacy data and establishing a trusted data circulation environment between community residents and community management agencies. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a structural block diagram of the privacy data encryption access system based on blockchain technology for the community proposed by the present invention.
[0049] Figure 2 The following is a diagram of a node architecture of a community data platform according to an example of the present invention.
[0050] Figure 3 The present invention is a flowchart of data uploading according to an example.
[0051] Figure 4 The data access flow chart according to an example of the present invention. DETAILED DESCRIPTION
[0052] Additional aspects and advantages of the present invention will be set forth in part in the following description and in part will be obvious from the following description, or may be learned from practice of the present invention.
[0053] The method for encrypted access to private data based on blockchain technology for a community proposed in the present invention comprises the following steps:
[0054] (1) Community managers register data collection terminals in the community as terminal nodes in the community network, register databases in the community as storage nodes in the community network, register community residents as user nodes in the community network, and register community managers as management nodes in the community network. They also assign a unique identifier, “node ID”, to the terminal nodes, storage nodes, user nodes, and management nodes, respectively. They assign data access rights to user nodes to limit the data content that user nodes are allowed to access, and assign data operation rights to management nodes to limit the data content that management nodes are allowed to operate.
[0055] (2) The management node periodically randomly selects some user nodes and management nodes from the multiple user nodes and multiple management nodes in step (1), and registers these user nodes and management nodes as consensus nodes. At the same time, the community administrator periodically randomly selects some consensus nodes from the registered consensus nodes and cancels the consensus node identities of these consensus nodes.
[0056] (3) The terminal nodes collect various types of data in the community network and upload the data to the storage nodes;
[0057] (4) User nodes access data in storage nodes according to their own needs, and management nodes operate on data in storage nodes according to the needs of user nodes themselves;
[0058] (5) The consensus nodes conduct a consensus process on the data upload, access, and operation records generated in steps (3) and (4).
[0059] In step (1) of the above-mentioned privacy data access method, the terminal nodes include: community monitoring cameras, water meters, electricity meters, gas meters, smoke alarms, Internet of Things devices, managers in the community and community residents.
[0060] In step (1) of the above-mentioned private data access method, the storage node includes:
[0061] (1) A surveillance video database, which is used to store video data and image data captured by surveillance cameras in the community;
[0062] (2) Static database, used to store various static data in the community, including building and road information, water, electricity, and gas pipeline line information;
[0063] (3) Sensor database, which is used to store real-time data from various sensors deployed in the community, including data recorded by water meters, electricity meters, and gas meters;
[0064] (4) Community resident database, which is used to store data related to community residents, including name, gender, age, ID number, address, contact information, and health status;
[0065] (5) IoT device database, used to store data from IoT devices deployed in the community, including data collected by smart access control and security robots;
[0066] In step (3) of the above private data access method, the data uploading process is:
[0067] (1) The terminal node uploads the data collected by the surveillance camera to the surveillance video database in the storage node, uploads the data recorded by the water meter, electricity meter, and gas meter to the sensor database in the storage node, uploads the building road information and water, electricity, and gas pipeline line information collected by the community management personnel to the static database in the storage node, uploads the personal information actively reported by the residents to the community resident database in the storage node, and uploads the data collected by the IoT device to the IoT device database in the storage node;
[0068] (2) The storage node saves the data uploaded by the terminal node and regularly generates a data upload log, which includes "terminal node ID", "upload time", "storage address" and "data tag", and sends the generated data upload log to the server;
[0069] (3) After receiving the data upload log, the server stores the data upload log in the log pool in the data manager of the server.
[0070] In step (4) of the above-mentioned private data access method, the process of the user node accessing the data in the storage node is as follows:
[0071] (1) The user node fills in the data access requirements on the mobile terminal, including: data type, data content and access purpose;
[0072] (2) The mobile terminal generates a pair of keys for the user node. The private key in the key pair is kept by the user node. The mobile terminal sends the public key in the key pair together with the data access requirements filled in by the user node to the server.
[0073] (3) After receiving the user's data access request, the server determines whether the user node has the right to access the data content requested by the user node based on the specified access rights of the user node. If the user node does not have such permission, a "no access" message notification is sent to the user node's mobile terminal. If the user node meets the permission requirements, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the user node's mobile terminal.
[0074] (4) The server generates a data access log, the content of which includes "access user node ID", "access time", "access content" and "access purpose", and stores the generated data access log in the log pool in the data manager on the server;
[0075] (5) The user node enters the private key on the mobile program, decrypts the received encrypted data, and views the data content.
[0076] In step (4) of the above-mentioned privacy data access method, the process of the management node operating the data in the storage node is as follows:
[0077] (1) The management node submits data operation instructions on the server side and selects the data to be operated;
[0078] (2) The server determines whether the management node has the right to operate the data content requested by the management node based on the data operation authority of the management node. If the management node does not have such authority, the server sends a message notification of "no authority to operate" to the management node; if the management node meets the authority, the server retrieves the data content requested by the management node from the storage node and temporarily stores the retrieved data content on the server. The management node then views or modifies the data on the server;
[0079] (3) The server saves the data modified by the management node in step (2) to the storage node, and generates a data operation log, which includes "management node ID", "operation time", "operation data label" and "operation content summary", and stores the generated data operation log in the log pool in the server-side data manager.
[0080] In step (5) of the above private data access method, the consensus process performed by the consensus nodes is:
[0081] (1) When the number of log files in the log pool of the data manager on the server reaches the set number, all log files in the log pool are sent to all consensus nodes in the community network;
[0082] (2) After receiving the log file, the consensus node saves the log file in the log pool of the consensus node, randomly extracts some log files from the log pool of the consensus node, and generates the root hash value Hash_root for the log file according to the Merkle tree structure;
[0083] (3) The consensus node obtains the hash value Hash_pre of the previous block. The previous block is the block generated in the previous round of consensus. If the previous block does not exist, Hash_pre is set to 0.
[0084] (4) Select a random number Nonce, and combine the random number Nonce with the "log tree root hash value Hash_root", "previous block hash value Hash_pre", and "block generation time ts" to form a block header. Use the hash algorithm to calculate the hash value Hash_block of the block header, and compare the hash value Hash_block of the block header with a specified large integer Num. Num can be a 256-bit large integer. If the hash value Hash_block of the block header is greater than the large integer Num, select a new random number and repeat step (4) until the hash value Hash_block of the block header is less than or equal to the large integer Num.
[0085] (5) The consensus node packages the block header generated in step (4) and part of the log file extracted in step (2) into a block. The block header hash value Hash_block becomes the hash value of this block, and the block is sent to all other consensus nodes in the community network;
[0086] (6) After receiving the block in step (5), other consensus nodes verify the validity of the block, including: verifying whether the hash value of the block is less than the specified large integer, and whether the log file contains a hash value that matches the log tree root. When the hash value of the block being verified is less than the specified large integer, and the log file contains a hash value that matches the log tree root, the verification is passed;
[0087] (7) After the block verification is passed, the consensus node adds the block to the blockchain file of this consensus node, ending this round of consensus.
[0088] Figure 1 This is a structural block diagram of the privacy data access system based on blockchain technology for the community proposed by the present invention, including a community network, a server side and a mobile side, wherein:
[0089] The community network is composed of various nodes in the community and the network relationship between nodes. A node refers to a basic unit operating in this system. It can be either a device or a person. Its most important feature is that it has a unique identifier, which is defined as "ID" in the system. The unit responsible for data collection is the terminal node, which can collect data files such as images, audio, video, text, and electronic signals through data recording media, and upload the data to the storage unit using the network or other information transmission tools; the unit for data storage is the storage node, which uses physical media to store data for a long time and manages the data through database software; user nodes are registered by community residents; management nodes are composed of community management personnel; consensus nodes are composed of a part of nodes randomly selected from user nodes and management nodes, which are used for data consensus process. At the same time, the internal interface of the blockchain can be called to view block data and supervise log files to ensure that data upload, access, and operation records cannot be tampered with.
[0090] Figure 2 FIG. 1 is a node architecture diagram of a community data platform according to an embodiment of the present invention. The surveillance cameras in the community are registered as surveillance video terminal nodes A1-A in the community network. q The surveillance video database is registered as the surveillance video storage node D1, which includes two sub-database systems d1 A With d1 B , the terminal node uploads the video data to the storage node D1 and stores it in the database d1 A Terminal Node C j Represents other types of data collection terminals in the community, uploads data to its corresponding storage node Di, and stores it in database d i Community residents register as user nodes U1-U in the community network n , community managers register as management nodes P1-P m , extract a part of nodes from user nodes and management nodes as consensus nodes C1-C o The data manager on the server side is responsible for managing the communication between nodes.
[0091] Mobile terminal is used to provide user nodes with access to community data. Figure 4As shown, the user node fills in the data access request including "data type", "data content" and "access purpose" in the community data access program installed on the mobile terminal. The community data access program will generate a pair of keys for the user. The private key in the key pair is kept by the user. The private key will be packaged with the data access request filled in by the user node and sent to the server. After receiving the user's data access request, the server determines whether the user node has the right to access the data content requested by the user node based on the user node's access rights. If there is no such permission, a "no access" message notification is sent to the mobile terminal of the user node; if the user node meets the permission, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the mobile terminal of the user node; the server generates a data access log, the log content includes "access user node ID", "access time", "access content" and "access purpose", and the generated data access is stored in the log pool in the data manager on the server; the user node enters the private key on the mobile terminal program, decrypts the received encrypted data, and views the data content;
[0092] The server side is used to manage nodes in the community network. In the community data management program deployed on the server side, the community manager registers the data collection terminal in the community as the terminal node in the community network, registers the database in the community as the storage node in the community network, registers the community residents as the user nodes in the community network, and registers the community manager as the management node in the community network. A unique identifier "node ID" is assigned to the terminal node, storage node, user node and management node respectively, and data access rights are assigned to the user node to limit the data content that the user node is allowed to access, and data operation rights are assigned to the management node to limit the data content that the management node is allowed to operate. The server side provides a way for the management node to operate the storage node data. The management node submits the data operation instructions on the server side and selects the data to be operated. The server side determines whether the management node has the right to operate the data content requested by the management node based on the data operation rights of the management node. If there is no such right, the server side sends a "no right to operate" message notification to the management node. If the management node meets the authority, the data content requested by the management node to access is retrieved in the storage node, and the retrieved data content is temporarily stored on the server side. The management node views or modifies this part of the data on the server side. The server saves the modified data of the management node to the storage node, and generates a data operation log. The log content includes "management node ID", "operation time", "operation data label", and "operation content summary". The generated data operation log is stored in the log pool in the data manager on the server.
[0093] Example 1
[0094] The community privacy data access system is used to upload data. The surveillance camera terminal node uploads the collected data to the storage node through network encryption and saves it to the surveillance video database in the surveillance video storage node (such as Figure 2 The storage node periodically sends data summaries to the data manager (as shown in Figure 3 As shown), the data manager organizes the data summary into a retrieval dictionary and generates a data upload log, sends the data upload log to the data upload log pool, packages it into a log block, and broadcasts the generated block to other consensus nodes in the blockchain network. Other nodes will verify the legitimacy of the block content. If the verification fails, the block will be discarded and a new round of consensus process will be carried out; after the verification passes, all consensus nodes will accept the newly generated block and save it to the blockchain data of the consensus node. Through this complete set of data upload processes, each piece of data stored in the storage node can be traced back to the corresponding terminal node. Since each storage node only stores the data uploaded by the terminal node connected to it, and each storage node is independent of each other, when a single storage node is attacked, the data in other storage nodes will not be exposed, thereby reducing the risk of data leakage. In addition, since all consensus nodes have saved a complete data upload log, all data upload records are tamper-proof and each record is true and valid.
[0095] Example 2
[0096] Use the community privacy data access system to access data. The user node fills in the data access request in the community data access program installed on the mobile terminal. The community data access program will generate a pair of keys for the user. The private key in the key pair will be kept by the user. The private key will be packaged with the data access request filled in by the user node and sent to the data manager on the server side. After receiving the user's data access request, the data manager determines whether the user node has the right to access the data content requested by the user node based on the user node's access rights. If there is no such permission, a "no access" message notification is sent to the user node's mobile terminal; if the user node meets the permission, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the user node's mobile terminal (such as Figure 4As shown); the user node enters the private key on the mobile program, decrypts the received encrypted data, and views the data content; the server generates a data access log, stores the generated data access in the log pool in the data manager on the server, and packages it into blocks by the consensus node and broadcasts it to other nodes. Other nodes will verify the legitimacy of the block content. If the verification fails, the block will be discarded and a new round of consensus process will be carried out; after the verification passes, all consensus nodes will accept the newly generated block and save it to the blockchain data of the consensus node, and send a notification to the user node: "This data access behavior has been recorded." Through this complete set of data access processes, users can make reasonable data access requests to the community and view the required data. Since the data sent by the server to the user node is encrypted by the user's public key, it can be guaranteed that this data can only be decrypted and viewed by the user node holding the corresponding private key, avoiding the data from being intercepted and stolen during transmission. Since all consensus nodes have saved a complete data upload log, all data access records are tamper-proof. Users cannot bypass the supervision of the system to access data, nor can they tamper with the records generated by their own data access behavior. This transparent data flow process will effectively implement supervision of privacy data and establish a trusted data flow environment between community residents and community management agencies.
[0097] The above specific implementation process proves the reliability, accuracy and feasibility of the present invention, but the system and control method are not limited to the above case. Users can also add different terminal nodes according to actual needs to meet the encryption requirements of various community privacy data.
[0098] Although the implementation steps of the present invention have been shown and described above, it can be understood that the above-mentioned implementation description is exemplary and cannot be understood as a limitation of the present invention. Ordinary technicians in this field can change, modify, replace and modify the above-mentioned implementation steps within the scope of the present invention without departing from the principles and purpose of the present invention.
Claims
1. A method for accessing privacy data encrypted based on blockchain technology for a community, characterized in that: The method comprises the following steps: (1) Community managers register data collection terminals in the community as terminal nodes in the community network, register databases in the community as storage nodes in the community network, register community residents as user nodes in the community network, and register community managers as management nodes in the community network. They also assign a unique identifier "node ID" to the terminal nodes, storage nodes, user nodes, and management nodes, assign data access rights to user nodes, limit the data content that user nodes are allowed to access, and assign data operation rights to management nodes, limit the data content that management nodes are allowed to operate; (2) The management node periodically randomly selects some user nodes and management nodes from the multiple user nodes and multiple management nodes in step (1), and registers these user nodes and management nodes as consensus nodes. At the same time, the community administrator periodically randomly selects some consensus nodes from the registered consensus nodes and cancels the consensus node identities of these consensus nodes. (3) The terminal nodes collect various types of data in the community network and upload the data to the storage nodes; (4) User nodes access data in storage nodes according to their own needs, and management nodes operate on data in storage nodes according to the needs of user nodes themselves; (5) The consensus nodes conduct a consensus process on the data upload, access, and operation records generated in steps (3) and (4); The process of the management node in step (4) operating the data in the storage node is as follows: (1) The management node submits data operation instructions on the server side and selects the data to be operated; (2) The server determines whether the management node has the right to operate the data content requested by the management node based on the data operation authority of the management node. If the management node does not have such authority, the server sends a message notification of "no authority to operate" to the management node; if the management node meets the authority, the server retrieves the data content requested by the management node in the storage node and temporarily stores the retrieved data content on the server. The management node then views or modifies the data on the server; (3) The server saves the data modified by the management node in step (2) to the storage node, and generates a data operation log, which includes "management node ID", "operation time", "operation data label" and "operation content summary", and stores the generated data operation log in the log pool in the server-side data manager.
2. The method for accessing privacy data encrypted based on blockchain technology for a community as claimed in claim 1, characterized in that: The terminal nodes in step (1) include: community monitoring cameras, water meters, electricity meters, gas meters, smoke alarms, Internet of Things devices, managers in the community, and community residents.
3. The method for accessing privacy data encrypted based on blockchain technology for a community as claimed in claim 1, characterized in that: The storage node in step (1) includes: (1) A surveillance video database, which is used to store video data and image data captured by surveillance cameras in the community; (2) Static database, which is used to store various static data in the community, including building and road information, water, electricity, and gas pipeline line information; (3) Sensor database, which is used to store real-time data from various sensors deployed in the community, including data recorded by water meters, electricity meters, and gas meters; (4) Community resident database, which is used to store data related to community residents, including name, gender, age, ID number, address, contact information, and health status; (5) IoT device database, used to store data from IoT devices deployed in the community, including data collected by smart access control and security robots.
4. The method for accessing privacy data encrypted based on blockchain technology for a community as claimed in claim 1, characterized in that: The data uploading process in step (3) is as follows: (1) The terminal node uploads the data collected by the surveillance camera to the surveillance video database in the storage node, uploads the data recorded by the water meter, electricity meter, and gas meter to the sensor database in the storage node, uploads the building road information and water, electricity, and gas pipeline line information collected by the community management personnel to the static database in the storage node, uploads the personal information actively reported by the residents to the community resident database in the storage node, and uploads the data collected by the IoT device to the IoT device database in the storage node; (2) The storage node saves the data uploaded by the terminal node and regularly generates a data upload log, which includes "terminal node ID", "upload time", "storage address" and "data tag", and sends the generated data upload log to the server; (3) After receiving the data upload log, the server stores the data upload log in the log pool in the data manager of the server.
5. The method for accessing privacy data encrypted based on blockchain technology for a community as claimed in claim 1, characterized in that: The process of the user node accessing the data in the storage node in step (4) is as follows: (1) The user node fills in the data access requirements on the mobile terminal, including: data type, data content and access purpose; (2) The mobile terminal generates a pair of keys for the user node. The private key in the key pair is kept by the user node. The mobile terminal sends the public key in the key pair together with the data access requirements filled in by the user node to the server. (3) After receiving the user's data access request, the server determines whether the user node has the right to access the data content requested by the user node based on the specified access rights of the user node. If the user node does not have such permission, a "no access" message notification is sent to the mobile terminal of the user node. If the user node meets the permission requirements, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the mobile terminal of the user node. (4) The server generates a data access log, which includes "access user node ID", "access time", "access content" and "access purpose", and stores the generated data access log in the log pool in the data manager on the server; (5) The user node enters the private key on the mobile program, decrypts the received encrypted data, and views the data content.
6. The method for accessing privacy data encrypted based on blockchain technology for a community as claimed in claim 1, characterized in that: The consensus process performed by the consensus nodes in step (5) is as follows: (1) When the number of log files in the log pool of the data manager on the server reaches the set number, all log files in the log pool are sent to all consensus nodes in the community network; (2) After receiving the log file, the consensus node saves the log file in the log pool of the consensus node, randomly extracts some log files from the log pool of the consensus node, and generates the root hash value Hash_root for the log file according to the Merkle tree structure; (3) The consensus node obtains the hash value Hash_pre of the previous block. The previous block is the block generated in the previous round of consensus. If the previous block does not exist, Hash_pre is set to 0. (4) Select a random number Nonce, and combine the random number Nonce with the "log tree root hash value Hash_root", "the hash value of the previous block Hash_pre", and "block generation time ts" to form a block header. Use the hash algorithm to calculate the hash value Hash_block of the block header, and compare the hash value Hash_block of the block header with a specified large integer Num. If the hash value Hash_block of the block header is greater than the large integer Num, select a new random number and repeat step (4) until the hash value Hash_block of the block header is less than or equal to the large integer Num. (5) The consensus node packages the block header generated in step (4) and part of the log file extracted in step (2) into a block. The block header hash value Hash_block becomes the hash value of this block, and the block is sent to all other consensus nodes in the community network; (6) After receiving the block in step (5), other consensus nodes verify the validity of the block, including: verifying whether the hash value of the block is less than the specified large integer, and whether the log file contains a hash value that matches the log tree root. When the hash value of the block being verified is less than the specified large integer, and the log file contains a hash value that matches the log tree root, the verification is passed; (7) After the block verification is passed, the consensus node adds the block to the blockchain file of this consensus node, ending this round of consensus.
7. A privacy data access system based on blockchain technology for the community, characterized in that: The privacy data access system includes a community network, a server and a mobile terminal, wherein: The community network is composed of various nodes in the community and the network relationships between the nodes. The nodes include: Terminal nodes include community surveillance cameras, water meters, electricity meters, gas meters, smoke alarms, IoT devices, community managers and community residents for data collection; storage nodes include surveillance video databases, static databases, sensor databases, community resident databases and IoT device databases for data storage; user nodes are registered by community residents; management nodes are composed of community managers; consensus nodes are composed of a part of nodes randomly extracted from user nodes and management nodes for data consensus process; the network relationship between nodes is as follows: surveillance camera terminal nodes establish a network relationship with surveillance video database storage nodes through network cables; IoT device terminal nodes establish a wireless network relationship with IoT database storage nodes through 4G / 5G signals; water meters, electricity meters, gas meters and smoke alarm terminal nodes are connected to signal processing terminals through signal lines, and then establish a network relationship with sensor databases through network cables or wireless networks; all storage nodes establish a network connection with the server where the community data management system is deployed through network cables; community residents or community managers establish a network connection with the server where the community data management system is deployed through mobile devices; The mobile terminal is used to provide a way for user nodes to access community data. The user node fills in the data access request containing "data type", "data content" and "access purpose" in the community data access program installed on the mobile terminal. The community data access program will generate a pair of keys for the user. The private key in the key pair is kept by the user. The private key will be packaged with the data access request filled in by the user node and sent to the server. After receiving the user's data access request, the server determines whether the user node has the right to access the data content requested by the user node based on the user node's access rights. If there is no such permission, a "no access" message notification is sent to the mobile terminal of the user node. If the user node meets the permission, the data content requested by the user node is retrieved from the storage node, and the retrieved data content is encrypted with the public key provided by the user node and sent to the mobile terminal of the user node. The server generates a data access log, the log content of which includes "access user node ID", "access time", "access content" and "access purpose", and stores the generated data access in the log pool in the data manager of the server. The user node enters the private key on the mobile terminal program, decrypts the received encrypted data, and views the data content. The server side is used to manage nodes in the community network; community managers register the data collection terminals in the community as terminal nodes in the community network, register the database in the community as storage nodes in the community network, register community residents as user nodes in the community network, register community managers as management nodes in the community network, and assign a unique identifier "node ID" to the terminal nodes, storage nodes, user nodes and management nodes respectively, assign data access rights to user nodes, limit the data content that user nodes are allowed to access, assign data operation rights to management nodes, limit the data content that management nodes are allowed to operate; the server side provides management nodes with a way to operate storage node data; management nodes submit data operations on the server side. For instructions, select the data to be operated; the server side determines whether the management node has the right to operate the data content requested by the management node based on the data operation authority of the management node. If it does not have this authority, it sends a "no authority to operate" message notification to the management node. If the management node meets the authority, it retrieves the data content requested by the management node in the storage node, and then temporarily stores the retrieved data content to the server side. The management node views or modifies this part of the data on the server side; the server side saves the data modified by the management node to the storage node, and the server side generates a data operation log. The log content includes "management node ID", "operation time", "operation data label", and "operation content summary", and the generated data operation log is stored in the log pool in the data manager on the server side.
