Data processing method and device based on block chain and storage medium

Through blockchain technology and smart contracts, the problem of repeated storing of user information between different banking systems is solved, secure storage and legal access to user private data is realized, and data security and traceability are ensured.

CN119128847APending Publication Date: 2024-12-13中国农业银行股份有限公司宁波市分行
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411249591.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Repeated retention of user information between different banking systems leads to the leakage of user information and waste of storage resources.

Method used

Adopt blockchain-based data processing methods, user authentication and data authorization are performed through smart contracts, user tokens and authorization tokens are generated, ensuring that user private data is stored independently on the user side, and the service provider can only access data after user authorization. And record data access on the blockchain.

Benefits of technology

It realizes the security and sovereignty of user private data, avoids information leakage and waste of storage resources, and ensures the legality and traceability of data access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128847A_ABST
    Figure CN119128847A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on a block chain, and a storage medium, and is applied to a block chain node, and the method comprises the steps: calling a first smart contract in response to receiving a first authentication and authorization request submitted by a user; if the authentication is passed, sending a user token to the user; under the condition that the service party receives a service request submitted by a user and sends a user token verification request corresponding to the service request to the block chain node, verifying the user token based on the second smart contract, and sending a verification result to the service party; and if the service party requests to obtain the private data of the user, receiving an authorization confirmation request sent by the user, and authorizing the smart contract to generate a user authorization token corresponding to the service party based on the user data so as to obtain the private data of the user. In the application, the private data of the user is stored in the user data storage module independent of the service party, so that the separation of the private data of the user and the application service is realized, and the sovereignty and security of the private data of the user are protected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based data processing method, device and storage medium. Background Art

[0002] In some application scenarios, users often handle related business on some service platforms, and in the process of handling business, users are often required to authorize the service platform to obtain relevant data of users. Taking the service platform as a bank system as an example, when users use the services of different bank systems, they will retain personal information in different bank systems. The repeated retention of user information in different bank systems is likely to cause the leakage of user information and reduce the security of user data. At the same time, repeated storage of user information is also likely to cause the problem of waste of storage resources. Summary of the invention

[0003] In order to solve the above problems, this application provides the following technical solutions:

[0004] A data processing method based on blockchain, applied to a blockchain node, the method comprising:

[0005] In response to receiving a first authentication and authorization request submitted by a user, calling a first smart contract corresponding to the first authentication and authorization request;

[0006] If the user is authenticated based on the first smart contract, a user token is sent to the user, and the user token is used to enable the user to request the blockchain node for the list information of the service provider to which the user belongs;

[0007] When the service provider receives the service request submitted by the user and sends a user token verification request corresponding to the service request to the blockchain node, the second smart contract is called, and the user token is verified based on the second smart contract, and the verification result is sent to the service provider, so that the service provider provides services to the user based on the verification result;

[0008] If the service provider requests to obtain the user's private data during the process of providing the service, it receives an authorization confirmation request sent by the user, and generates a user authorization token corresponding to the service provider based on the user data authorization smart contract, so that the service provider obtains the user's private data based on the user authorization token; wherein the user's private data is stored in the user data storage module corresponding to the user end.

[0009] Optionally, if the user is authenticated based on the first smart contract, sending a user token to the user includes:

[0010] Verify the identity of the user by calling the public key of the user recorded on the blockchain based on the first smart contract, and send a user token to the user if the verification passes;

[0011] Among them, the user token can request the blockchain node for the list information of the service provider where the user is located within the first target time period; when the user applies the service of the service provider for the first time, a pair of asymmetric identity key pairs corresponding to the user are generated, and the public key in the asymmetric identity key pair and the identity information of the user are stored on the blockchain.

[0012] Optionally, the receiving the authorization confirmation request sent by the user, and generating a user authorization token corresponding to the service provider based on the user data authorization smart contract, includes:

[0013] In response to receiving the authorization confirmation request sent by the user, first data and second data corresponding to the authorization confirmation request are obtained, wherein the first data represents a hash value of the user authorization data accessible to the service provider encrypted with a random key; and the second data represents data obtained by encrypting the random key with a public key of a distributed hash storage;

