Blockchain-based data processing method, related equipment and storage medium
By using groups for permission isolation in the blockchain, the problem of high cost of private chain permission management is solved, and low-cost permission management and high-security data query are achieved.
Patent Information
- Application Number
- CN202110579719.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-26
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-05-26
AI Technical Summary
In blockchain application scenarios, the cost of permission management of private chains is high, and multiple private chains need to be managed, resulting in waste of resources.
By using groups to isolate permissions in the blockchain, role objects in the same group can query transaction data added to the blockchain by role objects in the group when they have data query permissions. The management cost is lower than the management cost of multiple blockchains.
It reduces the permission management cost of the blockchain, saves permission management resources, and improves the security and reliability of data within the group.
Smart Images

Figure CN115409506B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a blockchain-based data processing method, a blockchain-based data processing device, a computer device, and a computer-readable storage medium. Background Art
[0002] With the rapid development of computer technology, blockchain has been widely used in finance, information security, the Internet of Things, and other fields. To ensure the secure and efficient operation of blockchain networks, permission management has become a research hotspot in blockchain application scenarios. Currently, private chains are commonly used for permission isolation in blockchain applications. Private chains are blockchains open to a single individual or entity. Specifically, using private chains for permission isolation means deploying a private chain within an application scenario. Organizations or individuals belonging to the same private chain have relevant permissions (such as query permissions, write permissions, etc.) on that private chain, and private chains are not interconnected. This approach requires the management of multiple private chains, resulting in high permission management costs. Summary of the Invention
[0003] The embodiments of the present application provide a blockchain-based data processing method, related equipment, and storage medium, which can reduce the blockchain's rights management costs and save rights management resources.
[0004] In one aspect, an embodiment of the present application provides a data processing method based on blockchain, the method comprising:
[0005] Get the data query request sent by the data query object. The data query request is used to request to query the target transaction data added to the blockchain by the role object in the target group;
[0006] If the data query object is a role object in the target group, then obtaining a first tag value corresponding to the data query object, where the first tag value is a tag value of the target group generated when the data query object is added to the target group;
[0007] Obtaining a second tag value corresponding to the target transaction data, where the second tag value is the tag value of the target group when the target transaction data is added to the blockchain;
[0008] If it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, the target transaction data is obtained from the blockchain and returned to the data query object.
[0009] In one aspect, an embodiment of the present application provides a blockchain-based data processing device, comprising:
[0010] An acquisition unit, configured to acquire a data query request sent by a data query object, wherein the data query request is used to request to query target transaction data added to the blockchain by a role object in a target group;
[0011] a processing unit, configured to obtain a first tag value corresponding to the data query object if the data query object is a role object in the target group, the first tag value being a tag value of the target group generated when the data query object is added to the target group;
[0012] The processing unit is further configured to obtain a second tag value corresponding to the target transaction data, where the second tag value is a tag value of the target group when the target transaction data is added to the blockchain;
[0013] The processing unit is further configured to obtain the target transaction data from the blockchain and return the target transaction data to the data query object if it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data.
[0014] In one embodiment, the processing unit may be further configured to perform the following steps:
[0015] When the number of role objects in the target group changes, the old label value of the target group is obtained; the old label value is the label value of the target group before the number of role objects in the target group changes;
[0016] A new label value is generated according to the old label value, and the new label value is used as the new label value of the target group after the number of role objects in the target group changes.
[0017] In one embodiment, the acquiring unit may further be configured to perform the following steps: acquiring a group joining request from a group joining object requesting to join a target group;
[0018] The processing unit may further be configured to execute the following steps: if it is determined that the group joining object is allowed to join the target group, then adding the group joining object to the target group, and determining whether there is a change in the number of role objects in the target group.
[0019] In one embodiment, the target group includes N voting objects, where N is a positive integer; the processing unit may further be configured to perform the following steps:
[0020] Send group joining request to N voting objects;
[0021] receiving voting indication information returned by each voting object in response to the group joining request, where the voting indication information is used to indicate whether the group joining object is approved to join the target group;
[0022] determining, according to the voting instruction information, the number of voting objects who agree to the group joining object joining the target group;
[0023] The voting result on the group joining request is determined by number.
[0024] In one embodiment, the processing unit may be further configured to perform the following steps:
[0025] If it is determined that the group exit object is allowed to exit the target group, the group exit object is deleted from the target group, and it is determined whether there is a change in the number of role objects in the target group;
[0026] The group exit object is a role object in the target group that initiates the group exit request, or the group exit object is a role object that needs to be deleted and is determined by the management object in the target group.
[0027] In one embodiment, the new label value is greater than the old label value; the processing unit is further configured to perform the following steps:
[0028] Performing a numerical comparison on the first tag value and the second tag value;
[0029] If the first tag value is less than the second tag value, it is determined that the data query object has the authority to query the target transaction data.
[0030] In one embodiment, the acquisition unit may further be configured to perform the following steps: acquiring a data on-chain request sent by a data on-chain object, the data on-chain request carrying transaction data, and the data on-chain object being a role object in a target group;
[0031] The processing unit can also be used to perform the following steps:
[0032] In response to a data upload request, add the transaction data to the blockchain;
[0033] Obtaining a third tag value of the target group when adding transaction data to the blockchain;
[0034] The third tag value is associated with the transaction hash corresponding to the transaction data and stored.
[0035] In one embodiment, the acquiring unit may further be configured to perform the following steps: acquiring a data forwarding request sent by the data forwarding object, where the data forwarding request is used to request data forwarding to the data sharing object;
[0036] The processing unit can also be used to perform the following steps: after determining that the data query object and the data sharing object belong to the same group, send data forwarding indication information to the data forwarding object, where the data forwarding indication information is used to instruct the data forwarding object to forward data to the data sharing object.
[0037] On the one hand, an embodiment of the present application provides a computer device, comprising: a processor and a memory, the processor and the memory being connected to each other, wherein the memory stores executable program code, and the processor is used to call the executable program code to execute the above-mentioned blockchain-based data processing method.
[0038] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer device, the computer device executes the above-mentioned blockchain-based data processing method.
[0039] Accordingly, embodiments of the present application provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned blockchain-based data processing method.
[0040] In an embodiment of the present application, after determining that the data query object is a role object in the target group and that the data query object has the authority to query the target transaction data, the target transaction data can be obtained from the blockchain and returned to the data query object; wherein the target transaction data can be added to the blockchain by the role object in the target group. As can be seen, the embodiment of the present application can perform permission isolation on the blockchain through groups. Any role object in the same group can query the transaction data added to the blockchain by the role object in the group when it has the data query authority. There is no need to manage multiple blockchains, which can reduce the permission management cost of the blockchain and save permission management resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0042] Figure 1 This is a schematic diagram of the architecture of a data sharing system provided in an embodiment of the present application;
[0043] Figure 2 This is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;
[0044] Figure 3 This is a flowchart of a block generation process provided by an embodiment of the present application;
[0045] Figure 4 This is a schematic diagram of the architecture of a blockchain management platform provided in an embodiment of the present application;
[0046] Figure 5 This is a schematic diagram of an application scenario of a blockchain-based data processing solution provided in an embodiment of the present application;
[0047] Figure 6 This is a flowchart of a blockchain-based data processing method provided in an embodiment of the present application;
[0048] Figure 7 This is a flowchart of another blockchain-based data processing method provided in an embodiment of the present application;
[0049] Figure 8 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application;
[0050] Figure 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0052] In order to more clearly understand the embodiments of the present application, the blockchain network and blockchain involved in the embodiments of the present application are introduced below:
[0053] See also Figure 1 The data sharing system (or blockchain network) shown in Figure 1It is an architectural diagram of a data sharing system provided in an embodiment of the present application. The data sharing system 10 refers to a system for sharing data between nodes. The data sharing system may include multiple nodes 101, and the multiple nodes 101 may refer to each client in the data sharing system. Each node 101 can receive input information when performing normal work, and maintain the shared data in the data sharing system based on the received input information. In order to ensure the intercommunication of information in the data sharing system, an information connection may exist between each node in the data sharing system, and information can be transmitted between nodes through the above-mentioned information connection. For example, when any node in the data sharing system receives input information, other nodes in the data sharing system obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes in the data sharing system are consistent.
[0054] Each node in the data sharing system has a corresponding node identifier, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system so that the generated blocks can be broadcast to other nodes in the data sharing system based on the node identifiers of other nodes. Each node can maintain a node identifier list as shown in the following table, and store the node name and node identifier in the node identifier list accordingly. The node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to identify the node. Table 1 only uses the IP address as an example for explanation:
[0055] Table 1
[0056] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0057] Each node in the data sharing system stores the same blockchain. Blockchain is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods (i.e., Figure 3 Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-counterfeiting) and generate the next data block.
[0058] The blockchain consists of multiple blocks, see Figure 2 , Figure 2This is a structural diagram of a blockchain provided by an embodiment of the present application. The blockchain is composed of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block uses the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value, version number, timestamp and difficulty value of the parent block, and so on. Therefore, the block data stored in each block in the blockchain is associated with the block data stored in the parent block, thereby ensuring the security of the input information in the block.
[0059] When generating each block in the blockchain, refer to Figure 3 , Figure 3 This is a flowchart of a block generation process provided by an embodiment of the present application. When the node in the blockchain receives input information, it verifies the input information. After verification, it stores the input information in the memory pool and updates the hash tree used to record the input information. After that, the update timestamp is updated to the time when the input information is received, and different random numbers are tried, and the eigenvalue calculation is performed multiple times so that the calculated eigenvalue can satisfy the following formula:
[0060] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET
[0061] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.
[0062] In this way, when a random number that satisfies the above formula is calculated, the information can be stored accordingly, and the block header and block body can be generated to obtain the current block. Subsequently, the blockchain node sends the newly generated block to other nodes in the data sharing system based on the node identifiers of other nodes in the data sharing system. The other nodes verify the newly generated block and, after verification, add the newly generated block to their stored blockchain.
[0063] A smart contract can be understood as a computerized protocol that can execute the terms of a contract. This is achieved through code deployed on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic resources to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0064] Based on the above description of blockchain networks and blockchains, embodiments of the present application provide a blockchain-based data processing solution that can use groups to implement permission isolation in blockchains. A so-called group can refer to a collection of objects consisting of one or more role objects. A role object can be understood as a separate individual or organization. For example, a role object can be a separate user, or it can be a company, enterprise, or other organization. Any role object in the same group, if it has data query permissions, can query transaction data added to the blockchain by role objects in the group. For example, if it is determined that the data query object is a role object in the target group and the data query object has data query permissions, the data query object can query transaction data added to the blockchain by role objects in the target group. If it is determined that the data query object is not a role object in the target group, the data query object cannot query transaction data added to the blockchain by role objects in the target group. Compared to the method of using private chains for permission isolation, the method of using groups for permission isolation does not require the management of multiple blockchains, and the management cost of groups is lower than the management cost of blockchains, thereby reducing the cost of permission management on blockchains and saving permission management resources.
[0065] The data processing solution based on blockchain can be applied to a blockchain management platform. Figure 4 This is a schematic diagram of the architecture of a blockchain management platform provided by an embodiment of the present application. Figure 4 As shown, the blockchain management platform can be composed of a management server 401 and a management client 402. The management server 401 and the management client 402 can establish a direct or indirect connection through wireless communication or wired communication, which is not limited in this embodiment of the present application. In actual application scenarios, the number of management servers 401 and the number of management clients 402 are more than one, and can be one or more (for example, two or more), which is not limited in this embodiment of the present application.
[0066] The management server 401 may be the above Figure 1Nodes in the blockchain network shown; nodes can include server clusters or distributed systems composed of multiple physical servers, and can also include cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Management server 401 can participate in the management of blockchains in the blockchain network; the blockchain-based data processing solutions provided in the embodiments of the present application can be recorded in smart contracts, and the smart contracts can be deployed in the blockchains managed by management server 401. Accordingly, management server 401 can be deployed with a contract caller for the smart contract. The contract caller can be specifically deployed in the application layer of management server 401. The contract caller can be used to call smart contracts in the blockchain. In other words, management server 401 can call smart contracts in the blockchain by running the contract caller, so that management server 401 can run the smart contract to execute the blockchain-based data processing solution.
[0067] The management client 402 can run in the user terminal, and the management client 402 can be any of the following: an independent application, an API (Application Programming Interface) or an SDK (Software Development Kit); the user terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted device, a smart speaker, a smart watch, a smart wearable device, etc., but is not limited to these.
[0068] In the blockchain management platform composed of a management server 401 and a management client 402, the role object can send an operation request to the management server 401 through the management client 402. The management server 401 can respond to the operation request by running a contract calling program to call the smart contract in the blockchain, and run the smart contract to perform the operation requested by the operation request, or return the data requested by the operation request to the role object through the management client 402.
[0069] In a specific implementation, the role object may include a group creation object, and the operation request may include a group creation request. Specifically, the group creation object may send a group creation request to a management server via a first management client; the management server may create a target group in response to the group creation request; after successfully creating the target group, the group creation object becomes a role object in the target group.
[0070] The role object may also include a data on-chain object, and the operation request may also include a data on-chain request. Specifically, the data on-chain object may send a data on-chain request to the management server via the second management client. The management server may respond to the data on-chain request and, after confirming that the data on-chain object is a role object in the target group, add the transaction data contained in the data on-chain request to the blockchain.
[0071] A role object may also include a data query object, and an operation request may further include a data query request. Specifically, the data query object may send a data query request to the management server via a third management client. In response to the data query request, the management server may, upon determining that the data query object is a role object in the target group and has data query permissions, return the target transaction data requested by the data query request to the data query object via the third management client.
[0072] The role object also includes a group join object, and the operation request may further include a group join request. Specifically, the group join object may send a group join request to the management server via the fourth management client; the management server may respond to the group join request and, after determining that the group join object is allowed to join the target group, add the group join object to the target group, i.e., the group join object becomes a role object in the target group.
[0073] The role object also includes a group exit object, and the operation request may also include a group exit request. Specifically, the group exit object may send a group exit request to the management server via the fifth management client; the management server may respond to the group exit request and, after determining that the group exit object is allowed to exit the target group, delete the group exit object from the target group.
[0074] It should be noted that the above-mentioned first management client, second management client, third management client, fourth management client and fifth management client can be the same management client or different management clients; the different management clients here can be understood as: each management client runs in a different user terminal and uses different login information (such as login account, login password, login verification code, etc.) to log in.
[0075] It can be understood that the blockchain management platform described in the embodiment of the present application is for the purpose of more clearly illustrating the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the platform architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0076] Referring to the above description of the blockchain-based data processing solution and the blockchain management platform, the following introduces the application scenarios applicable to the blockchain-based data processing solution. Figure 5 This is a schematic diagram of an application scenario of a blockchain-based data processing solution provided in an embodiment of the present application. Figure 5 As shown, the first group 501 includes four role objects, namely the core enterprise, the financing platform, the first bank, and the first bank's service provider. The core enterprise, the financing platform, the first bank, and the first bank's service provider can collaboratively execute the entire process of the first financing business; the second group 502 includes three role objects, namely the core enterprise, the financing platform, and the second bank. The core enterprise, the financing platform, and the second bank can collaboratively execute the entire process of the second financing business; that is, the group here can be understood as the minimum set of objects that can collaboratively execute the entire process of a certain business.
[0077] The formation process of the first group can be specifically described as follows: the core enterprise wishes to execute the first financing business and requests the creation of the first group; after the first group is successfully created, the core enterprise becomes a role object in the first group, and the financing platform, the first bank, and the first bank's service providers, which can collaborate on the execution of the first financing business, successively join the first group. Data query permissions within the first group can be understood as follows: any role object in the first group can query transaction data generated in the first group after it joins, but cannot query transaction data generated in the first group before it joins. For example, the first bank can query transaction data generated by the financing platform after it joins the first group, but cannot query transaction data generated by the financing platform before it joins the first group.
[0078] The formation process for the second group is similar to that of the first group. Specifically, it can be described as follows: the core enterprise wishes to execute a second financing business and requests the creation of a second group. After the second group is successfully created, the core enterprise becomes a role object within the second group. Financing platforms and second banks, which can collaborate on the second financing business, subsequently join the second group. Data query permissions within the second group can be understood as follows: any role object in the second group can query transaction data generated within the second group after it joins, but not transaction data generated before it joins. For example, the second bank can query transaction data generated by the core enterprise after it joins the first group, but not transaction data generated by the core enterprise before it joins the second group.
[0079] In addition, core enterprises and financing platforms are role objects in both the first group and the second group. Core enterprises and financing platforms can query transaction data generated in the first group and in the second group when they have data query permissions. This shows that data query permissions between different groups are isolated from each other. Any role object in the same group can query transaction data generated in that group when it has data query permissions. Role objects outside the group cannot query transaction data generated in that group. This ensures the security of transaction data generated in each group, reduces the management cost of each group, and effectively reduces the cost of permission management for the blockchain.
[0080] Based on the above description, the following Figure 6 and Figure 7 The data processing method based on blockchain provided in the embodiment of the present application is introduced in detail. Figure 6 This is a flowchart of a data processing method based on blockchain provided by an embodiment of the present application. The data processing method based on blockchain can be executed by a computer device provided by an embodiment of the present application. The computer device can be Figure 4 The management server 401 in the blockchain management platform shown; the blockchain-based data processing method may include the following steps S601 to S604:
[0081] S601: Obtain a data query request sent by a data query object.
[0082] Before introducing the specific execution process of step S601, the group creation process is first introduced here: a group creation request sent by a group creation object can be obtained; after obtaining the group creation request, a target group can be created in response to the group creation request. After the target group is successfully created, the group creation object becomes a role object in the target group; secondly, a group identifier of the target group can be created and returned to the group creation object; then, an initial tag value can be added to the target group.
[0083] In step S601, a data query request sent by a data query object may be obtained. The data query request may be used to request a query for target transaction data added to the blockchain by a role object in a target group. The data query request may include: the group identifier of the target group, the object identifier of the data query object, and the transaction hash corresponding to the target transaction data.
[0084] S602: If the data query object is a role object in the target group, obtain a first tag value corresponding to the data query object.
[0085] Before introducing the specific execution process of step S602, the label value of the target group is first introduced here: the label value of the target group can be used to reflect the change in the number of role objects in the target group, and it can change with the change in the number of role objects in the target group. In a specific implementation, when there is a change in the number of role objects in the target group, the old label value of the target group can be obtained, and the old label value is the label value of the target group before the change in the number of role objects in the target group; then, a new label value can be generated based on the old label value, and the new label value is used as the new label value of the target group after the change in the number of role objects in the target group. The change in the number of role objects in the target group may include: adding a new role object to the target group, or the role objects in the target group exiting the target group.
[0086] Generating a new label value based on an old label value may include: adding a target value (e.g., 1) to the old label value to obtain a value as the new label value, that is, the new label value is greater than the old label value, that is, the label value of the target group increases as the number of role objects in the target group changes. Alternatively, generating a new label value based on an old label value may include: subtracting a target value (e.g., 1) from the old label value to obtain a value as the new label value, that is, the new label value is less than the old label value, that is, the label value of the target group decreases as the number of role objects in the target group changes.
[0087] The object identifiers of each role object in the target group can be stored in the authorization list of the target group, and the object identifier of the data query object can be matched in the authorization list to determine whether the data query object is a role object in the target group. Specifically, the authorization list of the target group can be obtained based on the group identifier of the target group, and then the object identifier of the data query object can be matched in the authorization list. If the object identifier of the data query object is successfully matched in the authorization list, it can be determined that the data query object is a role object in the target group; if the object identifier of the data query object fails to match in the authorization list, it can be determined that the data query object is not a role object in the target group. Table 2 shows an example of an authorization list for a target group provided in an embodiment of the present application. The authorization list may include the object name of the role object (e.g., role object 1, role object 2) and the object identifier of the role object (e.g., object identifier 1, object identifier 2). Table 2 is shown below:
[0088] Table 2
[0089] Object name of the role object Object ID of the role object Character Object 1 Object ID 1 Character Object 2 Object ID 2 … …
[0090] In step S602 , if the data query object is a role object in the target group, a first tag value corresponding to the data query object may be obtained. The first tag value is a tag value of the target group generated when the data query object joins the target group.
[0091] The authorization list may also include the tag values corresponding to each role object in the target group. The tag value corresponding to any role object is the tag value of the target group generated when the role object joins the target group. That is, the first tag value corresponding to the data query object can be obtained from the authorization list. Table 3 shows an example of an authorization list for another target group provided in an embodiment of the present application. The authorization list may include the object name of the role object (e.g., role object 1, role object 2), the object identifier of the role object (e.g., object identifier 1, object identifier 2), and the tag value corresponding to the role object (e.g., tag value 1, tag value 2). Table 3 is shown below:
[0092] Table 3
[0093]
[0094] As can be seen, if the data query object is a role object in the target group, the first tag value corresponding to the data query object can be obtained from the authorization list based on the object identifier of the data query object. The authorization list can be stored in the database of the management server or written into the smart contract, which is explained here.
[0095] S603: Obtain a second tag value corresponding to the target transaction data.
[0096] Before introducing the specific execution process of step S603, the data chain process is introduced here: a data chain request sent by a data chain object can be obtained. The data chain request can carry the transaction data to be chained, and the data chain object is the role object in the target group. Then, in response to the data chain request, the transaction data can be added to the blockchain; adding the transaction data to the blockchain can specifically refer to: generating a block based on the transaction data, and then uploading the block to the blockchain. The process of generating a block based on the transaction data here can be referred to above. Figure 3 Description of the illustrated embodiment. Secondly, the third tag value of the target group when adding transaction data to the blockchain can be obtained, and the third tag value can be associated and stored with the transaction hash corresponding to the transaction data. This allows the data on-chain object to quickly determine the transaction data requested by the data on-chain object through the transaction hash, and the third tag value associated with the transaction hash can also be quickly determined through the transaction hash. Furthermore, the transaction hash corresponding to the transaction data can be returned to the data on-chain object to indicate that the transaction data has been successfully added to the blockchain.
[0097] As can be seen from the above data on-chain process, when a role object in the target group adds transaction data to the blockchain, the target group's tag value can be used as the tag value corresponding to the transaction data, and the tag value corresponding to the transaction data is stored in association with the transaction hash corresponding to the transaction data. In step S603, obtaining the second tag value corresponding to the target transaction data may include: based on the transaction hash corresponding to the target transaction data included in the data query request, obtaining the second tag value associated with the transaction hash, where the second tag value is the tag value of the target group when the target transaction data is added to the blockchain.
[0098] S604: If it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, the target transaction data is obtained from the blockchain and returned to the data query object.
[0099] Before introducing the specific execution process of step S604, the determination process of data query authority is introduced here. For a data query object, it can be determined whether the data query object has the authority to query the target transaction data based on the first tag value and the second tag value. In one embodiment, as described above, generating a new tag value based on the old tag value may include: adding the old tag value to the target value (for example, 1) to obtain the value obtained as the new tag value, that is, the new tag value is greater than the old tag value. In this case, the first tag value and the second tag value can be numerically compared; if the first tag value is less than the second tag value, that is, if the tag value of the target group generated when the data query object joins the target group is less than the tag value of the target group when the target transaction data is added to the blockchain, then it can be determined that the data query object has the authority to query the target transaction data; on the contrary, if the first tag value is greater than or equal to the second tag value, that is, if the tag value of the target group generated when the data query object joins the target group is greater than or equal to the tag value of the target group when the target transaction data is added to the blockchain, then it can be determined that the data query object does not have the authority to query the target transaction data. In another embodiment, as described above, generating a new tag value based on the old tag value may also include: subtracting a target value (for example, 1) from the old tag value to obtain a value as the new tag value, that is, the new tag value is less than the old tag value. In this case, the first tag value and the second tag value may be numerically compared; if the first tag value is greater than the second tag value, that is, if the tag value of the target group generated when the data query object joins the target group is greater than the tag value of the target group when the target transaction data is added to the blockchain, then it can be determined that the data query object has the authority to query the target transaction data; on the contrary, if the first tag value is less than or equal to the second tag value, that is, if the tag value of the target group generated when the data query object joins the target group is less than or equal to the tag value of the target group when the target transaction data is added to the blockchain, then it can be determined that the data query object does not have the authority to query the target transaction data. In other words, the data query object cannot query transaction data added to the blockchain by role objects in the target group before the data query object joins the target group. The transaction data that the data query object has query authority for is the transaction data added to the blockchain by role objects in the target group after the data query object joins the target group. This ensures that the transaction data added to the blockchain by role objects in the target group is safe and reliable.
[0100] In step S604, if it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, the target transaction data corresponding to the transaction hash can be obtained from the blockchain based on the transaction hash corresponding to the target transaction data included in the data query request, and the target transaction data can be returned to the data query object.
[0101] In addition, role objects in the same group support data forwarding, which means that role objects can communicate with each other and send data to each other. Specifically, a data forwarding request sent by a data forwarding object can be obtained, and the data forwarding request can be used to request data forwarding to a data sharing object. After determining that the data query object and the data sharing object belong to the same group, a data forwarding instruction message can be sent to the data forwarding object, and the data forwarding instruction message can be used to instruct the data forwarding object to forward data to the data sharing object.
[0102] In the embodiment of the present application, permission isolation can be performed on the blockchain through groups. Any role object in the same group can query transaction data added to the blockchain by role objects in the group when it has data query permission. There is no need to manage multiple blockchains, which can reduce the permission management cost of the blockchain and save permission management resources. In addition, data isolation can be performed between different groups. Role objects can query transaction data on the blockchain of the group to which they belong, while role objects that do not belong to the group cannot query transaction data on the chain of the group, which can improve the security of data within the group. In addition, for the target group, if the data query object is a role object in the target group, then the transaction data that the data query object has query permission for is the transaction data added to the blockchain by the role object in the target group after the data query object joins the target group. The data query object cannot query transaction data added to the blockchain by the role object in the target group before the data query object joins the target group, further improving the security and reliability of data within the group.
[0103] Figure 7 This is a flow chart of another data processing method based on blockchain provided by an embodiment of the present application. The data processing method based on blockchain can be executed by the computer device and role object provided by an embodiment of the present application. In the embodiment of the present application, the computer device is Figure 4 The management server 401 in the blockchain management platform shown in the figure is used as an example to illustrate that the role object can be Figure 4 The management client 402 in the blockchain management platform shown communicates with the management server 401.
[0104] The role object in the embodiment of the present application may include any of the following: group creation object, group joining object, group exit object, data on-chain object, data query object, data forwarding object. Accordingly, the data processing method based on blockchain provided by the embodiment of the present application may include but is not limited to the following processing processes: group creation process, role object joining process, role object exit process, data on-chain process, data query process and data forwarding process. Figure 7The illustrated embodiment describes each of the above-mentioned processing processes in detail.
[0105] (1) During the group creation process, the role object may include a group creation object. The group creation process may include the following steps S701 to S703:
[0106] S701: A group creation object sends a group creation request to a management server.
[0107] S702 : The management server creates a target group and a group identifier of the target group in response to the group creation request, and adds an initial tag value to the target group.
[0108] S703: The management server returns the group identifier of the target group to the group creation object.
[0109] The management server may prompt the group creation object that the target group has been successfully created by returning the group identifier of the target group to the group creation object.
[0110] (2) During the role object joining process, the role object may include a group joining object. The role object joining process may include the following steps S704 to S708:
[0111] S704: The group joining object sends a group joining request to the management server.
[0112] The group joining object may send a group joining request to the management server. The group joining request may include the group identifier of the target group and the object identifier of the group joining object.
[0113] S705: If it is determined that the group joining object is allowed to join the target group, the management server adds the group joining object to the target group.
[0114] Prior to step S705, the management server may determine whether to allow the group joining object to join the target group. Specifically, the target group may include N voting objects, each of which may vote on the event of the group joining object joining the target group, where N is a positive integer. The management server may send a group joining request to the N voting objects. The management server may then receive voting indication information returned by each voting object in response to the group joining request, the voting indication information being used to indicate whether the group joining object is approved to join the target group. The management server may determine a first number of voting objects that approve the group joining object to join the target group based on the voting indication information, and then determine a voting result regarding the group joining request based on the first number. The management server may determine the voting result regarding the group joining request based on the first number, which may specifically include: the management server calculating a first ratio between the first number of voting objects that approve the group joining object to join the target group and the total number of voting objects; if the first ratio is greater than a first threshold, the management server may determine the voting result regarding the group joining request as: allowing the group joining object to join the target group; if the first ratio is less than or equal to the first threshold, the management server may determine the voting result regarding the group joining request as: not allowing the group joining object to join the target group. The first threshold may be one-half, two-thirds, four-fifths, etc., and is not limited in this embodiment of the present application.
[0115] It should be noted that when the number of voting objects included in the target group is one, the voting object can be the group creation object of the target group, that is, whether the group joining object is allowed to join the target group requires the group creation object to vote. If the target group includes M role objects, M is a positive integer greater than N, then the N voting objects are the N management objects in the target group; the management object can be a role object in the target group whose credit rating is higher than the credit rating threshold, and the credit rating is an indicator that can be used to measure the comprehensive ability of the role object; or, the management object can be a role object of an organizational type (such as an enterprise or company) in the target group; or, the management object can be some role objects in the target group specified by the group creation object, and the group creation object can also be a management object; that is, whether the group joining object is allowed to join the target group requires the N management objects in the target group to participate in the vote together. If the target group includes M role objects, M is equal to N, then the N voting objects are all role objects in the target group, that is, whether the group joining object is allowed to join the target group requires all role objects in the target group to participate in the vote together.
[0116] In step S705 , if it is determined that the group joining object is allowed to join the target group, the management server may add the group joining object to the target group. At this time, it may be determined that there is a change in the number of role objects in the target group.
[0117] S706: The management server obtains the first old tag value of the target group.
[0118] The management server may obtain a first old label value of the target group, where the first old label value is the label value of the target group before the group joining object joins the target group.
[0119] S707: The management server generates a first new label value according to the first old label value, and uses the first new label value as a new label value of the target group after the group joining object joins the target group.
[0120] After the group joining object successfully joins the target group, the management server may also determine the first new tag value as the tag value corresponding to the group joining object, and add the tag value corresponding to the group joining object and the object identifier of the group joining object to the authorization list shown in Table 3 above.
[0121] S708: The management server sends a group joining notification to the group joining object.
[0122] The group join notification may include a group join success notification or a group join failure notification. If the group join object successfully joins the target group, the management server may send a group join success notification to the group join object. The group join success notification may be used to notify the group join object of the successful joining of the target group. The management server may send a group join failure notification to the group join object if it determines that the group join object is not allowed to join the target group.
[0123] (3) During the role object exit process, the role object may include a group exit object. The role object exit process may include the following steps S709 to S713:
[0124] S709: The management server obtains a group exit request regarding the group exit object.
[0125] A group exit request can be initiated by a group exit object. This means the group exit object is a role object in the target group that initiates the group exit request. Alternatively, a group exit request can be initiated by any management object in the target group. This means the group exit object is a role object that a management object in the target group has determined needs to be deleted.
[0126] S710: If it is determined that the group exit object is allowed to exit the target group, the management server deletes the group exit object in the target group.
[0127] Prior to step S710, the management server may determine whether to allow the group-exiting object to exit the target group. Specifically, the target group may include N voting objects, each of which may vote on the event of the group-joining object joining the target group, where N is a positive integer. The management server may send a group-exit request to the N voting objects. The management server may then receive voting indication information returned by each voting object in response to the group-exit request, the voting indication information being used to indicate whether the group-exiting object is approved to exit the target group. The management server may determine, based on the voting indication information, a second number of voting objects that approve the group-exiting object's exit from the target group, and then determine a voting result regarding the group-exit request based on the second number. The management server may determine the voting result regarding the group-exit request based on the second number, which may specifically include: the management server calculating a second ratio between the second number of voting objects that approve the group-exiting object's exit from the target group and the total number of voting objects; if the second ratio is greater than a second threshold, the management server may determine the voting result regarding the group-exit request as: allowing the group-exiting object to exit the target group; if the second ratio is less than or equal to the second threshold, the management server may determine the voting result regarding the group-exit request as: not allowing the group-exiting object to exit the target group. The second threshold value may be one-half, two-thirds, four-fifths, etc., and is not limited in this embodiment of the present application.
[0128] It should be noted that when the number of voting objects included in the target group is one, the voting object can be the group creation object of the target group, that is, whether the group exit object is allowed to exit the target group requires the group creation object to vote. If the target group includes M role objects, M is a positive integer greater than N, then the N voting objects are the N management objects in the target group; the management object can be a role object in the target group whose credit rating is higher than the credit rating threshold, and the credit rating is an indicator that can be used to measure the comprehensive ability of the role object; or, the management object can be a role object of an organizational type (such as an enterprise or company) in the target group; or, the management object can be some role objects in the target group specified by the group creation object, and the group creation object can also be a management object; that is, whether the group exit object is allowed to exit the target group requires the N management objects in the target group to participate in the vote together. If the target group includes M role objects, M is equal to N, then the N voting objects are all role objects in the target group, that is, whether the group exit object is allowed to exit the target group requires all role objects in the target group to participate in the vote together.
[0129] In step S710 , if the management server determines that the group exit object is allowed to exit the target group, the group exit object may be deleted from the target group. At this time, it may be determined that there is a change in the number of role objects in the target group.
[0130] S711: The management server obtains the second oldest tag value of the target group.
[0131] The management server may obtain a second old label value of the target group, where the second old label value is the label value of the target group before the group exit object exits the target group.
[0132] S712: The management server generates a second new tag value according to the second old tag value, and uses the second new tag value as the new tag value of the target group after the group exit object exits the target group.
[0133] After the group exit object successfully exits the target group, the management server may also delete the tag value corresponding to the group exit object and the object identifier of the group exit object from the authorization list shown in Table 3 above.
[0134] S713: The management server sends a group exit notification.
[0135] Group exit notifications may include group exit success notifications and group exit failure notifications. If the group exit object successfully exits the target group, the management server may send a group exit success notification to the requester of the group exit request (e.g., the group exit object or any management object in the target group). The group exit notification may be used to notify the group exit object of its successful exit from the target group. If the management server determines that the group exit object is not allowed to exit the target group, it may send a group join failure notification to the requester of the group exit request.
[0136] (4) During the data on-chain process, the role object may include the data on-chain object. The data on-chain process may include the following steps S714 to S716:
[0137] S714: The data upload object sends a data upload request to the management server.
[0138] The data chain request can carry the transaction data to be chained, and the data chain object is the role object in the target group.
[0139] S715. The management server adds the transaction data to the blockchain in response to the data upload request, obtains the third tag value of the target group when adding the transaction data to the blockchain, and associates and stores the third tag value with the transaction hash corresponding to the transaction data.
[0140] S716: The management server returns the transaction hash corresponding to the transaction data to the data on-chain object.
[0141] (5) During the data query process, the role object may include a data query object. The data query process may include the following steps S717 to S720:
[0142] S717: The data query object sends a data query request to the management service.
[0143] S718: If the data query object is a role object in the target group, the management server obtains a first tag value corresponding to the data query object.
[0144] S719, obtaining the second tag value corresponding to the target transaction data. If it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, the management server obtains the target transaction data from the blockchain.
[0145] S720: The management server returns the target transaction data to the data query object.
[0146] It should be noted that if the data query object is not a role object in the target group, the management server may return a query failure result to the data query object. If the data query object is determined, based on the first tag value and the second tag value, to not have permission to query the target transaction data, for example, if the target transaction data requested by the data query object was added to the blockchain by a role object in the target group before the data query object joined the target group, the management server may return a query failure result to the data query object.
[0147] (6) During the data forwarding process, the role object may include a data forwarding object. The data forwarding process may include the following steps S721 to S722:
[0148] S721: The data forwarding object sends a data forwarding request to the management server.
[0149] The data forwarding request may be used to request data forwarding to a data sharing object. The data forwarding request may include an object identifier of the data forwarding object and an object identifier of the data sharing object.
[0150] S722: After determining that the data query object and the data sharing object belong to the same group, the management server sends data forwarding indication information to the data forwarding object.
[0151] After determining that the data query object and the data sharing object belong to the same group, the management server may send data forwarding indication information to the data forwarding object, where the data forwarding indication information may be used to instruct the data forwarding object to forward data to the data sharing object. If the data query object and the data sharing object belong to different groups, the management server may send forwarding rejection indication information to the data forwarding object, where the forwarding rejection indication information may be used to instruct the data forwarding object not to forward data to the data sharing object.
[0152] It should be noted that whether the data query object and the data sharing object belong to the same group can be determined by matching the object identifier of the data forwarding object and the object identifier of the data sharing object in the authorization list of each group managed by the management server; if the object identifier of the data forwarding object and the object identifier of the data sharing object are successfully matched in a group managed by the management server, it can be determined that the data query object and the data sharing object belong to the same group.
[0153] The data forwarding object can also request the management server to obtain the authorization list of the group to which the data forwarding object belongs. After obtaining the authorization list of the group to which the data forwarding object belongs, the data forwarding object can match the object identifier of the data sharing object in the obtained authorization list. If the object identifier of the data sharing object matches successfully, it means that the data query object and the data sharing object belong to the same group, and the data forwarding object can forward data to the data sharing object. If the object identifier of the data sharing object fails to match, it means that the data query object and the data sharing object belong to different groups, and the data forwarding object can refuse to forward data to the data sharing object. In this way, the object identifier matching process of the data sharing object is performed by the data forwarding object, which can alleviate the authority management pressure of the management server.
[0154] In the embodiment of the present application, permission isolation can be performed on the blockchain through groups. Any role object in the same group can query transaction data added to the blockchain by role objects in the group when it has data query permission. There is no need to manage multiple blockchains, which can reduce the permission management cost of the blockchain and save permission management resources. In addition, data isolation can be performed between different groups. Role objects can query transaction data uploaded by the group to which they belong, while role objects that do not belong to the group cannot query transaction data uploaded by the group, which can improve the security of data within the group. In addition, for the target group, if the data query object is a role object in the target group, then the transaction data that the data query object has query permission for is the transaction data added to the blockchain by role objects in the target group after the data query object joins the target group. The data query object cannot query transaction data added to the blockchain by role objects in the target group before the data query object joins the target group, further improving the security and reliability of data within the group. In addition, data can be forwarded between role objects belonging to the same group, while data cannot be forwarded between role objects belonging to different groups, which can prevent data in the group from being leaked outside the group and improve the security of data forwarding in the group.
[0155] It should be noted that the execution entity for executing each step in the above method embodiment may be composed of hardware, software, or a combination of hardware and software.
[0156] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application. The blockchain-based data processing device described in the embodiment of the present application corresponds to the management server mentioned above, and the blockchain-based data processing device includes:
[0157] An acquisition unit 801 is configured to acquire a data query request sent by a data query object, where the data query request is used to request to query target transaction data added to the blockchain by a role object in a target group;
[0158] Processing unit 802 is configured to obtain a first tag value corresponding to the data query object if the data query object is a role object in the target group, where the first tag value is a tag value of the target group generated when the data query object is added to the target group;
[0159] The processing unit 802 is further configured to obtain a second tag value corresponding to the target transaction data, where the second tag value is a tag value of the target group when the target transaction data is added to the blockchain;
[0160] The processing unit 802 is further configured to obtain the target transaction data from the blockchain and return the target transaction data to the data query object if it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data.
[0161] In one embodiment, the processing unit 802 may be further configured to perform the following steps:
[0162] When the number of role objects in the target group changes, the old label value of the target group is obtained; the old label value is the label value of the target group before the number of role objects in the target group changes;
[0163] A new label value is generated according to the old label value, and the new label value is used as the new label value of the target group after the number of role objects in the target group changes.
[0164] In one embodiment, the acquiring unit 801 may further be configured to perform the following steps: acquiring a group joining request from a group joining object requesting to join a target group;
[0165] The processing unit 802 may be further configured to execute the following steps: if it is determined that the group joining object is allowed to join the target group, then add the group joining object to the target group, and determine whether there is a change in the number of role objects in the target group.
[0166] In one embodiment, the target group includes N voting objects, where N is a positive integer; the processing unit 802 is further configured to perform the following steps:
[0167] Send group joining request to N voting objects;
[0168] receiving voting indication information returned by each voting object in response to the group joining request, where the voting indication information is used to indicate whether the group joining object is approved to join the target group;
[0169] determining, according to the voting instruction information, the number of voting objects who agree to the group joining object joining the target group;
[0170] The voting result on the group joining request is determined by number.
[0171] In one embodiment, the processing unit 802 may be further configured to perform the following steps:
[0172] If it is determined that the group exit object is allowed to exit the target group, the group exit object is deleted from the target group, and it is determined whether there is a change in the number of role objects in the target group;
[0173] The group exit object is a role object in the target group that initiates the group exit request, or the group exit object is a role object that needs to be deleted and is determined by the management object in the target group.
[0174] In one embodiment, the new label value is greater than the old label value; the processing unit 802 is further configured to perform the following steps:
[0175] Performing a numerical comparison on the first tag value and the second tag value;
[0176] If the first tag value is less than the second tag value, it is determined that the data query object has the authority to query the target transaction data.
[0177] In one embodiment, the acquisition unit 801 may further be configured to perform the following steps: acquiring a data on-chain request sent by a data on-chain object, the data on-chain request carrying transaction data, and the data on-chain object being a role object in a target group;
[0178] The processing unit 802 may also be configured to perform the following steps:
[0179] In response to a data upload request, add the transaction data to the blockchain;
[0180] Obtaining a third tag value of the target group when adding transaction data to the blockchain;
[0181] The third tag value is associated with the transaction hash corresponding to the transaction data and stored.
[0182] In one embodiment, the acquiring unit 801 may further be configured to perform the following steps: acquiring a data forwarding request sent by a data forwarding object, where the data forwarding request is used to request data forwarding to a data sharing object;
[0183] The processing unit 802 may also be configured to execute the following steps: after determining that the data query object and the data sharing object belong to the same group, send data forwarding indication information to the data forwarding object, where the data forwarding indication information is used to instruct the data forwarding object to forward data to the data sharing object.
[0184] In a feasible embodiment, the blockchain-based data processing device provided in the embodiment of the present application can be implemented in software. The blockchain-based data processing device can be stored in a memory. It can be software in the form of programs and plug-ins, and includes a series of units, including an acquisition unit and a processing unit; wherein the acquisition unit and the processing unit are used to implement the blockchain-based data processing method provided in the embodiment of the present application.
[0185] In other feasible embodiments, the blockchain-based data processing device provided in the embodiments of the present application may also be implemented in a combination of software and hardware. As an example, the blockchain-based data processing device provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the blockchain-based data processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0186] In an embodiment of the present application, after determining that the data query object is a role object in the target group and that the data query object has the authority to query the target transaction data, the target transaction data can be obtained from the blockchain and returned to the data query object; wherein the target transaction data can be added to the blockchain by the role object in the target group. As can be seen, the embodiment of the present application can perform permission isolation on the blockchain through groups. Any role object in the same group can query the transaction data added to the blockchain by the role object in the group when it has the data query authority. There is no need to manage multiple blockchains, which can reduce the permission management cost of the blockchain and save permission management resources.
[0187] See Figure 9 , Figure 9 9 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device described in the embodiment of the present application includes: a processor 901, a communication interface 902, and a memory 903. The processor 901, communication interface 902, and memory 903 may be connected via a bus or other means. The embodiment of the present application uses a bus connection as an example.
[0188] Among them, the processor 901 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. It can parse various instructions within the computer device and process various data of the computer device. For example, the CPU can be used to parse the power on and off instructions sent by the user to the computer device and control the computer device to perform power on and off operations; for another example, the CPU can transmit various interactive data between the internal structures of the computer device, etc. The communication interface 902 can optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.), which is controlled by the processor 901 to send and receive data. The memory 903 (Memory) is a memory device in the computer device for storing programs and data. It can be understood that the memory 903 here can include both the built-in memory of the computer device and the extended memory supported by the computer device. The memory 903 provides storage space, which stores the operating system of the computer device, which may include but is not limited to: Android system, iOS system, Windows Phone system, etc., and this application is not limited to this.
[0189] In the embodiment of the present application, the processor 901 performs the following operations by running the executable program code in the memory 903:
[0190] Get the data query request sent by the data query object. The data query request is used to request to query the target transaction data added to the blockchain by the role object in the target group;
[0191] If the data query object is a role object in the target group, then obtaining a first tag value corresponding to the data query object, where the first tag value is a tag value of the target group generated when the data query object is added to the target group;
[0192] Obtaining a second tag value corresponding to the target transaction data, where the second tag value is the tag value of the target group when the target transaction data is added to the blockchain;
[0193] If it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, the target transaction data is obtained from the blockchain and returned to the data query object.
[0194] In one embodiment, the processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0195] When the number of role objects in the target group changes, the old label value of the target group is obtained; the old label value is the label value of the target group before the number of role objects in the target group changes;
[0196] A new label value is generated according to the old label value, and the new label value is used as the new label value of the target group after the number of role objects in the target group changes.
[0197] In one embodiment, the processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0198] Get the group joining request from the group joining object to join the target group;
[0199] If it is determined that the group joining object is allowed to join the target group, the group joining object is added to the target group, and it is determined whether there is a change in the number of role objects in the target group.
[0200] In one embodiment, the target group includes N voting objects, where N is a positive integer. The processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0201] Send group joining request to N voting objects;
[0202] receiving voting indication information returned by each voting object in response to the group joining request, where the voting indication information is used to indicate whether the group joining object is approved to join the target group;
[0203] determining, according to the voting instruction information, the number of voting objects who agree to the group joining object joining the target group;
[0204] The voting result on the group joining request is determined by number.
[0205] In one embodiment, the processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0206] If it is determined that the group exit object is allowed to exit the target group, the group exit object is deleted from the target group, and it is determined whether there is a change in the number of role objects in the target group;
[0207] The group exit object is a role object in the target group that initiates the group exit request, or the group exit object is a role object that needs to be deleted and is determined by the management object in the target group.
[0208] In one embodiment, the new tag value is greater than the old tag value; the processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0209] Performing a numerical comparison on the first tag value and the second tag value;
[0210] If the first tag value is less than the second tag value, it is determined that the data query object has the authority to query the target transaction data.
[0211] In one embodiment, the processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0212] Get the data on-chain request sent by the data on-chain object. The data on-chain request carries transaction data. The data on-chain object is the role object in the target group.
[0213] In response to a data upload request, add the transaction data to the blockchain;
[0214] Obtaining a third tag value of the target group when adding transaction data to the blockchain;
[0215] The third tag value is associated with the transaction hash corresponding to the transaction data and stored.
[0216] In one embodiment, the processor 901 may be further configured to execute the following steps by running the executable program code in the memory 903:
[0217] Obtaining a data forwarding request sent by a data forwarding object, where the data forwarding request is used to request data forwarding to a data sharing object;
[0218] After determining that the data query object and the data sharing object belong to the same group, data forwarding indication information is sent to the data forwarding object, where the data forwarding indication information is used to instruct the data forwarding object to forward data to the data sharing object.
[0219] In an embodiment of the present application, after determining that the data query object is a role object in the target group and that the data query object has the authority to query the target transaction data, the target transaction data can be obtained from the blockchain and returned to the data query object; wherein the target transaction data can be added to the blockchain by the role object in the target group. As can be seen, the embodiment of the present application can perform permission isolation on the blockchain through groups. Any role object in the same group can query the transaction data added to the blockchain by the role object in the group when it has the data query authority. There is no need to manage multiple blockchains, which can reduce the permission management cost of the blockchain and save permission management resources.
[0220] The present application also provides a computer-readable storage medium containing a computer program that, when executed on a computer, causes the computer to execute the blockchain-based data processing method provided in the present application. The specific implementation method is described above and will not be repeated here.
[0221] The present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the blockchain-based data processing method provided in the present application. The specific implementation method is described above and will not be repeated here.
[0222] It should be noted that for the aforementioned various method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0223] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0224] The above disclosure is only part of the embodiments of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A data processing method based on blockchain, characterized in that: The method comprises: Obtaining a data query request sent by a data query object, wherein the data query request is used to request to query target transaction data added to the blockchain by a role object in a target group; If the data query object is a role object in the target group, obtaining a first tag value corresponding to the data query object, where the first tag value is a tag value of the target group generated when the data query object joins the target group; the tag value of the target group is used to reflect changes in the number of role objects in the target group; Obtaining a second tag value corresponding to the target transaction data, where the second tag value is a tag value of the target group when the target transaction data is added to the blockchain; If the tag value of the target group increases as the number of role objects in the target group changes, the first tag value and the second tag value are numerically compared. If the first tag value is less than the second tag value, it is determined that the data query object has the permission to query the target transaction data; otherwise, it is determined that the data query object does not have the permission to query the target transaction data; If the tag value of the target group decreases as the number of role objects in the target group changes, the first tag value and the second tag value are numerically compared. If the first tag value is greater than the second tag value, it is determined that the data query object has the permission to query the target transaction data; otherwise, it is determined that the data query object does not have the permission to query the target transaction data; If it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, the target transaction data is obtained from the blockchain and returned to the data query object.
2. The method according to claim 1, wherein The method further comprises: When the number of role objects in the target group changes, an old label value of the target group is acquired; the old label value is the label value of the target group before the number of role objects in the target group changes; A new label value is generated according to the old label value, and the new label value is used as a new label value of the target group after the number of role objects in the target group changes.
3. The method according to claim 2, wherein The method further comprises: Obtaining a group joining request from a group joining object requesting to join the target group; If it is determined that the group joining object is allowed to join the target group, the group joining object is added to the target group, and it is determined whether there is a change in the number of role objects in the target group.
4. The method according to claim 3, wherein The target group includes N voting objects, where N is a positive integer; the method further includes: Sending the group joining request to the N voting objects; receiving voting indication information returned by each voting object in response to the group joining request, the voting indication information being used to indicate whether to approve the group joining object to join the target group; determining, according to the voting instruction information, the number of voting objects who agree that the group joining object joins the target group; A voting result regarding the group joining request is determined based on the number.
5. The method according to claim 2, wherein The method further comprises: If it is determined that the group exit object is allowed to exit the target group, deleting the group exit object in the target group, and determining whether there is a change in the number of role objects in the target group; The group exit object is a role object in the target group that initiates the group exit request, or the group exit object is a role object that needs to be deleted as determined by a management object in the target group.
6. The method according to any one of claims 1 to 5, wherein: The method further comprises: Obtain a data on-chain request sent by a data on-chain object, the data on-chain request carrying transaction data, and the data on-chain object being a role object in the target group; In response to the data upload request, add the transaction data to the blockchain; obtaining a third tag value of the target group when adding the transaction data to the blockchain; The third tag value is associated with the transaction hash corresponding to the transaction data and stored.
7. The method according to any one of claims 1 to 5, wherein: The method further comprises: Obtaining a data forwarding request sent by a data forwarding object, wherein the data forwarding request is used to request data forwarding to a data sharing object; After determining that the data query object and the data sharing object belong to the same group, data forwarding indication information is sent to the data forwarding object, where the data forwarding indication information is used to instruct the data forwarding object to forward data to the data sharing object.
8. A data processing device based on blockchain, characterized in that: The device comprises: an acquiring unit, configured to acquire a data query request sent by a data query object, wherein the data query request is used to request to query target transaction data added to the blockchain by a role object in a target group; a processing unit configured to, if the data query object is a role object in the target group, obtain a first tag value corresponding to the data query object, the first tag value being a tag value of the target group generated when the data query object joins the target group; the tag value of the target group being used to reflect changes in the number of role objects in the target group; The processing unit is further configured to obtain a second tag value corresponding to the target transaction data, where the second tag value is a tag value of the target group when the target transaction data is added to the blockchain; The processing unit is further configured to, if it is determined based on the first tag value and the second tag value that the data query object has the authority to query the target transaction data, obtain the target transaction data from the blockchain and return the target transaction data to the data query object; including: if the tag value of the target group increases as the number of role objects in the target group changes, numerically comparing the first tag value and the second tag value; if the first tag value is less than the second tag value, determining that the data query object has the authority to query the target transaction data; otherwise, determining that the data query object does not have the authority to query the target transaction data; If the tag value of the target group decreases as the number of role objects in the target group changes, the first tag value and the second tag value are numerically compared. If the first tag value is greater than the second tag value, it is determined that the data query object has the authority to query the target transaction data; otherwise, it is determined that the data query object does not have the authority to query the target transaction data.
9. A computer device, characterized in that: The device includes: a processor and a memory, the processor and the memory are connected to each other, wherein the memory stores an executable program code, and the processor is used to call the executable program code to execute the blockchain-based data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed on a computer device, enables the computer device to execute the blockchain-based data processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Right control method, apparatus, system and node device of block chain
CN106796688A
Salary data query method based on distributed deployment and related equipment
CN112286997A