A data processing method based on a blockchain network and related equipment
By leveraging the decentralized storage and visible node identification control of the blockchain network, the problem of digital identity data leakage is solved, achieving data security and controllability.
Patent Information
- Application Number
- CN202111258815.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2041-10-27
AI Technical Summary
The existing methods of circulating and storing digital identities pose a risk of data leakage, making the improvement of data security a hot research topic.
Decentralized data storage is achieved through a blockchain network. Holding nodes generate identity representation data and store it on the blockchain. Visible node identifiers are set to control access permissions to the data, ensuring that only designated nodes can access it.
It effectively reduces the risk of data leakage, improves data security, and realizes decentralized storage and secure transfer of data.
Smart Images

Figure CN116055051B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to the field of artificial intelligence, and especially relates to a data processing method based on a blockchain network, a data processing device based on a blockchain network, a data processing equipment based on a blockchain network, a computer readable storage medium and a program product. BACKGROUND
[0002] With the rapid development of computer technology, more and more users or enterprises choose to adopt digital identity to prove their true identity; the digital identity is obtained by digitizing the identity information (such as user name, behavior information, etc.) of the user, and the digital identity can improve the identity recognition efficiency to a certain extent.
[0003] However, it is found in practice that the existing circulation and storage mode of digital identity has the risk of data leakage; for example, in the process of directly sending the digital identity of the user to the holder by the issuer who generates the digital identity, the digital identity may be intercepted and the private identity information of the user is leaked. Therefore, how to improve the security of data has become a hot research topic. SUMMARY
[0004] The embodiments of the present application provide a data processing method based on a blockchain network and related equipment, which can improve the security of data.
[0005] In one aspect, the embodiments of the present application provide a data processing method based on a blockchain network, which comprises:
[0006] sending a first data clearing request to a consensus node of the blockchain network, and receiving declaration data related to a holding node in the blockchain network returned by the consensus node in response to the first data clearing request;
[0007] generating identity expression data corresponding to the holding node according to the declaration data, the identity expression data being used to indicate the identity of the holding node;
[0008] setting a first visible node identifier capable of accessing the identity expression data;
[0009] storing the identity expression data and the visible node identifier to a blockchain of the blockchain network.
[0010] In another aspect, the embodiments of the present application provide a data processing method based on a blockchain network, which comprises:
[0011] receiving a first data clearing request sent by a holding node in the blockchain network, the first data clearing request being used to request to clear declaration data related to the holding node;
[0012] In response to the first data clearing request, clearing data related to the holding node is obtained, and the clearing data is returned to the holding node, so that the holding node generates identity expression data corresponding to the holding node according to the clearing data, the identity expression data is used to indicate the identity of the holding node, and a first visible node identifier capable of accessing the identity expression data is set;
[0013] The first storage request sent by the holding node is received, and in response to the first storage request, the identity expression data and the first visible node identifier contained in the first storage request are stored in the blockchain of the blockchain network.
[0014] In another aspect, the embodiments of the present application provide a data processing device based on a blockchain network, which comprises:
[0015] The sending unit is configured to send a first data clearing request to a consensus node of the blockchain network, and receive declaration data related to a holding node in the blockchain network returned by the consensus node in response to the first data clearing request;
[0016] The processing unit is configured to generate identity expression data corresponding to the holding node according to the declaration data, and the identity expression data is used to indicate the identity of the holding node;
[0017] The processing unit is further configured to set a first visible node identifier capable of accessing the identity expression data;
[0018] The processing unit is further configured to store the identity expression data and the visible node identifier in the blockchain of the blockchain network.
[0019] In an implementation manner, when the processing unit is configured to generate the identity expression data corresponding to the holding node according to the declaration data, the processing unit is specifically configured to:
[0020] Sign the declaration data to generate the identity expression data corresponding to the holding node.
[0021] In an implementation manner, the processing unit is further configured to:
[0022] Send a declaration application request to an issuing node of the blockchain network, so that the issuing node performs a response process according to the declaration application request to store the declaration data in the blockchain.
[0023] In an implementation manner, the declaration application request carries an object identifier corresponding to the holding node and candidate object data; and the response process comprises:
[0024] Performing identity verification processing on the holding node according to the declaration application request to obtain an identity verification result;
[0025] If the identity verification result is identity verification success, declaration data corresponding to the holding node is generated, and a second visible node identifier capable of accessing the declaration data is set;
[0026] The declaration data and the second visible node identifier are stored to the blockchain.
[0027] In an implementation manner, a flow of the identity verification processing includes:
[0028] An identity query request is sent by the issuing node to the consensus node, and the identity query request carries an object identifier corresponding to the holding node;
[0029] Reference object data associated with the object identifier returned by the consensus node is received;
[0030] The reference object data is compared with the candidate object data to obtain an identity verification result.
[0031] In an implementation manner, when the processing unit is used to store the identity expression data and the first visible node identifier to the blockchain, the processing unit is specifically used to:
[0032] Expression transaction data is generated based on the identity expression data and the first visible node identifier;
[0033] The expression transaction data is sent to the consensus node, so that the consensus node generates a block based on the expression transaction data, and adds the block to the blockchain.
[0034] On the other hand, an embodiment of the present application provides a data processing apparatus based on a blockchain network, which comprises:
[0035] A receiving unit is configured to receive a first data sorting request sent by a holding node in a blockchain network, and the first data sorting request is used to request to sort declaration data related to the holding node;
[0036] A processing unit is configured to sort the declaration data related to the holding node in response to the first data sorting request, and return the declaration data to the holding node, so that the holding node generates identity expression data corresponding to the holding node according to the declaration data, and the identity expression data is used to indicate the identity of the holding node, and a first visible node identifier capable of accessing the identity expression data is set;
[0037] The processing unit is further configured to receive a first storage request sent by the holding node, and store the identity expression data and the first visible node identifier included in the first storage request to a blockchain of the blockchain network in response to the first storage request.
[0038] In an implementation manner, the first data clearing request includes a to-be-processed block height h1 of a to-be-processed block expected to be synchronized by the holding node, h1 is an integer greater than zero; the processing unit is configured to, in response to clearing the declaration data related to the holding node according to the first data clearing request, specifically configured to:
[0039] obtain a highest block height H1 of the block chain, H1 is an integer greater than 1;
[0040] perform data clearing processing on the block chain according to the to-be-processed block height h1 and the highest block height H1, to obtain the declaration data related to the holding node.
[0041] In an implementation manner, the processing unit is configured to, in response to performing data clearing processing on the block chain according to the to-be-processed block height h1 and the highest block height H1 to obtain the declaration data related to the holding node, specifically configured to:
[0042] if the to-be-processed block height h1 and the highest block height H1 satisfy a height condition, obtain a to-be-processed block corresponding to the to-be-processed block height h1 in the block chain; wherein the to-be-processed block height h1 and the highest block height H1 satisfy the height condition, including: if the node type of the consensus node is a light node, the to-be-processed block height h1 is less than or equal to the highest block height H1; or, if the node type of the consensus node is a full node, the to-be-processed block height h1 is less than the highest block height H1;
[0043] perform visibility detection on first candidate transaction data contained in the to-be-processed block, to obtain a first visibility detection result;
[0044] if the first visibility detection result satisfies a visibility condition, determine the first candidate transaction data as the declaration data related to the holding node; wherein the first visibility detection result satisfies the visibility condition, including: the holding node can access the first candidate transaction data, and the first candidate transaction data contains the declaration data;
[0045] if the first visibility detection result does not satisfy the visibility condition, set a new to-be-processed block height h1 = h1 + 1, and obtain a highest block height H2 of an updated block chain in the block chain network, H2 is an integer greater than 1, if the new to-be-processed block height h1 and the block height H2 satisfy the height condition, continue to perform the step of performing data clearing processing according to the new to-be-processed block height h1 and the block height H2 to obtain the declaration data related to the holding node.
[0046] In an implementation manner, the processing unit is further configured to:
[0047] receive a second storage request sent by an issuing node in a blockchain network, the second storage request carrying declaration data corresponding to the holding node and a second visible node identifier capable of accessing the declaration data;
[0048] store the declaration data and the second visible node identifier into the blockchain in response to the second storage request.
[0049] In an implementation manner, the processing unit is further configured to:
[0050] receive a second data clearing request sent by a verifying node in the blockchain network, the second data clearing request being used to request identity expression data related to the verifying node;
[0051] clear the identity expression data related to the verifying node in response to the second data clearing request;
[0052] return the identity expression data to the verifying node, so that the verifying node performs identity verification processing on the holding node based on the identity expression data.
[0053] In another aspect, an embodiment of the present application provides a data processing device based on a blockchain network, comprising:
[0054] a processor adapted to execute a computer program;
[0055] a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by the processor to implement the data processing method based on the blockchain network as described above.
[0056] In another aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being adapted to be loaded and executed by a processor to implement the data processing method based on the blockchain network as described above.
[0057] In another aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions stored in a computer readable storage medium. A processor of a data processing device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the data processing device execute the data processing method based on the blockchain network as described above.
[0058] In the embodiments of the present application, the holding node can send a first data clearing request to the consensus node, so that the consensus node responds to the first data clearing request to clear and return the declaration data related to the holding node from the blockchain; the holding node generates identity expression data based on the declaration data, and stores the identity expression data and the first visible node identifier capable of accessing the identity expression data into the blockchain of the blockchain network. In the above scheme, the declaration data related to the holding node and the identity expression data are stored in the blockchain of the blockchain network, realizing the decentralized storage of the declaration data and the identity expression data, and through the data clearing capability of the holding node, the data flow of the declaration data and the identity expression data and the setting of the visible node on the blockchain are realized, so that only the specified visible node can access the declaration data and the identity expression data, effectively reducing the risk of data leakage and improving the security of the data. BRIEF DESCRIPTION OF DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0060] Figure 1a An architecture schematic diagram of a data sharing system provided by an exemplary embodiment of the present application is shown;
[0061] Figure 1b A structure schematic diagram of a block provided by an exemplary embodiment of the present application is shown;
[0062] Figure 1c An architecture schematic diagram of a data processing system provided by an exemplary embodiment of the present application is shown;
[0063] Figure 1d A structure schematic diagram of a data processing system provided by an exemplary embodiment of the present application is shown;
[0064] Figure 1e A scene schematic diagram of an education certification scene provided by an exemplary embodiment of the present application is shown;
[0065] Figure 2 A flow schematic diagram of a data processing method based on a blockchain network provided by an exemplary embodiment of the present application is shown;
[0066] Figure 3 An identification hit processing schematic diagram provided by an exemplary embodiment of the present application is shown;
[0067] Figure 4A flowchart of a data processing method based on a blockchain network is shown according to an example embodiment of the present application.
[0068] Figure 5 A flowchart of a data clearing processing is shown according to an example embodiment of the present application.
[0069] Figure 6 A flowchart of a data processing method based on a blockchain network is shown according to an example embodiment of the present application.
[0070] Figure 7 A data processing device based on a blockchain network is shown according to an example embodiment of the present application.
[0071] Figure 8 A data processing device based on a blockchain network is shown according to an example embodiment of the present application.
[0072] Figure 9 A data processing device based on a blockchain network is shown according to an example embodiment of the present application. DETAILED DESCRIPTION
[0073] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0074] The embodiments of the present application relate to blockchain technology, and the related terms and concepts of the blockchain technology will be briefly introduced below:
[0075] The blockchain network can be understood as a data sharing system 100, which can refer to a system for data sharing between nodes. An example structure of the data sharing system 100 can be seen from Figure 1a ; for example Figure 1aAs shown, the data sharing system 100 can include a plurality of nodes 101, which can refer to various clients (or terminal devices, servers, etc.) in the data sharing system 100. In order to ensure information intercommunication within the data sharing system 100, information connection can exist between each node in the data sharing system 100, so that information transmission between nodes can be achieved, and information sharing can be achieved. The manner in which information connection between nodes is achieved can include: for each node in the data sharing system 100, the node has a corresponding node identifier, and each node in the data sharing system 100 can store node identifiers of other nodes in the data sharing system 100, so that any node can achieve information sharing (such as broadcasting the generated block to other nodes in the data sharing system 100) according to the node identifiers of other nodes. Each node can maintain a node identifier list as shown in the following table, and the node name and the node identifier are stored in the node identifier list. The node identifier can be an IP (Internet Protocol) address and any other information that can be used to identify the node, and the IP address is only used as an example in Table 1 for illustration:
[0076] Table 1 Node identifier list
[0077] Node name Node identification Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node S (S is a positive integer) xx.xx.xx.xx
[0078] Each node in the data sharing system 100 stores a same block chain. The block chain (block chain) is a new application mode of distributed data storage, P2P (Peer to Peer) transmission, consensus mechanism, encryption algorithm and other computer technologies. The block chain is essentially a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block contains information of a batch of network transactions, and is used to verify the validity (anti-fake) of the information and generate the next block. The block chain is composed of a plurality of blocks, each block includes input information, and the node stores the input information by storing the block chain. The structure of the block can be referred to Figure 1b For example, Figure 1bAs shown, the block includes a block header and a block body in the genesis block, the block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, the next block also includes a block header and a block body, the block header stores the input information characteristic value of the current block, the block header characteristic value of the parent block, the version number, the timestamp and the difficulty value, and so on, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, ensuring the security of the input information in the block. Among them, the nodes in the data sharing system 100 perform consensus on the input information, and after the consensus is successful, the process of generating a block of the input information and chaining the block (i.e., adding the block to the block chain) can include: when any node in the data sharing system 100 receives input information, other nodes in the data sharing system 100 perform consensus on the input information according to the consensus algorithm, and after the consensus is successful, the input information is generated into a block, and the block is added to the block chain, thereby realizing distributed storage of the input information, so that the data stored in all nodes in the data sharing system 100 is consistent. Among them, the above-mentioned nodes that perform consensus on the input information according to the consensus algorithm are usually called consensus nodes, which are explained here.
[0079] As can be known from the foregoing introduction of the block in the block chain, the block in the block chain includes a block header and a block body, and the block body is used to store input information. Therefore, according to whether the block in the block chain included in the node contains all the input information, specifically whether the block body of each block in the block chain contains all the input information, the nodes in the block chain network can be divided into full nodes and light nodes. Among them, the full nodes and light nodes are distinguished by judging whether the node contains all the data of the block. The block chain in the full node synchronizes all the data of the block (i.e., all the input information), including the block header, the block body, the transaction data and other related information of the block. The light node only synchronizes the block header of each block in the block chain network and the transaction data related to the light node; in one implementation mode, the block headers in the light node are not connected to form a block chain, that is, the light node does not contain a block chain; in another implementation mode, the block headers in the light node can still be connected to form a block chain, and part of the block bodies in the block chain are empty (e.g., do not contain input information), and part of the block bodies in the block chain are not empty (e.g., contain transaction data related to the light node). In order to distinguish between the block chain containing all the data and the block chain containing only the block header (and part of the transaction data), the block chain containing all the data is referred to as a block chain, and the block chain containing only the block header (or part of the input information) is referred to as a sub-block chain in the embodiments of the present application. It is explained here.
[0080] In addition, the light node can include an SPV (Special Purpose Vehicle) node having data clearing capability, which can be simply understood as the ability to synchronize transaction data related to itself (i.e., the SPV node) from the full node (specifically, the blockchain included in the full node) and support setting a visible node identifier that can access transaction data uploaded to the blockchain. In this way, only the node corresponding to the set visible node identifier can obtain the transaction data from the blockchain, which improves the security of the data to a certain extent. In the embodiments of the present application, the light node includes a sub-blockchain, and the block body of part of the blocks in the sub-blockchain includes transaction data related to the light node. It is hereby stated.
[0081] Based on the above introduction of the blockchain technology, the embodiments of the present application propose a data processing system based on a blockchain network, which can be referred to as a decentralized ID (DID) system. In different identity authentication scenarios, the data processing system can realize the on-chain circulation and decentralized storage (i.e., distributed storage in the consensus nodes included in the blockchain network) of the data involved in different identity authentication scenarios. For example, in the case of an education authentication scenario, the data processing system can realize the decentralized storage of a user's education certificate (such as information or a credential used to prove the user's education) and the circulation of the education certificate on the chain, which improves the security of the education certificate to a certain extent.
[0082] The schematic diagram of the overall structure of the data processing system can be seen from Figure 1c As shown in Figure 1c , the data processing system includes, from top to bottom, an application layer, a service interface layer, and a persistence layer. The application layer provides blockchain-based application services for users, the service interface layer includes a decomposer for providing decentralized services and data acquisition functions, and the persistence layer includes service interfaces (such as API interfaces, SQL interfaces, etc.) for providing blockchain basic service functions for the upper application scenarios. Further, Figure 1c The data processing system can also be represented as Figure 1d the structural schematic diagram shown in Figure 1dAs shown in the data processing system, the data processing system includes: a consensus node 102, an issuing node 103, a holding node 104, and a verification node 105. Among them, each node (such as the consensus node 102, the issuing node 103, the holding node 104, and the verification node 105) included in the data processing system can refer to a computer device or an application (which can be referred to as an application) running in the computer device. Among them: the computer device can include but is not limited to: smart phones, tablet computers, portable personal computers, mobile Internet devices, smart televisions, vehicle-mounted devices, head-mounted devices, and other smart devices; the application running in the computer device can refer to a computer program for completing one or more specific functions, which can include but is not limited to: a client installed in the computer device, a small program that can be used without downloading and installing, a web application opened through a browser, and the like. It should be noted that the number and type of nodes included in the data processing system are not limited by the embodiments of the present application; for example, in Figure 1a , the number of consensus nodes 102 is 1, and the number of verification nodes 105 is 1, but in actual applications, the number of consensus nodes 102 can be greater than 1 (such as 100), and the number of verification nodes 105 can be greater than 1 (such as 50).
[0083] Based on Figure 1d the data processing system, the embodiments of the present application propose a data processing scheme based on a blockchain network, in which the data flow process between the light nodes (such as the issuing node 101, the holding node 102, and the verification node 105) is realized through the blockchain, and the data is stored in the blockchain included in the full node, avoiding the risk of data leakage and improving the security of the data. The following will give the general process of the data processing scheme in combination with Figure 1d the nodes included in the data processing system shown in Figure 1e , and taking the education certificate authentication scenario shown in
[0084] (1) Holding node 104.
[0085] The holding node 104 is a node used by a target user (such as any user) who has a demand for applying for declaration data (such as an education certificate). For example: if a student "Xiaoming" has a demand for applying for an education certificate from XX school, then the student "Xiaoming" can send a declaration application request to the issuing node 103 (such as the node used by XX school) through the holding node 104; the issuing node 103 generates the education certificate of the student "Xiaoming" in response to the declaration application request. Among them, the node type of the holding node 104 is a light node, that is, only part of the blocks including the transaction data (such as the enrollment information and education information of the student "Xiaoming") related to the holding node 104 exist in the blockchain included in the holding node 104
[0086] (2) Issuing node 103.
[0087] The issuing node 103 is a node used by a user for issuing a statement data. In the academic qualification scenario, the issuing node 103 can be a node used by XX school, so that when the issuing node 103 receives the statement application request sent by the holding node 104, the issuing node 103 can issue the academic qualification of the student "Xiaoming" by using the object identifier of the holding node 104 object carried by the statement application request (such as using the identity identifier (such as user name, user number, user ID, etc.) of the object student "Xiaoming" of the holding node to issue the academic qualification of the student "Xiaoming"; and set the second visible node identifier capable of accessing the academic qualification of the student "Xiaoming", such as the node identifier of the node X in the blockchain network is set as the second visible node identifier, then the node X can obtain (such as download, cache) the academic qualification of the student "Xiaoming" from the blockchain; the issuing node 103 sends the academic qualification of the student "Xiaoming" and the second visible node identifier capable of accessing the academic qualification to the consensus node 102, so that the consensus node 102 uploads and stores the academic qualification of the student "Xiaoming" in the blockchain after successfully consensus the academic qualification. Wherein, the node type of the issuing node 103 is a light node, such as the issuing node 103 only contains data related to itself, such as containing one or more historical issued academic qualifications of students.
[0088] (3) Consensus node 102.
[0089] The consensus node 102 is a node capable of performing consensus processing on received data by using a consensus algorithm, and storing the data into a block in the blockchain after the consensus is successful. The consensus algorithm can include but is not limited to proof of work, proof of stake, delegated proof of stake, etc. The consensus algorithm used in different business scenarios is not the same, and the type of consensus algorithm is not limited in the embodiments of the present application. Based on the above description, it is not difficult to know that the node type of the consensus node 102 is a full node, that is, the blockchain contained in the consensus node 102 contains all the data in the blockchain network. Specifically, after the consensus node 102 receives the educational certificate sent by the issuing node 103 and the second visible node identifier capable of accessing the educational certificate, the consensus node 102 can perform consensus on the educational certificate and the second visible node identifier, and generate a block based on the educational certificate and the second visible node identifier after the consensus is successful, and store the block into the blockchain, thereby realizing the broadcast of the block (i.e. the educational certificate and the second visible node identifier) in the blockchain network. In this way, other nodes (full nodes and / or light nodes) in the blockchain network can synchronize the block containing the educational certificate and the second visible node identifier from the blockchain of the consensus node. For example, if the node identifier of the holding node 104 is set as the second node visible identifier capable of accessing the educational certificate, the holding node 104 can send a first data clearing request to the consensus node, so that the consensus node clears the declaration data related to the holding node 104 in the blockchain, and returns the declaration data to the holding node 104; so that the holding node 104 signs the declaration data, and stores the identity expression data (such as the signed educational certificate) and the first visible node identifier capable of accessing the identity expression data into the blockchain.
[0090] (4) The verification node 105.
[0091] The verification node 105 is a node used by a user who verifies the identity expression data (such as the educational certificate). In the educational authentication scenario, the verification node 105 can be a node used by a recruitment unit (such as an enterprise X which has the demand of recruiting employees), so that the verification node 105 can synchronize the transaction data related to itself from the blockchain in the blockchain network, and perform identity verification on the identity expression data contained in the transaction data after obtaining the transaction data. For example, the blockchain in the blockchain network contains the signed educational certificate uploaded by the student “Xiaoming” through the holding node 104, and the node identifier of the verification node X is set as the first visible node identifier capable of accessing the signed educational certificate when uploading the signed educational certificate. Therefore, the verification node X can synchronize the signed educational certificate from the blockchain, and perform identity verification on the signed educational certificate. The identity verification can include verifying the authenticity of the signed educational certificate, and the implementation of the identity verification is not limited in the embodiments of the present application.
[0092] Based on the above description, the data processing scheme based on the blockchain network mentioned in the embodiments of the present application combines the tamper-proof nature of the blockchain, uploads the data (such as the declaration data or identity expression data mentioned above) to the chain, and realizes the decentralized storage of the data. Moreover, through the data sorting capability of the holding node, the data flow and the setting of the visible node identifier (such as the first visible node identifier and the second visible node identifier mentioned above) on the blockchain are performed, which effectively protects the safe flow of data among the issuing node, the holding node and the verification node, so that only the specified node can access the data, effectively reduces the risk of data leakage, and improves the security of the data.
[0093] Based on the above-described data processing scheme based on the blockchain network, the embodiments of the present application propose a more detailed data processing method based on the blockchain network, which will be described in detail below in combination with the accompanying drawings.
[0094] Please refer to Figure 2 , Figure 2 Fig. 1 shows a flowchart of a data processing method based on a blockchain network provided by an exemplary embodiment of the present application; the data processing method can be performed by the holding node 104 in the system shown in Fig. 1, and the data processing method includes but is not limited to steps S201-S204: Figure 1d
[0095] S201: sending a first data sorting request to a consensus node of the blockchain network, and receiving declaration data related to the holding node in the blockchain network returned by the consensus node in response to the first data sorting request.
[0096] The first data clearing request is used to request clearing the declaration data related to the holding node from the consensus node. The declaration data related to the holding node refers to verifiable claims (VC), which is a declaration file endorsed by an issuing node according to the attribute of the holding node corresponding to an object identifier. For example, in the education certification scenario, the issuing node can be a node used by a school, and the declaration data refers to a diploma issued by the school according to the identity identifier DID (such as student ID, number, etc.) of the student. Specifically, the first data clearing request can carry the object identifier corresponding to the holding node, so that the consensus node can clear the declaration data related to the holding node from the blockchain according to the identity identifier DID carried in the first data clearing request. The object identifier corresponding to the holding node can refer to the identity identifier DID of the target user who applies for declaration using the holding node, which is an identity identifier used to represent the identity of the target user. The identity identifier can be a string composed of multiple characters, which can include at least one of the following: Chinese characters (i.e. Chinese characters), English characters (i.e. letters), numbers and punctuation marks (such as comma “,”, period “.”, square brackets “【】”).
[0097] S202: generating the identity expression data corresponding to the holding node according to the declaration data.
[0098] S203: setting the first visible node identifier capable of accessing the identity expression data.
[0099] In steps S202-S203, the identity expression data can refer to verifiable presentation (VP), which is generated by the holding node according to the declaration data, and is a kind of data used to represent the identity of the holding node. Specifically, after obtaining the declaration data from the consensus node, the holding node can sign the declaration data to generate the identity expression data corresponding to the holding node. Signing the declaration data can refer to digitally signing the declaration data. The digital signature is a digital string that only the information sender (such as the holding node) can produce and cannot be forged by others, which is also a valid proof of the authenticity of the information sent by the information sender. The method of digital signature can include but is not limited to: HASH algorithm (such as Message-Digest (MD), Secure Hash Algorithm (SHA), Digital Signature Algorithm (DSA), ECDSA (Elliptic Curve Digital Signature Algorithm), elliptic curve digital signature algorithm, etc.); the present application does not limit which digital signature algorithm is used to sign the declaration data.
[0100] For example, signing the declaration data (such as the diploma of the student "Xiaoming") in the diploma authentication scenario can include: the student "Xiaoming" signs the diploma by holding the node to generate the signed diploma (i.e., identity expression data); since the signed diploma contains the digital signature of the student "Xiaoming", the authenticity of the signed diploma can be effectively proved based on the signed diploma.
[0101] Embodiments of the present application also support the holding node to set the visibility of the identity expression data, and the so-called visibility setting can be simply understood as the process of setting the node identifier capable of accessing the identity expression data by the holding node. In the identity authentication scenario, the holding node (specifically, the target user using the holding node) can set different nodes to have the access right of the identity expression data; for example, in the diploma authentication scenario, if the student "Xiaoming" hopes that the recruitment unit A and the recruitment unit B can access his signed diploma, and hopes that the recruitment unit C cannot access his signed diploma, the student "Xiaoming" can set the first visible node identifier capable of accessing the signed diploma to the node identifier corresponding to the recruitment unit A and the recruitment unit B. Through the visibility setting of the identity expression data, only the specified node can access the identity expression data, which greatly reduces the risk of identity expression data leakage and improves the security of the data.
[0102] S204: Store the identity expression data and the first visible node identifier to the block chain of the block chain network.
[0103] Specifically, expression transaction data can be generated based on the identity expression data and the first visible node identifier, and the expression transaction data is sent to a consensus node in the blockchain network, so that the consensus node generates a block based on the expression transaction data, and adds the block to the blockchain, thereby storing the identity expression data and the first visible node identifier in the blockchain of the blockchain network. It should be noted that the present application embodiment supports setting multiple first visible node identifiers that can access the identity expression data, so that the expression transaction data provided by the present application embodiment can include a visible list, and the visible list includes one or more first visible node identifiers that can access the identity expression data; when there is an access request for accessing the identity expression data, the consensus node can perform identification hit processing on the visible list according to the visible list included in the expression transaction data, to detect whether the access node sending the access request has the access right of the identity expression data, if the node identifier of the access node sending the access request is included in the visible list, it is determined that the access node has the access right of the identity expression data, and the expression transaction data including the identity expression data is sent to the access node; otherwise, if the node identifier of the access node sending the access request is not included in the visible list, it is determined that the access node does not have the access right of the identity expression data.
[0104] An example process for determining whether an access node accesses identity expression data by determining whether the node identifier of the access node is included in a visible list can be seen from Figure 3 As shown in Figure 3 The visible list 301 includes the first visible node identifier 1, the first visible node identifier 2, …, the first visible node identifier N, and N is an integer greater than 2; when the consensus node 102 receives the access request for accessing the identity expression data sent by the access node 302, the consensus node 102 can perform identification hit processing on the visible list 301 according to the node identifier of the access node 302, specifically, the visible list 301 can be traversed; if the node identifier of the access node 302 exists in the process of traversing the visible list 301, it is determined that the node identifier of the access node 302 is the first visible node identifier, indicating that the access node 302 can access the identity expression data, and the expression transaction data is returned to the access node 302; otherwise, if no first visible node identifier is detected to be the same as the node identifier of the access node 301 after traversing the visible list 301, it is determined that the access node 302 cannot access the identity expression data.
[0105] In the embodiments of the present application, the holding node can send a first data clearing request to the consensus node, so that the consensus node clears and returns the declaration data related to the holding node from the blockchain in response to the first data clearing request; the holding node generates identity expression data based on the declaration data, and stores the identity expression data and the first visible node identifier that can access the identity expression data into the blockchain of the blockchain network. In the above scheme, the declaration data related to the holding node and the identity expression data are stored in the blockchain of the blockchain network, realizing the decentralized storage of the declaration data and the identity expression data, and through the data clearing capability of the holding node, the data flow process of the declaration data and the identity expression data and the setting of the visible node on the blockchain, so that only the specified node can access the declaration data and the identity expression data, effectively reducing the risk of data leakage and improving the security of the data.
[0106] Please refer to Figure 4 , Figure 4 A flowchart of a data processing method based on a blockchain network is shown, which is provided by an example embodiment of the present application; the data processing method can be executed by the consensus node 102 in the system shown in Figure 1d The data processing method includes but is not limited to steps S401-S403:
[0107] S401: receiving a first data clearing request sent by a holding node in a blockchain network.
[0108] S402: clearing the declaration data related to the holding node in response to the first data clearing request, and returning the declaration data to the holding node.
[0109] As described above, if the holding node is a light node, it has the ability to clear the declared data associated with itself from the consensus network. Therefore, when a target user using the holding node needs to retrieve declared data from the blockchain, the target user can send a first data clearing request to a consensus node in the blockchain network through the holding node. The consensus node will then respond to the first data clearing request, clear the data, and return the declared data associated with the holding node. It should be noted that the consensus node receiving the first data clearing request can be the consensus node in the blockchain network that is closest to the holding node, thus improving data transmission efficiency. Alternatively, the consensus node can also be the node with the highest network signal in the blockchain network, ensuring the speed and stability of data transmission. Alternatively, the consensus node can connect to one or more light nodes. The consensus node can communicate directly or indirectly with these connected light nodes to achieve data transmission. In this implementation, the holding node can send a first data clearing request to a light node connected to the consensus node, and then clear the declared data related to the holding node from the consensus node through that light node. For example, if the consensus node is connected to light node 1, and light node 1 is connected to light node 2, the holding node can send the first data clearing request to light node 2, thus indirectly clearing the declared data related to the holding node from the consensus node through light node 2 and light node 1. This application embodiment does not limit the specific type of consensus node receiving the first data clearing request; this is only a description of the specific circumstances described above.
[0110] The following is combined with Figure 5 The flowchart shown illustrates the data clearing process, explaining how to clear the declared data related to the holding node from the consensus nodes. Figure 5 The lower-level nodes shown are holding nodes (or verification nodes), and the upper-level nodes are consensus nodes or light nodes connected to consensus nodes; the data clearing process may include:
[0111] The first data clearing request is used to request clearing the declaration data related to the holding node, and the first data clearing request includes the to-be-processed block height h1 of the to-be-processed block expected to be synchronized by the holding node, wherein h1 is an integer greater than zero; the to-be-processed block height h1 is the highest block height h0 of the block chain currently contained in the holding node plus 1. In a specific implementation, the sub-block chain contained in the holding node is not the same as the block chain contained in the consensus node, the block chain contained in the holding node only stores part of the data related to the holding node, and the block chain contained in the consensus node stores all the data in the block chain network, so the to-be-processed block expected to be synchronized by the holding node is often the next block that has not been synchronized in the sub-block chain contained in the holding node; for example, if the current highest block height of the sub-block chain contained in the holding node is 5, then the to-be-processed block height h1 of the to-be-processed block expected to be synchronized by the holding node is 6.
[0112] The consensus node receives the first data clearing request, and in response to the first data clearing request, obtains the highest block height H1 of the block chain, wherein H1 is an integer greater than 1; and performs data clearing processing on the block chain according to the to-be-processed block height h1 and the obtained highest block height H1, to obtain the declaration data related to the holding node. In detail, the consensus node compares whether the to-be-processed block height h1 and the obtained highest block height H1 satisfy a height condition; wherein the to-be-processed block height h1 and the highest block height H1 satisfy the height condition means that: if the node type of the consensus node is a light node, that is, the light node connected to the consensus node receives the first data clearing request, then the to-be-processed block height h1 is less than or equal to the highest block height H1; or, if the node type of the consensus node is a full node, that is, the consensus node itself receives the first data clearing request, then the to-be-processed block height h1 is less than the highest block height H1.
[0113] If the height condition is not met between the to-be-processed block height h1 and the obtained highest block height H1, it indicates that the to-be-processed block height of the to-be-processed block requested by the holding node is too high, that is, the blockchain contained in the consensus node has not been synchronized to the to-be-processed block corresponding to the to-be-processed block height, and a notification message is returned to the holding node to prompt the holding node that the to-be-processed block corresponding to the to-be-processed block height has not been synchronized. If the height condition is met between the to-be-processed block height h1 and the obtained highest block height H1, it indicates that the blockchain contained in the consensus node has been synchronized to the to-be-processed block corresponding to the to-be-processed block height, and the to-be-processed block corresponding to the to-be-processed block height is obtained from the blockchain, and the first candidate transaction data contained in the to-be-processed block is subjected to visibility detection to obtain a first visibility detection result. The visibility detection on the first candidate transaction data contained in the to-be-processed block can include: querying the smart contract corresponding to the first candidate transaction data, the smart contract containing an IsReadable function for performing visibility detection on the first candidate transaction data; calling the IsReadable function to perform identification hit processing in the visibility list contained in the first candidate transaction data to detect whether the node identifier of the holding node is contained in the visibility list; and generating the first visibility detection result according to the hit result of the identification hit processing and the data contained in the first candidate transaction data.
[0114] ③Judging whether the first visibility detection result meets a visibility condition. The first visibility detection result meeting the visibility condition includes that the holding node can access the first candidate transaction data, that is, the visibility list in the first candidate transaction data contains the node identifier of the holding node, and the data contained in the first candidate transaction data is declaration data. The first visibility detection result not meeting the visibility condition includes that the holding node cannot access the first candidate transaction data, that is, the visibility list in the first candidate transaction data does not contain the node identifier of the holding node; or the holding node can access the first candidate transaction data, and the first candidate transaction data does not contain declaration data; or the smart contract does not contain the IsReadable function; or an exception occurs in the process of calling the IsReadable function; and the like. The specific conditions in which the first visibility detection result does not meet the visibility condition are not limited in the embodiments of the present application.
[0115] If the first visibility detection result satisfies the visibility condition, the first candidate transaction data is determined as the declaration data related to the holding node, and the first candidate transaction data is returned to the holding node. Otherwise, if the first visibility detection result does not satisfy the visibility condition, the holding node queries the invisible reason why the first candidate transaction data cannot be accessed. When the invisible reason is that the node identifier of the holding node is not included in the first candidate transaction data, it indicates that the holding node is not set as a node that can access the first candidate transaction data. When the invisible reason is that the holding node can access the first candidate transaction data, and the first candidate transaction data does not include the declaration data. When the invisible reason is that the smart contract does not include the IsReadable function, the new to-be-processed block height h1 is set to h1+1, and the highest block height H2 of the updated blockchain in the blockchain network is obtained. H2 is an integer greater than 1. If the height condition is satisfied between the new to-be-processed block height h1 and the block height H2, the step of performing data sorting processing to obtain the declaration data related to the holding node according to the new to-be-processed block height h1 and the block height H2 is continued. When the invisible reason is that an exception occurs in the process of calling the IsReadable function, or other reasons, the data sorting processing is terminated, and an error notification is sent to the holding node. The error notification is used to inform the holding node that the current data sorting processing has an exception, and needs to be repaired and retried.
[0116] Through the specific implementation process shown in steps ①-③, the holding node can sort the declaration data related to the holding node from the consensus node. This method of using the data sorting capability of the light node SPV (such as the holding node) to sort only the data related to the holding node (such as the declaration data) from the consensus node ensures the security of the data that cannot be accessed by the holding node to a certain extent, and reduces the storage of irrelevant data by the holding node, thereby reducing the storage pressure.
[0117] S403: receiving the first storage request sent by the holding node, and storing the identity expression data and the first visible node identifier included in the first storage request to the blockchain of the blockchain network in response to the first storage request.
[0118] Specifically, the first storage request carries the identity expression data generated by the holding node and the first visible node identifier capable of accessing the identity expression data set, and the identity expression data and the first visible node identifier are consensus, where the consensus can check the correctness of the identity expression data, such as checking whether the identity expression data is generated by the holding node signature, checking whether the identity expression data meets the legal and moral requirements, and the like; and a new block is generated after the consensus is successful, and the new block is added to the block chain, realizing the storage of the identity expression data and the first visible node identifier to the block chain of the block chain network, and improving the security of the storage and circulation of the identity expression data and the first visible node identifier.
[0119] In the embodiment of the application, the consensus node can receive the first data clearing request sent by the holding node, and clear the declaration data related to the holding node from the block chain in response to the first data clearing request, which avoids clearing the data unrelated to the holding node to the holding node, maintains the security of the data stored in the block chain, and also reduces the storage pressure of the holding node; the consensus node can also receive the first storage request sent by the holding node, and generate a block of the identity expression data and the first visible node identifier after the consensus of the identity expression data carried in the first storage request is successful, and add it to the block chain, which can improve the security of the identity expression data and the first visible node identifier.
[0120] Please refer to Figure 6 , Figure 6 A flowchart of a data processing method based on a block chain network is shown, which is provided by an example embodiment of the application; the data processing method can be executed by the consensus node 102, the issuing node 103, the holding node 104 and the verification node 105 in the system shown in Figure 1d The data processing method includes but is not limited to steps S601-S613:
[0121] S601: The holding node sends a declaration application request to the issuing node in the block chain network.
[0122] S602: The issuing node responds to the declaration application request to perform response processing.
[0123] S603: The issuing node sends a second storage request to the consensus node.
[0124] When the target user using the holding node has a demand for applying for declaration data, the target user can send a declaration application request to the issuing node through the holding node, so that the issuing node performs response processing according to the declaration application request to generate declaration data corresponding to the holding node, and stores the declaration data to the blockchain. The declaration application request contains the object identifier corresponding to the holding node of the to-be-applied declaration data and the candidate object data. The candidate object data can refer to the identity information of the target user using the holding node to apply for declaration, such as user name, user gender, user age, and the like.
[0125] Specifically, the response processing procedure of the issuing node responding to the declaration application request can include: first, identity verification processing is performed on the holding node according to the declaration application request to obtain an identity verification result. The process of the identity verification processing can simply include: sending an identity query request to the consensus node by the issuing node, the identity query request carrying the object identifier corresponding to the holding node, the consensus node querying and returning reference object data associated with the object identifier in response to the identity query request, so that the issuing node can receive the reference object data associated with the object identifier returned by the consensus node, and then compare the reference object data with the candidate object data to obtain the identity verification result; if the reference object data matches the candidate object data, it is determined that the identity verification result is identity verification success, otherwise, if the reference object data does not match the candidate object data, it is determined that the identity verification result is identity verification failure. Secondly, if the identity verification result is identity verification success, it indicates that the identity verification of the holding node by the issuing node is successful, then the declaration data corresponding to the holding node is generated, and the second visible node identifier capable of accessing the declaration data is set; wherein the issuing node includes a public key infrastructure (PKI), which can bind the related secret key pair and the identity of the certificate holder to each other to provide the user with a convenient related certificate management function. Based on this, the issuing node can use the PKI to issue declaration data for the holding node. Finally, the issuing node stores the declaration data and the second visible node identifier to the blockchain; specifically, after the issuing node issues the declaration data for the holding node and sets the second visible node identifier capable of accessing the declaration data, the issuing node can generate a second storage request based on the declaration data and the second visible node identifier, and send the second storage request to the consensus node, so that the consensus node stores the declaration data and the second visible node identifier to the blockchain.
[0126] S604: The consensus node stores the declaration data and the second visible node identifier to the blockchain in response to the second storage request.
[0127] The consensus node, after receiving the second storage request sent by the issuing node, responds to the second storage request to reach consensus on the declaration data and the second visible node identifier carried in the second storage request, generates a new block based on the declaration data and the second visible node identifier after the consensus is successful, and adds the new block to the block chain, to realize the on-chain storage of the declaration data and the second visible node identifier, and improve the security of storage and circulation of the declaration data and the second visible node identifier. Wherein, the consensus node reaches consensus on the declaration data and the second visible node identifier is to verify the correctness of the declaration data and the second visible node identifier, and the specific consensus verification process is not limited in the embodiments of the present application, which is described herein.
[0128] S605: The holding node sends a first data clearing request to the consensus node.
[0129] S606: The consensus node clears the declaration data related to the holding node in response to the first data clearing request.
[0130] S607: The consensus node returns the declaration data related to the holding node obtained by clearing to the holding node.
[0131] S608: The holding node generates identity expression data corresponding to the holding node according to the declaration data, and sets a first visible node identifier that can access the identity expression data.
[0132] S609: The holding node sends a first storage request to the consensus node.
[0133] S610: The consensus node stores the identity expression data and the first visible node identifier to the block chain in response to the first storage request.
[0134] It should be noted that the specific implementation process shown in steps S65-S610 can refer to the related description of the specific implementation process in the embodiments shown in Figure 2 and Figure 4 The specific implementation process is not described herein.
[0135] S611: The verification node sends a second data clearing request to the consensus node.
[0136] S612: The consensus node clears the identity expression data related to the verification node in response to the second data clearing request.
[0137] S613: The consensus node returns the identity expression data obtained by clearing to the verification node, so that the verification node performs identity verification on the holding node according to the identity expression data.
[0138] When the verification node has the demand to obtain the identity expression data of the holding node, such as in the academic authentication scenario, the employer often has the demand to obtain the signed academic certificate of the student "Xiao Ming", the verification node can send a second data clearing request to the consensus node, and the second data clearing request is used to request the identity expression data related to the verification node. The consensus node receives the second data clearing request sent by the verification node, responds to the second data clearing request to clear the identity expression data related to the verification node, and returns the identity expression data to the verification node, specifically returns the identity expression data and the first visible node identifier capable of accessing the identity expression data (or expression transaction data generated based on the identity expression data and the first visible node identifier capable of accessing the identity expression data) to the verification node, so that the verification node can perform identity verification on the holding node based on the identity expression data and the first visible node identifier capable of accessing the identity expression data. The specific implementation of the consensus node performing data clearing processing according to the second data clearing request can be referred to the flowchart of the data clearing processing shown in FIG. 13, and details are not described herein. Figure 5
[0139] For example, in the academic authentication scenario, assuming that the verification node is the employer X, when the employer X has the demand to invite the student "Xiao Ming" to submit a resume, the employer X can send a second data clearing request to the consensus node, and the second data clearing request can carry the identity identifier DID of the student "Xiao Ming", so that the consensus node can respond to the second data clearing request to clear the signed academic certificate (such as identity expression data) of the student "Xiao Ming", and return the academic certificate to the employer X, so as to verify the authenticity of the academic certificate.
[0140] It should be noted that when the verification node wants to obtain the identity expression data of all users related to itself in the blockchain, the second data clearing request sent by the verification node can also carry the identity identifiers DID of all users, or the second data clearing request does not carry the identity identifier DID of any user, but only carries the node identifier of the verification node, so that the consensus node can return all identity expression data related to the verification node stored in the blockchain. The application embodiments do not limit what kind or multiple kinds of content are carried in the second data clearing request. In addition, the process of identity verification performed by the verification node based on the identity expression data is related to the specific identity authentication scenario, and the application embodiments do not limit the process of identity verification performed by the verification node. In addition, the verification node is a node that has the demand to verify the identity expression data, so that the issuing node and the holding node in the blockchain network can also be the verification node, and the application embodiments do not limit the verification node.
[0141] In the embodiments of the present application, after issuing the declaration data of the holding node, the issuing node can chain the declaration data to the blockchain, so that the holding node can obtain the declaration data from the blockchain, and after signing the declaration data, the identity expression data obtained by signing is chained to the blockchain, so that the identity expression data is obtained from the blockchain by the verification node. In the above scheme, the declaration data and the identity expression data related to the holding node are stored in the blockchain of the blockchain network, realizing the decentralized storage of the declaration data and the identity expression data, and through the data clearing ability of the holding node, the data flow process of the declaration data and the identity expression data on the blockchain and the setting of the visible node, only the specified node can access the declaration data and the identity expression data, effectively reducing the risk of data leakage and improving the security of the data.
[0142] The above describes the method of the embodiments of the present application in detail. In order to better implement the above method of the embodiments of the present application, correspondingly, the device of the embodiments of the present application is provided below.
[0143] Figure 7 A structure diagram of a data processing device based on a blockchain network is shown, which can be a computer program (including program code) running in a holding node; the data processing device based on the blockchain network can be used to execute part or all of the steps in the method embodiments shown in Figure 2 、 Figure 6 The data processing device based on the blockchain network includes the following units:
[0144] The sending unit 701 is configured to send a first data clearing request to the consensus node of the blockchain network, and receive the declaration data related to the holding node in the blockchain network returned by the consensus node in response to the first data clearing request;
[0145] The processing unit 702 is configured to generate the identity expression data corresponding to the holding node according to the declaration data, and the identity expression data is used to indicate the identity of the holding node;
[0146] The processing unit 702 is further configured to set the first visible node identifier capable of accessing the identity expression data;
[0147] The processing unit 702 is further configured to store the identity expression data and the visible node identifier to the blockchain of the blockchain network.
[0148] In an implementation manner, when the processing unit 702 is configured to generate the identity expression data corresponding to the holding node according to the declaration data, the processing unit 702 is specifically configured to:
[0149] Sign the declaration data to generate the identity expression data corresponding to the holding node.
[0150] In an implementation manner, the processing unit 702 is further configured to:
[0151] send a declaration application request to an issuing node of the blockchain network, so that the issuing node performs a response process according to the declaration application request to store the declaration data into the blockchain.
[0152] In an implementation manner, the declaration application request carries the object identifier corresponding to the holding node and the candidate object data; and the response process includes:
[0153] performing an identity verification process on the holding node according to the declaration application request to obtain an identity verification result;
[0154] if the identity verification result is identity verification success, generating the declaration data corresponding to the holding node, and setting a second visible node identifier capable of accessing the declaration data;
[0155] storing the declaration data and the second visible node identifier into the blockchain.
[0156] In an implementation manner, the identity verification process includes:
[0157] sending, by the issuing node, an identity query request to a consensus node, the identity query request carrying the object identifier corresponding to the holding node;
[0158] receiving reference object data associated with the object identifier returned by the consensus node;
[0159] comparing the reference object data with the candidate object data to obtain the identity verification result.
[0160] In an implementation manner, when the processing unit 702 stores the identity expression data and the first visible node identifier into the blockchain, the processing unit 702 is specifically configured to:
[0161] generating expression transaction data based on the identity expression data and the first visible node identifier;
[0162] sending the expression transaction data to the consensus node, so that the consensus node generates a block based on the expression transaction data, and adds the block into the blockchain.
[0163] According to an embodiment of the present application, Figure 7The various units in the illustrated blockchain network-based data processing apparatus can be combined into one or several other units respectively or all, or some of the units can be further split into a plurality of units that are functionally smaller, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the blockchain network-based data processing apparatus can also include other units. In actual applications, these functions can also be assisted by other units, and can be implemented by multiple units in cooperation. According to another embodiment of the present application, the blockchain network-based data processing apparatus as shown in Figure 2 、 Figure 6 The computer program (including program codes) related to the steps of the corresponding method as shown in Figure 7 can be used to construct the blockchain network-based data processing apparatus as shown in
[0164] In the embodiments of the present application, the sending unit 701 can send a first data clearing request to the consensus node, so that the consensus node responds to the first data clearing request to clear and return the declaration data related to the holding node from the blockchain; the processing unit 702 generates identity expression data based on the declaration data, and stores the identity expression data and the first visible node identifier capable of accessing the identity expression data into the blockchain of the blockchain network. In the above scheme, the declaration data related to the holding node and the identity expression data are stored in the blockchain of the blockchain network, realizing the decentralized storage of the declaration data and the identity expression data. Through the data clearing capability of the holding node, the data flow and the setting of the visible node of the declaration data and the identity expression data are performed on the blockchain, so that only the specified visible node can access the declaration data and the identity expression data, effectively reducing the risk of data leakage and improving the security of the data.
[0165] Figure 8 The structure of a blockchain network-based data processing apparatus provided by an exemplary embodiment of the present application is shown in the structure diagram. The blockchain network-based data processing apparatus can be a computer program (including program codes) running in a holding node; the blockchain network-based data processing apparatus can be used to execute Figure 4 、 Figure 6Part or all of the steps in the method embodiments shown, the data processing apparatus based on the blockchain network comprises the following units:
[0166] The receiving unit 801 is configured to receive a first data clearing request sent by a holding node in the blockchain network, the first data clearing request being used to request to clear declaration data related to the holding node;
[0167] The processing unit 802 is configured to clear the declaration data related to the holding node in response to the first data clearing request, and return the declaration data to the holding node, so that the holding node generates identity expression data corresponding to the holding node according to the declaration data, the identity expression data being used to indicate the identity of the holding node, and set a first visible node identifier capable of accessing the identity expression data.
[0168] The processing unit 802 is further configured to receive a first storage request sent by the holding node, and in response to the first storage request, store the identity expression data and the first visible node identifier contained in the first storage request to the blockchain of the blockchain network.
[0169] In an implementation manner, the first data clearing request includes a to-be-processed block height h1 expected to be synchronized by the holding node, h1 being an integer greater than zero; when the processing unit 802 is used to clear the declaration data related to the holding node in response to the first data clearing request, the processing unit 802 is specifically configured to:
[0170] Obtain a highest block height H1 of the blockchain, H1 being an integer greater than 1;
[0171] According to the to-be-processed block height h1 and the highest block height H1, the blockchain is subjected to data clearing processing to obtain the declaration data related to the holding node.
[0172] In an implementation manner, when the processing unit 802 is used to clear the declaration data related to the holding node according to the to-be-processed block height h1 and the highest block height H1, the processing unit 802 is specifically configured to:
[0173] If the to-be-processed block height h1 and the highest block height H1 satisfy a height condition, the to-be-processed block corresponding to the to-be-processed block height h1 in the blockchain is obtained; wherein the to-be-processed block height h1 and the highest block height H1 satisfy the height condition, including: if the node type of the consensus node is a light node, the to-be-processed block height h1 is less than or equal to the highest block height H1; or, if the node type of the consensus node is a full node, the to-be-processed block height h1 is less than the highest block height H1;
[0174] The first candidate transaction data contained in the to-be-processed block is subjected to visibility detection to obtain a first visibility detection result;
[0175] If the first visibility detection result satisfies the visibility condition, the first candidate transaction data is determined as the declaration data related to the holding node; wherein the first visibility detection result satisfying the visibility condition includes that the holding node can access the first candidate transaction data, and the first candidate transaction data contains the declaration data;
[0176] If the first visibility detection result does not satisfy the visibility condition, a new to-be-processed block height h1 is set to h1+1, and the highest block height H2 of the updated blockchain in the blockchain network is obtained, H2 is an integer greater than 1, and if the height condition is satisfied between the new to-be-processed block height h1 and the block height H2, the step of obtaining the declaration data related to the holding node according to the new to-be-processed block height h1 and the block height H2 is continued.
[0177] In an implementation manner, the processing unit 802 is further configured to:
[0178] receive a second storage request sent by an issuing node in the blockchain network, the second storage request carrying the declaration data corresponding to the holding node and a second visible node identifier capable of accessing the declaration data;
[0179] In response to the second storage request, the declaration data and the second visible node identifier are stored to the blockchain.
[0180] In an implementation manner, the processing unit 802 is further configured to:
[0181] receive a second data sorting request sent by a verification node in the blockchain network, the second data sorting request being used for requesting identity expression data related to the verification node;
[0182] In response to the second data sorting request, the identity expression data related to the verification node is sorted;
[0183] The identity expression data is returned to the verification node, so that the verification node performs identity verification processing on the holding node based on the identity expression data.
[0184] According to an embodiment of the present application, Figure 8The various units in the illustrated blockchain network-based data processing apparatus can be combined into one or several other units respectively or in total, or some of the units can be further split into a plurality of units with smaller functions to constitute, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the blockchain network-based data processing apparatus can also include other units. In actual applications, these functions can also be assisted by other units, and can be implemented by multiple units in cooperation. According to another embodiment of the present application, the blockchain network-based data processing apparatus can be constructed by running a computer program (including program codes) capable of performing the steps of the corresponding method illustrated in Figure 4 、 Figure 6 The corresponding method illustrated in Figure 8 The computer program (including program codes) of the steps involved in the corresponding method illustrated in
[0185] In the embodiments of the present application, the receiving unit 801 can receive the first data clearing request sent by the holding node, and the processing unit 802 can clear the declaration data related to the holding node from the blockchain in response to the first data clearing request, which avoids clearing the data unrelated to the holding node to the holding node, maintains the security of the data stored in the blockchain, and also reduces the storage pressure of the holding node; the consensus node can also receive the first storage request sent by the holding node, and after the consensus of the identity expression data carried in the first storage request is successful, the identity expression data and the first visible node identifier are generated into a block and added to the blockchain. This way of storing the identity expression data and the first visible node identifier in the blockchain can improve the security of the identity expression data and the first visible node identifier.
[0186] Figure 9 A structure diagram of a blockchain network-based data processing device provided by an exemplary embodiment of the present application is shown. Please refer to Figure 9The terminal includes a processor 901, a communication interface 902, and a computer readable storage medium 903. The processor 901, the communication interface 902, and the computer readable storage medium 903 can be connected through a bus or other means. The communication interface 902 is configured to receive and send data. The computer readable storage medium 903 can be stored in the memory of the terminal, and the computer readable storage medium 903 is configured to store a computer program including program instructions, and the processor 901 is configured to execute the program instructions stored in the computer readable storage medium 903. The processor 901 (also referred to as a CPU (Central Processing Unit, central processor)) is the computing core and control core of the terminal, and is adapted to implement one or more instructions, and is specifically adapted to load and execute one or more instructions to implement a corresponding method flow or a corresponding function.
[0187] The embodiment of the present application also provides a computer readable storage medium (Memory), which is a memory device in a terminal and is used to store programs and data. It can be understood that the computer readable storage medium herein can include a built-in storage medium in the terminal, and of course can also include an extended storage medium supported by the terminal. The computer readable storage medium provides a storage space, and the storage space stores a processing system of the terminal. In addition, one or more instructions adapted to be loaded and executed by the processor 901 are also stored in the storage space, and the instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium herein can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory; optionally, it can also be at least one computer readable storage medium located away from the aforementioned processor.
[0188] In one embodiment, the computer readable storage medium stores one or more instructions; the processor 901 loads and executes the one or more instructions stored in the computer readable storage medium to implement the corresponding steps in the above-mentioned blockchain network-based data processing method embodiment; in a specific implementation, the one or more instructions in the computer readable storage medium are loaded and executed by the processor 901 to perform the following steps:
[0189] sending a first data clearing request to a consensus node of the blockchain network, and receiving declared data related to a holding node in the blockchain network returned by the consensus node in response to the first data clearing request;
[0190] generating identity expression data corresponding to the holding node according to the declared data, the identity expression data being used to indicate the identity of the holding node;
[0191] setting a first visible node identifier capable of accessing the identity expression data;
[0192] The identity expression data and the visible node identifier are stored to a blockchain of the blockchain network.
[0193] In an implementation, one or more instructions in the computer-readable storage medium are loaded by the processor 901 and executed to generate the identity expression data corresponding to the holding node according to the declaration data, and specifically perform the following steps:
[0194] The declaration data is signed to generate the identity expression data corresponding to the holding node.
[0195] In an implementation, one or more instructions in the computer-readable storage medium are loaded by the processor 901 and further perform the following steps:
[0196] The declaration application request is sent to an issuing node of the blockchain network, so that the issuing node performs a response process according to the declaration application request to store the declaration data to the blockchain.
[0197] In an implementation, the declaration application request carries the object identifier corresponding to the holding node and the candidate object data; the response process includes:
[0198] Identity verification processing is performed on the holding node according to the declaration application request to obtain an identity verification result;
[0199] If the identity verification result is identity verification success, the declaration data corresponding to the holding node is generated, and a second visible node identifier capable of accessing the declaration data is set;
[0200] The declaration data and the second visible node identifier are stored to the blockchain.
[0201] In an implementation, the identity verification processing includes:
[0202] An identity query request is sent by the issuing node to a consensus node, and the identity query request carries the object identifier corresponding to the holding node;
[0203] Reference object data associated with the object identifier is received from the consensus node;
[0204] The reference object data is compared with the candidate object data to obtain the identity verification result.
[0205] In an implementation, one or more instructions in the computer-readable storage medium are loaded by the processor 901 and executed to store the identity expression data and the first visible node identifier to the blockchain, and specifically perform the following steps:
[0206] Expression transaction data is generated based on the identity expression data and the first visible node identifier;
[0207] The expression transaction data is sent to a consensus node, so that the consensus node generates a block based on the expression transaction data and adds the block to a blockchain.
[0208] In another embodiment, the computer readable storage medium stores one or more instructions; the processor 901 loads and executes the one or more instructions stored in the computer readable storage medium to implement the corresponding steps in the above-mentioned blockchain network-based data processing method embodiments; in a specific implementation, the processor 901 loads and executes the one or more instructions in the computer readable storage medium to implement the following steps:
[0209] Receive a first data clearing request sent by a holding node in the blockchain network, the first data clearing request being used to request to clear declaration data related to the holding node;
[0210] In response to the first data clearing request, clear the declaration data related to the holding node, and return the declaration data to the holding node, so that the holding node generates identity expression data corresponding to the holding node according to the declaration data, the identity expression data being used to indicate the identity of the holding node, and set a first visible node identifier capable of accessing the identity expression data;
[0211] Receive a first storage request sent by the holding node, and in response to the first storage request, store the identity expression data and the first visible node identifier included in the first storage request to the blockchain of the blockchain network.
[0212] In an implementation manner, the first data clearing request includes a to-be-processed block height h1 of a to-be-processed block expected to be synchronized by the holding node, h1 being an integer greater than zero; when the processor 901 loads and executes the one or more instructions in the computer readable storage medium to clear the declaration data related to the holding node in response to the first data clearing request, the following steps are specifically executed:
[0213] Obtain a highest block height H1 of the blockchain, H1 being an integer greater than 1;
[0214] According to the to-be-processed block height h1 and the highest block height H1, perform data clearing processing on the blockchain to obtain the declaration data related to the holding node.
[0215] In an implementation manner, when the processor 901 loads and executes the one or more instructions in the computer readable storage medium to clear the declaration data related to the holding node according to the to-be-processed block height h1 and the highest block height H1, the following steps are specifically executed:
[0216] If the height condition is met between the to-be-processed block height h1 and the highest block height H1, a to-be-processed block corresponding to the to-be-processed block height h1 in the block chain is obtained; the height condition met between the to-be-processed block height h1 and the highest block height H1 includes: if the node type of the consensus node is a light node, the to-be-processed block height h1 is less than or equal to the highest block height H1; or, if the node type of the consensus node is a full node, the to-be-processed block height h1 is less than the highest block height H1;
[0217] Performing visibility detection on the first candidate transaction data contained in the to-be-processed block to obtain a first visibility detection result;
[0218] If the first visibility detection result meets the visibility condition, the first candidate transaction data is determined as the declaration data related to the holding node; the visibility condition met by the first visibility detection result includes that the holding node can access the first candidate transaction data, and the first candidate transaction data contains the declaration data;
[0219] If the first visibility detection result does not meet the visibility condition, a new to-be-processed block height h1 is set to h1+1, and the highest block height H2 of the updated block chain in the block chain network is obtained, H2 is an integer greater than 1, if the height condition is met between the new to-be-processed block height h1 and the block height H2, the step of performing data clearing processing according to the new to-be-processed block height h1 and the block height H2 to obtain the declaration data related to the holding node is continued.
[0220] In an implementation manner, the one or more instructions in the computer readable storage medium are loaded by the processor 901 and further perform the following steps:
[0221] Receiving a second storage request sent by an issuing node in the block chain network, the second storage request carrying the declaration data corresponding to the holding node and a second visible node identifier capable of accessing the declaration data;
[0222] In response to the second storage request, the declaration data and the second visible node identifier are stored to the block chain.
[0223] In an implementation manner, the one or more instructions in the computer readable storage medium are loaded by the processor 901 and further perform the following steps:
[0224] Receiving a second data clearing request sent by a verification node in the block chain network, the second data clearing request being used to request identity expression data related to the verification node;
[0225] In response to the second data clearing request, the identity expression data related to the verification node is cleared;
[0226] The identity expression data is returned to the verification node, so that the verification node performs identity authentication processing on the holding node based on the identity expression data.
[0227] In the embodiments of the present application, the holding node can send a first data clearing request to the consensus node, so that the consensus node responds to the first data clearing request to clear and return the declaration data related to the holding node from the blockchain; the holding node generates identity expression data based on the declaration data, and stores the identity expression data and the first visible node identifier capable of accessing the identity expression data into the blockchain of the blockchain network. In the above scheme, the declaration data and the identity expression data related to the holding node are stored in the blockchain of the blockchain network, realizing the decentralized storage of the declaration data and the identity expression data, and through the data clearing capability of the holding node, the data flow of the declaration data and the identity expression data and the setting of the visible node are performed on the blockchain, so that only the specified visible node can access the declaration data and the identity expression data, effectively reducing the risk of data leakage and improving the security of the data.
[0228] The embodiments of the present application also provide a computer program product or a computer program, which includes computer instructions stored in a computer readable storage medium. The processor of the data processing device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the data processing device executes the above-mentioned data processing method based on the blockchain network.
[0229] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software mode depends on the specific application and design constraints of the technical solutions. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0230] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in or transmitted by a computer readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data processing device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk (SSD)) and the like.
[0231] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data processing method based on a blockchain network, characterized in that, The method is executed by a holding node in the blockchain network, and the method comprises: sending a first data clearing request to a consensus node of the blockchain network, and receiving declaration data related to the holding node in the blockchain network returned by the consensus node in response to the first data clearing request; signing the declaration data to generate identity expression data corresponding to the holding node, the identity expression data being used to indicate the identity of the holding node; setting a first visible node identifier capable of accessing the identity expression data; storing the identity expression data and the first visible node identifier to a blockchain of the blockchain network.
2. The method of claim 1, wherein, The method further comprises: sending a declaration application request to an issuing node of the blockchain network, so that the issuing node performs a response process according to the declaration application request to store the declaration data to the blockchain.
3. The method of claim 2, wherein, The declaration application request carries an object identifier corresponding to the holding node and candidate object data; The response process comprises: performing an identity verification process on the holding node according to the declaration application request to obtain an identity verification result; if the identity verification result is identity verification success, generating declaration data corresponding to the holding node, and setting a second visible node identifier capable of accessing the declaration data; storing the declaration data and the second visible node identifier to the blockchain.
4. The method of claim 3, wherein, The identity verification process comprises: sending an identity query request to the consensus node by the issuing node, the identity query request carrying the object identifier corresponding to the holding node; receiving reference object data associated with the object identifier returned by the consensus node; comparing the reference object data with the candidate object data to obtain an identity verification result.
5. The method of claim 1, wherein, The storing of the identity expression data and the first visible node identifier to the blockchain comprises: generating expression transaction data based on the identity expression data and the first visible node identifier; sending the expression transaction data to the consensus node, so that the consensus node generates a block based on the expression transaction data and adds the block to the blockchain. 6.A data processing method based on a blockchain network, characterized in that, The method is executed by a consensus node in the blockchain network, and the method comprises: receiving a first data clearing request sent by a holding node in the blockchain network, the first data clearing request being used to request to clear declaration data related to the holding node; clearing declaration data related to the holding node in response to the first data clearing request, and returning the declaration data to the holding node, so that the holding node signs the declaration data to generate identity expression data corresponding to the holding node and sets a first visible node identifier capable of accessing the identity expression data, the identity expression data being used to indicate the identity of the holding node; receiving a first storage request sent by the holding node, and storing the identity expression data and the first visible node identifier contained in the first storage request to a blockchain of the blockchain network in response to the first storage request.
7. The method of claim 6, wherein, The first data sorting request includes a to-be-processed block height h1 of a to-be-processed block expected to be synchronized by the holding node, and h1 is an integer greater than zero. The response to the first data sorting request includes sorting the declaration data related to the holding node, and the method comprises the following steps: Obtaining the highest block height H1 of the block chain, H1 is an integer greater than 1; According to the to-be-processed block height h1 and the highest block height H1, the block chain is subjected to data sorting processing to obtain the declaration data related to the holding node.
8. The method of claim 7, wherein, According to the to-be-processed block height h1 and the highest block height H1, the block chain is subjected to data sorting processing to obtain the declaration data related to the holding node, which comprises the following steps: If the to-be-processed block height h1 and the highest block height H1 satisfy the height condition, the to-be-processed block corresponding to the to-be-processed block height h1 in the block chain is obtained; wherein the to-be-processed block height h1 and the highest block height H1 satisfy the height condition, which comprises: if the node type of the consensus node is a light node, the to-be-processed block height h1 is less than or equal to the highest block height H1; or if the node type of the consensus node is a full node, the to-be-processed block height h1 is less than the highest block height H1; The first candidate transaction data contained in the to-be-processed block is subjected to visibility detection to obtain a first visibility detection result; If the first visibility detection result satisfies the visibility condition, the first candidate transaction data is determined as the declaration data related to the holding node; wherein the first visibility detection result satisfies the visibility condition, which comprises that the holding node can access the first candidate transaction data, and the first candidate transaction data contains the declaration data; If the first visibility detection result does not satisfy the visibility condition, a new to-be-processed block height h1 is set to h1+1, and the highest block height H2 of the updated block chain in the block chain network is obtained, H2 is an integer greater than 1, if the new to-be-processed block height h1 and the block height H2 satisfy the height condition, the step of performing data sorting processing according to the new to-be-processed block height h1 and the block height H2 to obtain the declaration data related to the holding node is continued.
9. The method of claim 6, wherein, The method further comprises: Receiving a second storage request sent by an issuing node in the block chain network, the second storage request carrying the declaration data corresponding to the holding node and a second visible node identifier capable of accessing the declaration data; In response to the second storage request, the declaration data and the second visible node identifier are stored in the block chain.
10. The method of claim 6, wherein, The method further comprises: Receiving a second data sorting request sent by a verification node in the block chain network, the second data sorting request being used to request identity expression data related to the verification node; In response to the second data sorting request, the identity expression data related to the verification node is sorted. return the identity expression data to the verification node, so that the verification node performs identity authentication processing on the holding node based on the identity expression data. 11.A data processing apparatus based on a blockchain network, characterized in that, The data processing apparatus is mounted in a holding node in the blockchain network, and the data processing apparatus comprises: a sending unit configured to send a first data clearing request to a consensus node of the blockchain network, and receive declaration data related to a holding node in the blockchain network returned by the consensus node in response to the first data clearing request; a processing unit configured to sign the declaration data, and generate identity expression data corresponding to the holding node, the identity expression data being used to indicate the identity of the holding node; the processing unit is further configured to set a first visible node identifier that can access the identity expression data; the processing unit is further configured to store the identity expression data and the first visible node identifier to a blockchain of the blockchain network. 12.A data processing apparatus based on a blockchain network, characterized in that, The data processing apparatus is mounted in a holding node in the blockchain network, and the data processing apparatus comprises: a receiving unit configured to receive a first data clearing request sent by a holding node in the blockchain network, the first data clearing request being used to request to clear declaration data related to the holding node; a processing unit configured to clear declaration data related to the holding node in response to the first data clearing request, and return the declaration data to the holding node, so that the holding node signs the declaration data to generate identity expression data corresponding to the holding node, and set a first visible node identifier that can access the identity expression data, the identity expression data being used to indicate the identity of the holding node; the processing unit is further configured to receive a first storage request sent by the holding node, and store the identity expression data and the first visible node identifier included in the first storage request to a blockchain of the blockchain network in response to the first storage request. 13.A data processing device based on a blockchain network, characterized in that, comprise: a processor adapted to execute a computer program; a computer readable storage medium having a computer program stored therein, the computer program being executed by the processor to implement the blockchain network-based data processing method according to any one of claims 1-5, or implement the blockchain network-based data processing method according to any one of claims 6-10.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, the computer program is adapted to be loaded and executed by the processor to implement the blockchain network-based data processing method according to any one of claims 1-5, or implement the blockchain network-based data processing method according to any one of claims 6-10.
15. A computer program product, characterised in that, The computer program product comprises computer instructions, the computer instructions being executed by the processor to implement the blockchain network-based data processing method according to any one of claims 1-5, or implement the blockchain network-based data processing method according to any one of claims 6-10.
Citation Information
Patent Citations
Method and device for processing data request in blockchain network
CN110535872A
Data processing method, node and block chain system
CN112153085A