[0014] A user authorization token corresponding to the service provider is generated through the user data authorization smart contract, the first data and the second data; wherein the user authorization token includes a first field and a second field, the content of the first field includes the result of encrypting the random key with the public key stored in a distributed hash; the content of the second field includes the result of encrypting the hash of the user authorization data with the random key.

[0015] Optionally, the method further comprises:

[0016] If the service provider provides the corresponding service to the user, the user data update smart contract is called to generate a data update request so that the value of the data area corresponding to the hash is updated based on the data update request.

[0017] Optionally, the method further comprises:

[0018] The data update processing process corresponding to the data update request is stored in the blockchain.

[0019] Optionally, the method further comprises:

[0020] When calling the second smart contract and verifying the user token based on the second smart contract, if the verification passes, the service component list of the service provider and the entry address corresponding to each service component list are sent to the user.

[0021] Optionally, the method further comprises:

[0022] Recording a user authentication process of authenticating the user based on the first smart contract in a blockchain;

[0023] Recording a verification process of verifying the user token based on the second smart contract in the blockchain;

[0024] The process of authorizing the service provider based on the user data authorization smart contract is recorded in the blockchain.

[0025] Optionally, the method further comprises:

[0026] In response to receiving a data access request, determining a data type corresponding to the data access request;

[0027] Based on the data type, a query is performed in the data recorded in the blockchain to obtain a data query result corresponding to the data access request.

[0028] A data processing device based on blockchain, applied to a blockchain node, comprising:

[0029] A first calling unit, configured to call a first smart contract corresponding to a first authentication and authorization request in response to receiving a first authentication and authorization request submitted by a user;

[0030] A first sending unit, configured to send a user token to the user if the user is authenticated based on the first smart contract, wherein the user token is used to enable the user to request the blockchain node for list information of the service provider to which the user belongs;

[0031] A second calling unit is configured to call a second smart contract when the service provider receives the service request submitted by the user and sends a user token verification request corresponding to the service request to the blockchain node, and verify the user token based on the second smart contract, and send the verification result to the service provider, so that the service provider provides services to the user based on the verification result;

[0032] A generating unit is used to receive an authorization confirmation request sent by the user if the service provider requests to obtain the private data of the user in the process of providing the service, and to generate a user authorization token corresponding to the service provider based on the user data authorization smart contract, so that the service provider obtains the private data of the user based on the user authorization token; wherein the private data of the user is stored in a user data storage module corresponding to the user end.

[0033] A storage medium storing executable instructions, wherein the instructions, when executed by a processor, implement a blockchain-based data processing method as described in any one of the above.

[0034] Compared with the prior art, the present application provides a data processing method, device and storage medium based on blockchain, which is applied to blockchain nodes, including: in response to receiving a first authentication authorization request submitted by a user, calling a first smart contract; if the user authentication is passed based on the first smart contract, sending a user token to the user; when the service party receives the service request submitted by the user and sends the user token verification request corresponding to the service request to the blockchain node, verifying the user token based on the second smart contract and sending the verification result to the service party; if the service party requests to obtain the user's private data, receiving the authorization confirmation request sent by the user, and generating a user authorization token corresponding to the service party based on the user data authorization smart contract, so that the service party obtains the user's private data based on the user authorization token. In the present application, the user's private data is stored in a user data storage module independent of the service party, which realizes the separation of the user's private data from the application service and protects the sovereignty and security of the user's private data. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0036] Figure 1 A flowchart of a data processing method based on blockchain provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of data interaction for an application scenario provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] The terms "first" and "second" and the like in the specification and claims of this application and the above drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0041] In order to facilitate the description of the relevant embodiments of the present application, the relevant terms used in the present application are now explained.

[0042] Blockchain technology: a decentralized technology that is open, transparent, tamper-proof, and traceable. It can solve the problems of poor security, high cost, and low efficiency in the centralized model.

[0043] Smart contract: In a broad sense, it enables users to define code programs according to the required transaction logic, allowing trusted transactions without the involvement of a third party, and these transactions are traceable and irreversible.

[0044] Scrypt algorithm: It is a key derivation function that takes the plaintext password and random data provided by the user as input, and generates a hash value of fixed length through complex calculations. This hash value is the digital signature, which is used to verify the mapping relationship between the original input and the output. During the calculation process of Scrypt, memory read and write operations are required frequently, which consumes a lot of memory resources. Attackers need to have huge computing resources and memory resources to carry out effective attacks, so Scrypt can better resist brute force cracking.

