Data authorization and evidence storage method and system based on blockchain
By using smart contracts and ledgers to store data authorization information on the blockchain, the problem of poor management of data authorization behavior and easy tampering in traditional methods is solved, and the immutable and secure storage of user data authorization behavior is realized, and the customer is improved a sense of security.
Patent Information
- Application Number
- CN202010846437.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-20
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2040-08-20
AI Technical Summary
Traditional data authorization and storage methods ignore the management of user data authorization behavior and are easily tampered with or forged, resulting in a lack of security for customers.
Using a blockchain-based data authorization and certification method, through smart contracts and blockchain ledgers, a structure to be put on the chain with visible plain text information and encrypted content is generated and stored to ensure that user data authorization behavior cannot be tampered with in the blockchain system. .
It improves the security and credibility of user data authorization behavior, fills the gap in the security certification of user data authorization behavior in traditional business, and enhances the customer's sense of security.
Smart Images

Figure CN111797420B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based data authorization and evidence storage method and system. Background Art
[0002] Traditional data authorization and storage methods are based on relational databases. Although this is a universal phenomenon, it has many flaws. For example, it ignores the management of user data authorization behavior, and the user's data authorization behavior is easy to be tampered with or forged, which can easily lead to customers' lack of security. Summary of the invention
[0003] The purpose of the present invention is to provide a data authorization notarization method and system based on blockchain, so as to alleviate the technical problems existing in the prior art that the management of user data authorization behavior is neglected, and the user's data authorization behavior is easily tampered with or forged, which easily leads to customers' lack of security.
[0004] In the first aspect, the present invention provides a blockchain-based data authorization and evidence storage method, which is applied to a blockchain including a smart contract, a blockchain ledger, and an application layer, including: the application layer, under the trigger of the transaction initiator, receives the data element corresponding to the user data authorization transaction; the application layer determines the structure to be put on the chain according to the data element; wherein the structure to be put on the chain includes: a first primary key and a first ciphertext, and the first primary key is visible plaintext information; the smart contract writes the structure to be put on the chain into the blockchain ledger; the application layer receives the data query initiated by the data query party corresponding to the user data authorization transaction The query request includes a first primary key; the application layer calls the smart contract to search the corresponding target structure to be uploaded to the blockchain account book according to the first primary key; the application layer parses the first ciphertext in the target structure to be uploaded to the blockchain based on the private key of the data query party, and returns the parsed first encrypted content to the data query party, so that the data query party obtains user data authorization based on the first encrypted content; the application layer receives the data authorization information sent by the data query party after the user data is authorized, and calls the smart contract to store the data authorization information.
[0005] Further, determining the structure to be put on the chain according to the data elements includes: generating a system authorization serial number according to the data elements, and determining the structure to be put on the chain based on the data elements and the system authorization serial number.
[0006] Furthermore, the data elements include: one or more of: transaction initiator number, data provider number, data query party number, system business serial number, customer identification code, data authorization application summary and transaction initiation time.
[0007] Furthermore, the structure to be put on the chain is determined based on the data elements and the system authorization serial number, including: determining the data query party number, the customer identification code and the system business serial number as the first primary key; determining the system authorization serial number, the transaction initiator number, the data provider number, the data query party number, the data authorization application summary and the transaction initiation time as the first encrypted content; encrypting the first encrypted content by the public key of the data query party to obtain a first ciphertext; determining the first primary key and the first ciphertext as the structure to be put on the chain.
[0008] Furthermore, the data authorization information includes: one or more of: transaction initiator number, data query party number, data provider number, system business serial number, system authorization serial number, data authorization result, data authorization summary, authorization rejection summary, and data authorization time.
[0009] Furthermore, the data authorization information is stored, including: determining any one of the transaction initiator number, the data query party number and the data provider number and the system authorization serial number as the second primary key; determining the customer identification code, the system business serial number, the data authorization result, the data authorization summary, the authorization rejection summary and the data authorization time as the second encrypted content; encrypting the second encrypted content by the public key of the data query party to obtain a second ciphertext; calling the smart contract to write the second ciphertext and the second primary key into the blockchain account book.
[0010] Furthermore, after the data authorization information is stored as a notary, the method also includes: the application layer, receiving a second primary key sent by any one of the transaction initiator, the data query party and the data provider; the application layer, calling the smart contract to search for the corresponding second ciphertext in the blockchain account book according to the second primary key; the application layer, parsing the second ciphertext based on the private key of the data query party, and returning the parsed second encrypted content to the transaction initiator, the data query party or the data provider, so that the transaction initiator, the data query party or the data provider can view the second encrypted content.
[0011] In a second aspect, the present invention provides a blockchain-based data authorization storage system, which includes: the method applied to any one of the first aspects including a smart contract, a blockchain ledger and an application layer blockchain, a transaction initiator, a data query party and a data provider.
[0012] In a third aspect, the present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein the steps of the blockchain-based data authorization and notarization method are implemented when the processor executes the computer program.
[0013] In a fourth aspect, the present invention also provides a computer-readable medium having a non-volatile program code executable by a processor, wherein the program code enables the processor to execute the blockchain-based data authorization and notarization method.
[0014] A data authorization notarization method and system based on blockchain provided by the present invention is applied to a blockchain including a smart contract, a blockchain account book and an application layer, including: the application layer receives data elements corresponding to the user data authorization transaction under the trigger of the transaction initiator; the application layer determines the structure to be chained according to the data elements; wherein the structure to be chained includes: a first primary key and a first ciphertext, and the first primary key is visible plaintext information; the smart contract writes the structure to be chained into the blockchain account book; the application layer receives a query request corresponding to the user data authorization transaction initiated by the data query party; wherein the query request carries the first primary key; the application layer calls the smart contract to search the corresponding target structure to be chained in the blockchain account book according to the first primary key; the application layer parses the first ciphertext in the target structure to be chained based on the private key of the data query party, and returns the parsed first encrypted content to the data query party, so that the data query party obtains the user data authorization based on the first encrypted content; after the user data is authorized, the application layer receives the data authorization information sent by the data query party and calls the smart contract to notarize the data authorization information. Since the data authorization information represents the user's data authorization behavior, the method of calling the smart contract to store the data authorization information can make the user's data authorization behavior tamper-proof in the blockchain-based system, filling the gap in the secure storage of user data authorization behavior in traditional businesses and improving the user's sense of security.
[0015] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flowchart of a blockchain-based data authorization and evidence storage method provided in an embodiment of the present invention;
[0019] Figure 2 A flowchart for determining the structure to be chained;
[0020] Figure 3 A flowchart for storing data authorization information;
[0021] Figure 4 A flowchart of another blockchain-based data authorization and evidence storage method provided in an embodiment of the present invention;
[0022] Figure 5 It is a flow chart of the interaction between the blockchain system, transaction initiator, data query party and data provider;
[0023] Figure 6 A schematic diagram of the structure of a blockchain-based data authorization and evidence storage system provided in an embodiment of the present invention.
[0024] icon:
[0025] 10-Blockchain; 11-Application layer; 12-Smart contract; 13-Blockchain ledger; 20-Transaction initiator; 30-Data query party; 40-Data provider. DETAILED DESCRIPTION
[0026] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The traditional data authorization, storage and query methods are based on relational database processing. Although this is a universal phenomenon, it has many defects. The main defects are: (1) As user data information is increasingly valued, the management of user data authorization, especially the secure and reliable storage and traceability mechanism of user data authorization, has become increasingly necessary. (2) Traditional practices ignore the management of user authorization behavior. (3) Customer data authorization is easily tampered with or forged, and customers lack a sense of security.
[0028] Based on this, the purpose of the present invention is to provide a data authorization notarization method and system based on blockchain, which uses the application layer in the blockchain to set the to-be-chained structure under the trigger of the transaction initiator, and then uses the smart contract to write the to-be-chained structure into the blockchain account book, and then interacts with the blockchain and the data query party to obtain data authorization information used to characterize the data authorization behavior, and finally calls the smart contract to store the data authorization information. This can make the user's data authorization behavior tamper-proof in the blockchain-based system, fill the gap in the secure notarization of user data authorization behavior in traditional businesses, and improve the user's sense of security.
[0029] To facilitate understanding of this embodiment, a blockchain-based data authorization and evidence storage method disclosed in an embodiment of the present invention is first described in detail.
[0030] Embodiment 1:
[0031] According to an embodiment of the present invention, an embodiment of a data authorization and notarization method based on blockchain is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 1 A flowchart of a data authorization and evidence storage method based on blockchain provided by an embodiment of the present invention is applied to a blockchain including a smart contract, a blockchain ledger, and an application layer, such as Figure 1 As shown, the method comprises the following steps:
[0033] Step S101, the application layer receives data elements corresponding to the user data authorization transaction under the triggering of the transaction initiator;
[0034] In an embodiment of the present invention, the data elements include: one or more of the transaction initiator number, data provider number, data query party number, system business serial number, customer identification code, data authorization application summary and transaction initiation time. The transaction initiator, or the authorized transaction applicant, is an institution that initiates user data authorization or initiates a transaction request. The transaction initiator number, or the authorized transaction applicant number, refers to the number used to identify the authorized transaction applicant. The timing of triggering the authorization application may refer to: triggering after the transaction initiator receives the business request from the data query party.
[0035] It should be noted that, in addition to the transaction initiator mentioned above, this embodiment also involves a data provider and a data query party. It should be noted that the transaction initiator and the data query party can be regarded as one party or two different parties, and the choice is made according to the actual situation. In addition, the data provider can refer to an institution responsible for providing label data that can be used to identify a certain attribute of the user by processing the user data in a certain way. The institution can be a direct participating institution on the blockchain or an institution outside the blockchain. The above user data includes but is not limited to: the user's name, age, gender, native place, certificate number, mobile phone number, transaction flow, etc. The above label data can refer to data derived from a certain processing of the user data for classifying or scoring the user, such as high consumption capacity or low consumption capacity based on the user's monthly consumption, or good credit or poor credit results based on the user's credit (or loan repayment) performance ability. The above direct participating institution can be understood as a member institution connected to the alliance chain, which directly participates in the business process. Data provider number: a number used to identify the data provider. Specifically, the data provider number is a string of digital codes assigned to the data provider by the business system. The code is used to distinguish different access structures within the business system. The code assigned to the party providing the business data is the data provider code. The data query party refers to the organization that initiates the query of a certain tag data of the user. The data query party number may refer to the number used to identify the data query party. The customer identification code may refer to the unique code used to represent the customer information, and the concept of the customer information is equivalent to the above-mentioned user data.
[0036] In step S101, the institution on the blockchain (i.e., the transaction initiator) triggers an application for user data authorization and sends the transaction content to the blockchain application layer software (i.e., the above-mentioned application layer). The data elements that can be provided by the transaction content include the above-mentioned elements, among which the system business serial number can be understood as the serial number of the user data query initiated by the data query party; the data authorization application summary can be understood as a textual overview describing the initiator of the user data authorization.
[0037] The transaction initiator, data provider, and data query party described above can all point to and interact with the blockchain. By clarifying the transaction initiator, data provider, and data query party, it can be explained that the transaction for which authorization is requested is initiated by the transaction initiator and sent to the data query party, who then asks the user for authorization. After the user's authorization is approved, the data provider provides the relevant data.
[0038] Step S102, the application layer determines a structure to be uploaded to the chain according to the data elements; wherein the structure to be uploaded to the chain includes: a first primary key and a first ciphertext, and the first primary key is visible plaintext information;
[0039] After the blockchain application layer software generates a system authorization serial number based on the received transaction, the information sent by the transaction (i.e. the above-mentioned data elements) and the following system authorization serial number are formed into a data structure to be put on the chain. The data structure to be put on the chain uses the data query party number, customer identification code and system business serial number as visible plaintext information, which can also be called the first primary key. The system authorization serial number, transaction initiator number, data provider number, data query party number, data authorization application summary (the summary is used to describe the text overview of the initiator user data authorization) and transaction initiation time are encrypted as a whole as the first encrypted content through the data query party public key to form the first ciphertext. The structure to be put on the chain is submitted to the smart contract on the blockchain. After encryption, the structure to be put on the chain includes: visible plaintext information and the first ciphertext. The data query party number, customer identification code, and system business serial number in the visible plaintext information can all be used as index information for querying the structure to be put on the chain on the blockchain.
[0040] Step S103, the smart contract writes the structure to be uploaded into the blockchain account book;
[0041] In the embodiment of the invention, smart contract is the abbreviation of blockchain smart contract. Since the structure to be put on the chain includes the first primary key and the first ciphertext, and the first primary key includes: data query party number, customer identification code and system business serial number, the smart contract uses the data query party number, customer identification code and system business serial number as the first primary key and the first ciphertext as the information content to write the user data authorization application into the blockchain account book. The structure to be put on the chain used to represent transaction information can only be written into the blockchain account book after being processed by the smart contract.
[0042] Step S104, the application layer receives a query request initiated by the data query party corresponding to the user data authorization transaction; wherein the query request carries the first primary key;
[0043] In an embodiment of the present invention, the data query party initiates a user data query authorization transaction to the blockchain application layer software by providing the data query party number, customer identification code and system business serial number.
[0044] Step S105, the application layer calls the smart contract to search the blockchain account book for the corresponding target structure to be uploaded according to the first primary key;
[0045] Step S106: The application layer parses the first ciphertext in the target to-be-uploaded structure based on the private key of the data query party, and returns the parsed first encrypted content to the data query party, so that the data query party obtains user data authorization based on the first encrypted content;
[0046] In an embodiment of the present invention, the blockchain application layer software calls the blockchain smart contract to query the target to-be-chained structure on the blockchain account book according to the data elements provided by the data query party, and decrypts the first ciphertext in the target to-be-chained structure, and finally returns the first encrypted content and the first primary key obtained after decryption to the blockchain application layer software. The private key of the data query party belongs to the data query party. When executing this step, the embodiment of the present invention does not specifically limit the decryption implementation method of the blockchain application layer software. In other words, the acquisition of the private key of this embodiment can be implemented by the decryption interface provided by the data query party, or by authorizing the blockchain application layer software to call, or by other methods. The data query party can present some relevant information to the user for reference when the user authorizes the data. This part of the relevant information may refer to: the first encrypted content.
[0047] In the embodiment of the present invention, the data query party can complete the authorization to the data provider and obtain the user data authorization result through other channels.
[0048] Step S107: After the user data is authorized, the application layer receives the data authorization information sent by the data query party and calls the smart contract to store the data authorization information.
[0049] In an embodiment of the present invention, the data authorization information includes one or more of the transaction initiator number (or authorized transaction applicant number) when initiating the transaction, the data query party number, the data provider number, the system business serial number, the system authorization serial number, the data authorization result, the data authorization summary, the authorization rejection summary, and the data authorization time. Among them, the system authorization serial number, the data authorization summary, the authorization rejection summary, and the data authorization time are all obtained by the data query party when the data query party completes the request for authorization from the data provider. The system authorization serial number is formed when the data query party requests authorization, and the data authorization summary, the authorization rejection summary, and the data authorization time are formed according to the user authorization result. In general, the data authorization summary is determined by performing a hash calculation on the user authorization result or the credential to form a string of numbers.
[0050] The embodiment of the present invention provides a data authorization notarization method based on blockchain, which is applied to a blockchain including a smart contract, a blockchain account book and an application layer, including: the application layer receives data elements corresponding to the user data authorization transaction under the trigger of the transaction initiator; the application layer determines the structure to be chained according to the data elements; wherein the structure to be chained includes: a first primary key and a first ciphertext, and the first primary key is visible plaintext information; the smart contract writes the structure to be chained into the blockchain account book; the application layer receives a query request corresponding to the user data authorization transaction initiated by a data query party; wherein the query request carries the first primary key; the application layer calls the smart contract to search the corresponding target structure to be chained in the blockchain account book according to the first primary key; the application layer parses the first ciphertext in the target structure to be chained based on the private key of the data query party, and returns the parsed first encrypted content to the data query party, so that the data query party obtains the user data authorization based on the first encrypted content; after the user data is authorized, the application layer receives the data authorization information sent by the data query party and calls the smart contract to notarize the data authorization information. Since the data authorization information represents the user's data authorization behavior, the method of calling the smart contract to store the data authorization information in the embodiment of the present invention can make the user's data authorization behavior tamper-proof in the blockchain-based system, filling the gap in the secure storage of user data authorization behavior in traditional businesses and improving the user's sense of security.
[0051] In an optional embodiment, step S102, the application layer determines the structure to be uploaded to the chain according to the data elements, including the following steps: the application layer generates a system authorization serial number according to the data elements, and determines the structure to be uploaded to the chain based on the data elements and the system authorization serial number.
[0052] In an optional embodiment, if Figure 2 As shown, the above-mentioned determination of the structure to be put on the chain based on the data elements and the system authorization serial number includes the following steps:
[0053] Step S201, determining the data query party number, customer identification code and system business serial number as the first primary key;
[0054] Step S202, determining the system authorization serial number, the transaction initiator number, the data provider number, the data query party number, the data authorization application summary and the transaction initiation time as the first encrypted content;
[0055] Step S203, encrypting the first encrypted content by using the public key of the data querying party to obtain a first ciphertext;
[0056] Step S204: determine the first primary key and the first ciphertext as structures to be chained.
[0057] In the embodiment of the present invention, the structure to be uploaded includes visible plaintext information and the first ciphertext, which can ensure the design of a secure transmission mechanism.
[0058] In an optional embodiment, if Figure 3 As shown, in step S107, calling the smart contract to store the data authorization information includes the following steps:
[0059] Step S301, determining the target party code and the system authorization serial number as the second primary key; wherein the target party is any one of the transaction initiator, the transaction query party and the transaction provider;
[0060] Step S302, determining the customer identification code, system service serial number, data authorization result, data authorization summary, authorization rejection summary and data authorization time as the second encrypted content;
[0061] Step S303, encrypting the second encrypted content by using the public key of the target party to obtain a second ciphertext;
[0062] Step S304: Call the smart contract to write the second ciphertext and the second primary key into the blockchain account book.
[0063] In an embodiment of the present invention, the blockchain application layer software can use the transaction initiator number and the system authorization serial number, the authorized transaction applicant number and the system authorization serial number, and the data provider number and the system authorization serial number as the second primary key, and the encrypted second encrypted information (i.e., the second ciphertext) as a user data authorization result on the blockchain for storage. Since the second primary key has the above three forms, three copies of the evidence content can be stored accordingly. The second encrypted information in the three copies of the evidence content can be encrypted by the blockchain application layer software using the transaction initiator public key, the data query party public key, and the data provider public key in sequence.
[0064] In an optional embodiment, if Figure 4 As shown, the method also includes:
[0065] Step S108, the application layer receives the second primary key sent by the target party;
[0066] In the embodiment of the present invention, the target party is any one of the transaction initiator, the data query party and the data provider;
[0067] Step S109, the application layer calls the smart contract to search the corresponding second ciphertext in the blockchain account book according to the second primary key;
[0068] Step S110: the application layer parses the second ciphertext based on the private key of the target party, and returns the parsed second encrypted content to the target party, so that the target party can view the second encrypted content.
[0069] In an embodiment of the present invention, when a request is received from the transaction initiator for querying user data authorization, the second primary key may refer to: the transaction initiator number and the system authorization serial number; when a request is received from the data query party for querying user data authorization, the second primary key may refer to: the data query party number and the system authorization serial number; when a request is received from the data provider for querying user data authorization results, the second primary key may refer to: the data provider number and the system authorization serial number.
[0070] The following introduction is made by taking the transaction initiator initiating the query of user data authorization as an example: if a transaction for querying the user data authorization result is received, the blockchain application layer software can call the blockchain smart contract, so that the blockchain smart contract uses the transaction initiator number and the system authorization serial number as the query conditions to query the on-chain information (i.e., the second ciphertext), and returns the found second ciphertext to the blockchain application layer software. The blockchain application layer software parses the second ciphertext returned by the smart contract according to the transaction initiator's private key, and returns all the parsed second encrypted contents to the transaction initiator for review.
[0071] This embodiment can include application for user data authorization, evidence storage of user data authorization, and query of user data authorization results. Therefore, this embodiment has the following advantages: 1) clear logic; 2) good user experience; 3) filling the gap of secure evidence storage of user data authorization behavior in traditional business; 4) user data authorization behavior becomes tamper-proof in the blockchain-based system; 5) user data authorization behavior is upgraded to protected, traceable, and tamper-proof data content, and user security is improved.
[0072] Embodiment 2:
[0073] Figure 5 It is a flowchart of the interaction between the blockchain system, the transaction initiator, the data query party and the data provider. This embodiment gives a specific embodiment of embodiment 1, and the process can be as follows Figure 5 As shown:
[0074] Step 1: Initiate a data authorization application transaction;
[0075] Step 2: Blockchain application layer software public key encryption processing;
[0076] Step 3: The blockchain smart contract writes the data authorization application transaction into the blockchain ledger;
[0077] Step 4: Query data authorization application transaction;
[0078] Step 5: The blockchain application layer software calls the blockchain smart contract to query the transactions on the blockchain ledger;
[0079] Step 6: The blockchain application layer software uses the private key of the data query party to parse the data content and returns it to the data query party;
[0080] Step 7: Present data authorization application information and obtain user data authorization;
[0081] Step 8: Initiate a transaction to write the authorization result into the blockchain account book;
[0082] Step 9: The blockchain application layer software writes the data authorization results into multiple copies of evidence into the blockchain account book;
[0083] Step 10, initiate authorization result query;
[0084] Step 11, the blockchain application layer software queries the user authorization result;
[0085] Step 12: Use the data provider's private key to parse and return the user data authorization result content.
[0086] Figure 5 The dotted box in the figure represents a mechanism that supports transaction-related parties to query the user data authorization results, but is invisible to non-related parties, ensuring the security of user data authorization privacy. The dotted box is equivalent to steps 10 to 12, except that the subjects of the interaction are different.
[0087] In the embodiment of the present invention, the data structure design of the data authorization application and data authorization result in steps 3 and 9 on the blockchain account book. The design of the end-to-end secure transmission mechanism of the privacy information involved in the data authorization and data authorization result based on the blockchain system in steps 2, 6, 9, and 12. This design realizes a mechanism in which the privacy information in the data authorization process on the blockchain public account book can only be known by the transaction-related parties and is shielded from viewing by unrelated parties. The design of transaction data elements in steps 1, 2, 4, 8, and 10.
[0088] Embodiment 3:
[0089] Figure 6 A schematic diagram of the structure of a blockchain-based data authorization and evidence storage system provided by an embodiment of the present invention. Figure 6 As shown, the blockchain-based data authorization evidence storage system mainly includes: blockchain 10, application layer 11, smart contract 12, blockchain account book 13, transaction initiator 20, data query party 30 and data provider 40. The blockchain-based data authorization evidence storage system is mainly used to execute the blockchain-based data authorization evidence storage method provided in the above content of Example 1. Therefore, the method of calling the smart contract in the blockchain to store data authorization information in the embodiment of the present invention can make the user's data authorization behavior tamper-proof in the blockchain-based system, fill the gap in the safe evidence storage of user data authorization behavior in traditional business, and improve the user's sense of security.
[0090] In an optional embodiment, this embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the above method embodiment are implemented.
[0091] In an optional embodiment, this embodiment further provides a computer-readable medium having a non-volatile program code executable by a processor, wherein the program code enables the processor to execute the method of the above method embodiment.
[0092] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0093] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the aforementioned embodiments, those of ordinary skill in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed by the present invention, or can easily conceive of changes, or make equivalent replacements for some of the technical features therein. Such modifications, changes or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention.
Claims
1. A data authorization and evidence storage method based on blockchain, characterized in that: Applied to blockchain including smart contracts, blockchain ledger and application layers, including: The application layer receives data elements corresponding to the user data authorization transaction under the trigger of the transaction initiator; the data elements include: one or more of the transaction initiator number, data provider number, data query party number, system business serial number, customer identification code, data authorization application summary and transaction initiation time; The application layer generates a system authorization serial number according to the data element, and determines a structure to be put on the chain based on the data element and the system authorization serial number; wherein the structure to be put on the chain includes: a first primary key and a first ciphertext, wherein the first primary key is visible plaintext information; determining the structure to be put on the chain based on the data element and the system authorization serial number includes: determining the data query party number, the customer identification code and the system business serial number as the first primary key; determining the system authorization serial number, the transaction initiator number, the data provider number, the data query party number, the data authorization application summary and the transaction initiation time as the first encrypted content; encrypting the first encrypted content by using the public key of the data query party to obtain a first ciphertext; determining the first primary key and the first ciphertext as the structure to be put on the chain; The smart contract writes the structure to be uploaded into the blockchain account book; The application layer receives a query request initiated by a data query party corresponding to the user data authorization transaction; wherein the query request carries a first primary key; The application layer calls the smart contract to search the corresponding target structure to be uploaded to the blockchain account book according to the first primary key; The application layer parses the first ciphertext in the target to-be-uploaded structure based on the private key of the data query party, and returns the parsed first encrypted content to the data query party, so that the data query party obtains user data authorization based on the first encrypted content; The application layer, after the user data is authorized, receives the data authorization information sent by the data query party, and calls the smart contract to store the data authorization information; the data authorization information includes: one or more of the transaction initiator number, data query party number, data provider number, system business serial number, system authorization serial number, data authorization result, data authorization summary, authorization rejection summary, and data authorization time; The data authorization information is stored, including: determining any one of the transaction initiator number, the data query party number and the data provider number and the system authorization serial number as a second primary key; determining the customer identification code, the system business serial number, the data authorization result, the data authorization summary, the authorization rejection summary and the data authorization time as a second encrypted content; encrypting the second encrypted content by the public key of the data query party to obtain a second ciphertext; calling the smart contract to write the second ciphertext and the second primary key into the blockchain account book; After the data authorization information is stored as a notary, the method further includes: the application layer, receiving a second primary key sent by any one of the transaction initiator, the data query party and the data provider; the application layer, calling the smart contract to search for the corresponding second ciphertext in the blockchain account book according to the second primary key; the application layer, parsing the second ciphertext based on the private key of the data query party, and returning the parsed second encrypted content to the transaction initiator, the data query party or the data provider, so that the transaction initiator, the data query party or the data provider can view the second encrypted content.
2. A data authorization storage system based on blockchain, characterized in that: include: The method as claimed in claim 1 includes a smart contract, a blockchain ledger and a blockchain at the application layer, a transaction initiator, a data query party and a data provider.
3. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the method according to claim 1 is implemented.
4. A computer-readable medium having a non-volatile program code executable by a processor, characterized in that: The program code causes the processor to perform the method of claim 1.
Citation Information
Patent Citations
Blockchain based transaction execution method and device and electronic equipment
CN108389129A
Blockchain-based searchable encryption method
CN108768990A
Data authorization and query method and device based on block chain
CN110060162A
Private data query method and device based on off-chain authorization
CN110580413A
Private data query method and device based on blockchain account
CN110580418A