[0045] The embodiment of the present application provides a data processing method based on blockchain, which is mainly a processing method for distributed user authentication and access authorization based on smart contracts. Taking advantage of the open, transparent, tamper-proof and traceable characteristics of blockchain, the information used to verify the identity of the user is stored in the blockchain to provide users with reliable identity authentication services. User data is stored in user-controllable storage, independent of each service provider (also referred to as a service provider, service provider). The user decides whether to authorize the service provider to access his or her data, thereby achieving data and application separation and protecting user data sovereignty and security. The processes of user login authentication, user request for service from the service provider, and user authorization to the service provider are all recorded in the blockchain to ensure the integrity, reliability and traceability of the access record, while achieving the legitimacy of data access.

[0046] See also Figure 1, is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application, the method is applied to blockchain nodes, wherein the blockchain node can be any node in the blockchain, and can correspond to a terminal device in an actual application scenario. For example, there are nodes such as N1, N2, N3, N4 and N5 in the blockchain network, and the blockchain network can form an alliance chain for a service platform and several partners. For example, in the supply chain finance scenario, nodes N1, N2, N4 and N5 correspond directly or indirectly to several supply chain finance companies, and node N3 corresponds to the service platform, and users can obtain the target data of each supply chain finance company or the calculation results obtained based on the target data based on the service platform. It should be noted that the above is only an exemplary description of the blockchain node. Specifically, the corresponding blockchain can also be created in combination with the actual scenario, and the present application does not limit this.

[0047] The method may include the following steps:

[0048] S101. In response to receiving a first authentication and authorization request submitted by a user, calling a first smart contract corresponding to the first authentication and authorization request.

[0049] S102: If the user is authenticated based on the first smart contract, a user token is sent to the user.

[0050] Among them, the user is a user who needs to obtain the service of the service provider, such as a customer of a banking system in a financial application scenario. The first authentication authorization request is a request for a blockchain node to provide identity authentication services for the user. The first authentication authorization request can also be called an authentication authorization transaction, which is used to provide identity authentication services for the user of the service provider (also called a customer), so that the customer obtains a token and the entry address of the service he wants to access.

[0051] When the blockchain node receives the first authentication and authorization request submitted by the user, it will call the first smart contract that can execute the processing corresponding to the request. The first smart contract is an authentication and authorization smart contract that executes the first authentication and authorization request (i.e., authentication and authorization transaction). The first smart contract is used to verify the identity information provided by the user when the user only provides identity information, and issue a temporary token (i.e., user token) to the user after verification. The user token is used to enable the user to request the blockchain node for the list information of the service provider where the user is located. When the information provided by the user includes the name of the specific service provider (i.e., service provider), the first smart contract (also called the authentication and authorization smart contract) will send the token corresponding to the service provider to the user after verification and request the service component list and its entry address provided by the service provider.

[0052] In one implementation of the embodiment of the present application, if the user is authenticated based on the first smart contract, sending a user token to the user includes:

[0053] Verify the identity of the user by calling the public key of the user recorded on the blockchain based on the first smart contract, and send a user token to the user if the verification passes;

[0054] Among them, the user token can request the blockchain node for the list information of the service provider where the user is located within the first target time period; when the user applies the service of the service provider for the first time, a pair of asymmetric identity key pairs corresponding to the user are generated, and the public key in the asymmetric identity key pair and the identity information of the user are stored on the blockchain.

[0055] Furthermore, when the second smart contract is called and the user token is verified based on the second smart contract, if the verification passes, the service component list of the service provider and the entry address corresponding to each service component list are sent to the user.

[0056] When a user uses the service provided by the service provider for the first time, he can enter the user's corresponding mobile phone number and password in the client or web page (such as a browser) corresponding to the service, and then use the Scrypt algorithm to calculate and derive a pair of asymmetric identity key pairs locally. The mobile phone number and the user's public key are stored on the blockchain. In the subsequent identity authentication, the user enters the mobile phone number and password, and then uses the Scrypt algorithm to calculate and derive a pair of asymmetric identity key pairs locally. The mobile phone number and the digital signature are sent to the blockchain node, and the blockchain node verifies the user's identity according to the user's public key recorded on the blockchain. And the token obtained by the user has a time limit, which can be set according to the specific situation. For example, the user token can be valid within the first target time period, that is, the service provider's list information can be accessed within this time period, and re-authentication and authorization are required beyond this time period. The service provider list is a list of service providers to which the user has access rights. The service provider has its own corresponding system resources, such as computing resources, storage resources, etc. The user can access the resources owned by the service provider and the services provided. The service entry address is usually a URL.

[0057] S103. When the service provider receives the service request submitted by the user and sends the user token verification request corresponding to the service request to the blockchain node, the second smart contract is called, and the user token is verified based on the second smart contract, and the verification result is sent to the service provider.

[0058] S104: If the service provider requests to obtain the user's private data during the process of providing the service, it receives the authorization confirmation request sent by the user and generates a user authorization token corresponding to the service provider based on the user data authorization smart contract.

[0059] The service provider can obtain the user's private data based on the user authorization token, wherein the user's private data is stored in the user data storage module corresponding to the user end.

[0060] When the service provider (specifically, the service component of the service provider) receives the service request submitted by the user, it submits a token verification transaction to the blockchain node, that is, sends the user token verification request corresponding to the service request to the blockchain node. The blockchain node then calls the second smart contract, verifies the user token based on the second smart contract, and sends the verification result to the service provider. Among them, the second smart contract is used to verify the correctness and validity of the user token submitted by the user to the service provider (specifically, it can be a service component). Therefore, the second smart contract can also be called a token verification smart contract.

[0061] When the service provider (specifically, the corresponding service component) receives the verification result of the blockchain node on the user token, when the verification result is passed, the corresponding service component can provide relevant services to the user.

[0062] When the service provider needs to access user private data during the process of providing related services, the user needs to submit an authorization confirmation transaction (i.e., an authorization confirmation request) to the blockchain node. The blockchain node executes the user data authorization smart contract called by the authorization confirmation request. The user data authorization smart contract issues a user authorization token to the service provider (specifically, it can be the corresponding service component) so that the service provider (such as the service component) obtains access rights to the user's private data and provides services to the user.

[0063] It should be noted that in the embodiment of the present application, the user's private data is stored in the user data storage module corresponding to the user end. The user has absolute control over the data stored in the user data storage module, and the task service party cannot access the data without the user's authorization. Among them, the user's private data includes privacy data such as the user's ID number, gender, age, mobile phone number, bank card number, etc. It can be stored in different storage devices corresponding to the user end, which can be the local storage area of ​​the user terminal or cloud storage. Specifically, the user data storage module stores private data in ways that include but are not limited to distributed hash storage, cloud storage, personal computers, etc.

[0064] The embodiment of the present application provides a data processing method based on blockchain, which is applied to a blockchain node, including: in response to receiving a first authentication authorization request submitted by a user, calling a first smart contract; if the user authentication is passed based on the first smart contract, sending a user token to the user; when the service party receives the service request submitted by the user and sends the user token verification request corresponding to the service request to the blockchain node, verifying the user token based on a second smart contract, and sending the verification result to the service party; if the service party requests to obtain the user's private data, receiving the authorization confirmation request sent by the user, and generating a user authorization token corresponding to the service party based on the user data authorization smart contract, so that the service party obtains the user's private data based on the user authorization token. In this application, the user's private data is stored in a user data storage module independent of the service party, which realizes the separation of the user's private data from the application service and protects the sovereignty and security of the user's private data.

[0065] In one implementation of the embodiment of the present application, receiving an authorization confirmation request sent by a user, and generating a user authorization token corresponding to the service provider based on a user data authorization smart contract, includes:

[0066] In response to receiving the authorization confirmation request sent by the user, first data and second data corresponding to the authorization confirmation request are obtained, wherein the first data represents a hash value of the user authorization data accessible to the service provider encrypted with a random key; and the second data represents data obtained by encrypting the random key with a public key of a distributed hash storage;

[0067] A user authorization token corresponding to the service provider is generated through the user data authorization smart contract, the first data and the second data; wherein the user authorization token includes a first field and a second field, the content of the first field includes the result of encrypting the random key with the public key stored in a distributed hash; the content of the second field includes the result of encrypting the hash of the user authorization data with the random key.

[0068] If the service provider requests to obtain the user's private data during the service provision process, the user will send an authorization confirmation request to the blockchain node. The authorization confirmation request will specify the type of service the user is accessing and the range of user data that the corresponding service provider (or service component) can access. It also provides a hash of the authorized data encrypted with a random key, and data encrypted with the random key using the public key of the distributed hash storage. The blockchain node executes the authorization confirmation request to call the user data authorization smart contract, generate a user authorization token, and add the customer authorization token to the transaction log. Among them, the content of the first field in the user authorization token is the result of encrypting the random key with the public key of the distributed hash storage, and the content of the second field is the result of encrypting the hash of the customer authorization data with the random key.

[0069] After the service provider provides the corresponding service to the user, the relevant data will also be updated to ensure the real-time accuracy and traceability of the data. Specifically, if the service provider provides the corresponding service to the user, the user data update smart contract is called to generate a data update request so that the value of the data area corresponding to the hash is updated based on the data update request. Furthermore, the data update process corresponding to the data update request is stored in the blockchain. This realizes the storage of the data after each transaction on the chain, ensuring the security and traceability of the data.

[0070] In the embodiment of the present application, the processes of user login authentication, user request for service from the service provider, user authorization to the service provider, etc. are all recorded in the blockchain to ensure the integrity, credibility and traceability of the access records, while achieving the legitimacy of data access. In one embodiment, it includes:

[0071] Recording a user authentication process of authenticating the user based on the first smart contract in a blockchain;

[0072] Recording a verification process of verifying the user token based on the second smart contract in the blockchain;

[0073] The process of authorizing the service provider based on the user data authorization smart contract is recorded in the blockchain.

[0074] Furthermore, the method further comprises:

[0075] In response to receiving a data access request, determining a data type corresponding to the data access request;

[0076] Based on the data type, a query is performed in the data recorded in the blockchain to obtain a data query result corresponding to the data access request.

[0077] Among them, the data access request can be a data traceability access request, such as a query request for relevant data in the user login authentication process. Correspondingly, the data type corresponding to the data access request can represent the data traceability request for which processing process, such as data access requests related to user login authentication, user request for service from the service provider, and user authorization to the service provider. When a data access request is received, a query will be made in the corresponding recorded data in the blockchain, and the query result will be fed back to the requester.

[0078] The following uses the application scenario corresponding to the banking system as an example to illustrate a data processing method based on blockchain provided by the embodiment of the present application. Figure 2 , is a data interaction diagram of an application scenario provided by an embodiment of the present application. Figure 2 In the application scenario shown, the application system includes: user A, blockchain node, B bank deposit service and distributed hash storage. Among them, customer A is a customer of B bank, which provides financial services such as savings, credit, and settlement. Customer A intends to deposit the 500,000 yuan demand deposit in B bank into a fixed deposit.

[0079] Step 201: Client A generates an authentication and authorization transaction and submits it to the blockchain network.

[0080] In the authentication and authorization transaction submitted by customer A, it is stated that the bank to be accessed is bank B.

[0081] Step 202: The blockchain node executes the authentication and authorization smart contract called by the above authentication and authorization transaction to verify the customer identity and writes the authentication and authorization transaction into the transaction log.

[0082] Step 203: After the client identity is authenticated, the blockchain node sends the token of Bank B, the service list, and the entry address list corresponding to the service to Client A.

[0083] Step 204: Client A searches the entry address list corresponding to the service, finds the entry address for the time deposit, sends a time deposit request, and provides the token of Bank B.

[0084] Step 205: Bank B’s deposit service verifies the token provided by client A with the blockchain node.

[0085] Step 206: After receiving the message that the token provided by customer A has been verified, the deposit service of bank B provides customer A with the term and interest rate of the time deposit.

[0086] Step 207: The client generates an authorization confirmation transaction and submits it to the blockchain network.

[0087] In the authorization confirmation transaction, the customer specifies the deposit amount and term and the scope of data that Bank B can access, i.e., the account balance. The customer also provides the hash of the authorized data encrypted with a random key, and the data obtained by encrypting the random key with the public key of the distributed hash storage.

[0088] Step 208: The blockchain node executes the customer data authorization smart contract called by the authorization confirmation transaction, generates a customer authorization token, and adds the customer authorization token to the transaction log.

[0089] The content of the first field in the customer authorization token is the result of encrypting a random key with a public key stored in a distributed hash, and the content of the second field is the result of encrypting a hash of the customer authorization data with a random key.

[0090] Step 209: The blockchain node sends the customer authorization token to the deposit service of Bank B.

[0091] Step 210: Bank B's deposit service provides client A's authorization token to the distributed Hash storage to query the client's balance information.

[0092] Step 211, the distributed hash storage retrieves the data according to the customer authorization token provided by the deposit service of Bank B, and returns it to the deposit service of Bank B.

[0093] Among them, the distributed Hash storage uses its own private key to decrypt the first field of the above-mentioned customer authorization token to obtain a random key, and then uses the random key to decrypt the second field of the above-mentioned token to obtain the hash corresponding to the customer authorization data, and extracts the corresponding data based on the hash and returns it to Bank B's deposit service.

[0094] Step 212: Bank B's deposit service verifies whether the available credit limit and customer account balance corresponding to the term of the deposit applied for by the customer are sufficient. If the available credit limit and customer balance are sufficient, the term deposit operation is performed.

[0095] Step 213: Bank B's deposit service generates a deposit business authorization transaction and submits it to the blockchain network.

[0096] B Bank Deposit Service specifies the deposit amount, term and interest rate in the business authorization transaction.

[0097] Step 214: The blockchain node calls the customer data update smart contract, generates a data update request, and writes the data update request transaction in the transaction log.

[0098] The data update request includes the hash of the data to be updated and the updated data value.

[0099] Step 215: The blockchain node sends the above data update request to the distributed hash storage.

[0100] Step 216: Distributed Hash storage updates the value of the data area corresponding to the hash according to the request of the blockchain node, that is, updates the customer balance.

[0101] Step 217: The distributed hash storage sends the updated result to the client.

[0102] Correspondingly, in another embodiment of the present application, the application system may also include a customer authentication and authorization module, a service component module and a customer data storage module. It should be noted that the relevant modules can be adjusted according to the actual application scenario, and the present application embodiment does not provide examples one by one. Taking this application scenario as an example, the customer authentication and authorization module is composed of a blockchain network, and the blockchain network is composed of a number of blockchain nodes. The blockchain node can receive and execute the authentication and authorization transaction submitted by the customer, provide identity authentication services to the customer, and issue tokens. The customer accesses the services provided by the service provider in the service component module through the token; the blockchain node can also receive and execute the authorization confirmation transaction submitted by the customer, issue a customer authorization token to the service provider, and the service provider carries the customer authorization token in the resource request to access the customer data; the blockchain node can also receive and execute the token verification transaction submitted by the service provider, and verify the correctness and validity of the token provided by the customer for the service provider.

[0103] The service component modules are provided by various service providers, and each service provider provides corresponding services to the customer after verifying the customer's identity and determining the customer's authority. The service provider can access the customer data authorized by the customer.

[0104] The customer data storage module is used to store customer private data. Customers have absolute control over the data stored in the customer data storage module, and no service provider can access data without customer authorization. Customer private data includes customer ID number, gender, age, mobile phone number, bank card number and other private data. It can be stored in different storage devices, including but not limited to distributed hash storage, cloud storage, personal computers, etc.

[0105] In the embodiments of the present application, the information used to verify the identity of the customer is stored in the blockchain using the characteristics of blockchain technology, which is open, transparent, tamper-proof and traceable, to provide customers with reliable identity authentication services. Customer data is stored in a storage that is controllable by the customer, independent of each service provider. The customer decides whether to authorize the service provider to access their data, which separates data from applications and protects customer data sovereignty and security. The processes of customer login authentication, customer request for service from the service provider, and customer authorization to the service provider are all recorded in the blockchain to ensure the integrity, reliability and traceability of the access records, while achieving the legitimacy of data access.

[0106] See also Figure 3 , a data processing device based on blockchain provided in an embodiment of the present application, applied to a blockchain node, the device comprising:

[0107] A first calling unit 301 is configured to call a first smart contract corresponding to a first authentication and authorization request in response to receiving a first authentication and authorization request submitted by a user;

[0108] A first sending unit 302 is configured to send a user token to the user if the user is authenticated based on the first smart contract, wherein the user token is used to enable the user to request the blockchain node for list information of the service provider to which the user belongs;

[0109] The second calling unit 303 is used to call the second smart contract when the service provider receives the service request submitted by the user and sends the user token verification request corresponding to the service request to the blockchain node, and verify the user token based on the second smart contract, and send the verification result to the service provider, so that the service provider provides services to the user based on the verification result;

[0110] The generating unit 304 is used to receive an authorization confirmation request sent by the user if the service provider requests to obtain the private data of the user in the process of providing the service, and to generate a user authorization token corresponding to the service provider based on the user data authorization smart contract, so that the service provider obtains the private data of the user based on the user authorization token; wherein the private data of the user is stored in a user data storage module corresponding to the user end.

[0111] Optionally, the first sending unit includes:

[0112] A first verification subunit, configured to verify the identity of the user by calling the public key of the user recorded on the blockchain based on the first smart contract, and send a user token to the user if the verification passes;

[0113] Among them, the user token can request the blockchain node for the list information of the service provider where the user is located within the first target time period; when the user applies the service of the service provider for the first time, a pair of asymmetric identity key pairs corresponding to the user are generated, and the public key in the asymmetric identity key pair and the identity information of the user are stored on the blockchain.

[0114] Optionally, the generating unit includes:

[0115] A first acquisition subunit is configured to obtain, in response to receiving an authorization confirmation request sent by the user, first data and second data corresponding to the authorization confirmation request, wherein the first data represents a hash value of the user authorization data accessible to the service provider encrypted with a random key; and the second data represents data obtained by encrypting the random key with a public key of a distributed hash storage;

[0116] The first generating subunit is used to generate a user authorization token corresponding to the service provider through the user data authorization smart contract, the first data and the second data; wherein the user authorization token includes a first field and a second field, the content of the first field includes the result of encrypting the random key with the public key of the distributed hash storage; the content of the second field includes the result of encrypting the hash of the user authorization data with the random key.

[0117] Optionally, the device further comprises:

[0118] The data update subunit is used to call the user data update smart contract and generate a data update request if the service provider provides the corresponding service to the user, so as to update the value of the data area corresponding to the hash based on the data update request.

[0119] Optionally, the device further comprises:

[0120] The first data storage subunit is used to store the data update processing process corresponding to the data update request in the blockchain.

[0121] Optionally, the device further comprises:

[0122] The second sending unit is used to call the second smart contract and verify the user token based on the second smart contract. If the verification is successful, the service component list of the service provider and the entry address corresponding to each service component list are sent to the user.

[0123] Optionally, the device further comprises:

[0124] A recording unit is used to record in the blockchain a user authentication process for authenticating the user based on the first smart contract; to record in the blockchain a verification process for verifying the user token based on the second smart contract; and to record in the blockchain a process for authorizing the service provider based on the user data authorization smart contract.

[0125] Optionally, the device further comprises:

[0126] A query unit is used to determine the data type corresponding to the data access request in response to receiving the data access request; based on the data type, query the data recorded in the blockchain to obtain a data query result corresponding to the data access request.

[0127] It should be noted that the specific implementation of each unit and sub-unit in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.

[0128] Based on the foregoing embodiments, an embodiment of the present application further provides a storage medium, wherein the storage medium stores executable instructions, and when the instructions are executed by a processor, a blockchain-based data processing method as described in any one of the above is implemented.

[0129] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a blockchain-based data processing method as described in any one of the above is implemented.

[0130] It should be noted that the processor or CPU may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the above-mentioned processor function may also be other, and the embodiments of the present application are not specifically limited.

[0131] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0132] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0133] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data processing method based on blockchain, characterized in that: Applied to a blockchain node, the method comprises: In response to receiving a first authentication and authorization request submitted by a user, calling a first smart contract corresponding to the first authentication and authorization request; If the user is authenticated based on the first smart contract, a user token is sent to the user, and the user token is used to enable the user to request the blockchain node for the list information of the service provider to which the user belongs; When the service provider receives the service request submitted by the user and sends a user token verification request corresponding to the service request to the blockchain node, the second smart contract is called, and the user token is verified based on the second smart contract, and the verification result is sent to the service provider, so that the service provider provides services to the user based on the verification result; If the service provider requests to obtain the user's private data during the process of providing the service, it receives an authorization confirmation request sent by the user, and generates a user authorization token corresponding to the service provider based on the user data authorization smart contract, so that the service provider obtains the user's private data based on the user authorization token; wherein the user's private data is stored in the user data storage module corresponding to the user end.

2. The method according to claim 1, characterized in that If the user is authenticated based on the first smart contract, sending a user token to the user includes: Verify the identity of the user by calling the public key of the user recorded on the blockchain based on the first smart contract, and send a user token to the user if the verification passes; Among them, the user token can request the blockchain node for the list information of the service provider where the user is located within the first target time period; when the user applies the service of the service provider for the first time, a pair of asymmetric identity key pairs corresponding to the user are generated, and the public key in the asymmetric identity key pair and the identity information of the user are stored on the blockchain.

3. The method according to claim 1, characterized in that The receiving the authorization confirmation request sent by the user, and generating a user authorization token corresponding to the service provider based on the user data authorization smart contract, includes: In response to receiving the authorization confirmation request sent by the user, first data and second data corresponding to the authorization confirmation request are obtained, wherein the first data represents a hash value of the user authorization data accessible to the service provider encrypted with a random key; and the second data represents data obtained by encrypting the random key with a public key of a distributed hash storage; A user authorization token corresponding to the service provider is generated through the user data authorization smart contract, the first data and the second data; wherein the user authorization token includes a first field and a second field, the content of the first field includes the result of encrypting the random key with the public key stored in a distributed hash; the content of the second field includes the result of encrypting the hash of the user authorization data with the random key.

4. The method according to claim 3, characterized in that The method further comprises: If the service provider provides the corresponding service to the user, the user data update smart contract is called to generate a data update request so that the value of the data area corresponding to the hash is updated based on the data update request.

5. The method according to claim 4, characterized in that The method further comprises: The data update processing process corresponding to the data update request is stored in the blockchain.

6. The method according to claim 1, characterized in that The method further comprises: When calling the second smart contract and verifying the user token based on the second smart contract, if the verification passes, the service component list of the service provider and the entry address corresponding to each service component list are sent to the user.

7. The method according to claim 1, characterized in that The method further comprises: Recording a user authentication process of authenticating the user based on the first smart contract in a blockchain; Recording a verification process of verifying the user token based on the second smart contract in the blockchain; The process of authorizing the service provider based on the user data authorization smart contract is recorded in the blockchain.

8. The method according to claim 7, characterized in that The method further comprises: In response to receiving a data access request, determining a data type corresponding to the data access request; Based on the data type, a query is performed in the data recorded in the blockchain to obtain a data query result corresponding to the data access request.

9. A data processing device based on blockchain, characterized in that: Applied to a blockchain node, the device comprises: A first calling unit, configured to call a first smart contract corresponding to a first authentication and authorization request in response to receiving a first authentication and authorization request submitted by a user; A first sending unit, configured to send a user token to the user if the user is authenticated based on the first smart contract, wherein the user token is used to enable the user to request the blockchain node for list information of the service provider to which the user belongs; A second calling unit is configured to call a second smart contract when the service provider receives the service request submitted by the user and sends a user token verification request corresponding to the service request to the blockchain node, and verify the user token based on the second smart contract, and send the verification result to the service provider, so that the service provider provides services to the user based on the verification result; A generating unit is used to receive an authorization confirmation request sent by the user if the service provider requests to obtain the private data of the user in the process of providing the service, and to generate a user authorization token corresponding to the service provider based on the user data authorization smart contract, so that the service provider obtains the private data of the user based on the user authorization token; wherein the private data of the user is stored in a user data storage module corresponding to the user end.

10. A storage medium, characterized in that: The storage medium stores executable instructions, and when the instructions are executed by the processor, the blockchain-based data processing method as described in any one of claims 1 to 8 is implemented.