Data sharing method, server, client and storage medium

Through blockchain technology, user information and authentication information are stripped from the server to the client to save, solving the security problem of the data sharing platform and achieving higher data sharing security and user information protection.

CN115688188BActive Publication Date: 2025-08-22CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110823430.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-21
Publication Date
2025-08-22
Estimated Expiration
2041-07-21

AI Technical Summary

Technical Problem

The existing data sharing platform tamper with regard to user information management and data security, and user information and authentication information are stored in the database of the data sharing service, resulting in low security performance.

Method used

Using blockchain technology, the server separates user information and authentication information from the client, obtains and verifys information through the blockchain network, and the client saves user information and authentication information, and the server only conducts verification and generates authentication information.

Benefits of technology

It improves the security of data sharing between servers and clients, reduces the risk of data being tampered with, and enhances the protection of user information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115688188B_ABST
    Figure CN115688188B_ABST
Patent Text Reader

Abstract

The present invention discloses a data sharing method, server, client, and storage medium. The method applied to the server includes: obtaining transaction information generated by a client from a blockchain network, in which the transaction recipient is a first account address; verifying the transaction information, and if the transaction information passes the verification, using the transaction information to generate authentication information in which the transaction sender is a second account address; sending the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network; upon receiving data sharing request information sent by the client based on the authentication information, obtaining confirmation information generated by the client based on the authentication information from the blockchain network; and sharing data with the client based on the confirmation information and the data sharing request information. Through the above technical solution, the security of data sharing between the server and the client is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of digital resource protection, and in particular to a data sharing method, a server, a client, and a storage medium. Background Art

[0002] With the development of informatization, data security of data sharing service platforms has received more and more attention.

[0003] At present, service providers that provide data sharing platforms generally require users who receive services to register on the data sharing platform. Then, the data sharing platform will store the user information in the database. When the user applies for data sharing services, the legitimacy of the user's request will be judged based on the information stored in the database, and then the data sharing service will be provided.

[0004] However, when it comes to solutions to data security issues, data sharing service platforms all start from the perspective of organizational management, ensuring data security by increasing the difficulty of obtaining data modification permissions. This does not change the fact that data sharing platforms are inherently incapable of resisting tampering, and there is a risk of data tampering. Moreover, during the user registration process of the data sharing solution, users' personal information and authentication information are saved and maintained by the database of the data sharing service. This organizational management based on human subjective consciousness is uncertain, and user information loss and theft often occur. It is especially difficult to prevent problems caused by internal personnel's negligence or intentional actions, and the security performance is relatively low. Summary of the Invention

[0005] To solve the above technical problems, embodiments of the present invention hope to provide a data sharing method, server, client and storage medium. The server and client obtain and verify information based on blockchain technology, and separate user information and authentication information from the server and save them by the client, thereby improving the security of data sharing between the server and the client.

[0006] The technical solution of the present invention is achieved as follows:

[0007] The present invention provides a data sharing method, which is applied to a server, and the method comprises:

[0008] Obtaining, from the blockchain network, transaction information generated by a client, where the transaction recipient is a first account address; the first account address is the blockchain account address of the server;

[0009] Verifying the transaction information and, if the transaction information passes verification, using the transaction information to generate authentication information that the transaction sender is a second account address; the second account address is the blockchain account address of the client;

[0010] Sending the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network;

[0011] Upon receiving data sharing request information sent by the client based on the authentication information, obtaining confirmation information generated by the client based on the authentication information from the blockchain network;

[0012] Based on the confirmation information and the data sharing request information, data is shared with the client.

[0013] The present invention provides a data sharing method, applied to a client, comprising:

[0014] Obtaining, from the blockchain network, authentication information generated by the server, indicating that the transaction sender is a second account address, where the second account address is the blockchain account address of the client;

[0015] Verifying the authentication information and obtaining a current timestamp if the authentication information passes verification;

[0016] Generate user encryption information and confirmation information based on the current timestamp and the authentication information, and encapsulate the user encryption information into data sharing request information;

[0017] The data sharing request information is sent to the server, and the confirmation information is sent to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

[0018] The present invention provides a server, comprising:

[0019] A first acquisition module is configured to acquire, from the blockchain network, transaction information generated by a client, where the transaction recipient is a first account address; the first account address is the blockchain account address of the server;

[0020] a first processing module, configured to verify the transaction information and, if the transaction information passes verification, use the transaction information to generate authentication information that the transaction sender is a second account address; the second account address is the blockchain account address of the client;

[0021] A first sending module, configured to send the authentication information to the blockchain network, so that the client can obtain the authentication information through the blockchain network;

[0022] The first acquisition module is further configured to, upon receiving data sharing request information sent by the client based on the authentication information, obtain confirmation information generated by the client based on the authentication information from the blockchain network;

[0023] The first processing module is further configured to share data with the client based on the confirmation information and the data sharing request information.

[0024] The present invention provides a server, comprising a first processor, a first memory and a first communication bus;

[0025] The first communication bus is used to implement a communication connection between the first processor and the first memory;

[0026] The first processor is configured to execute the first data sharing program stored in the first memory to implement the above-mentioned data sharing method applied to the server.

[0027] The present invention provides a client, comprising:

[0028] A second acquisition module is configured to obtain, from the blockchain network, authentication information generated by the server, in which the transaction sender is a second account address, where the second account address is the blockchain account address of the client;

[0029] A second processing module is configured to verify the authentication information and obtain a current timestamp if the authentication information passes the verification;

[0030] The second processing module is further configured to generate user encryption information and confirmation information based on the current timestamp and the authentication information, and encapsulate the user encryption information into data sharing request information;

[0031] The second sending module is used to send the data sharing request information to the server and send the confirmation information to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

[0032] The present invention provides a client, comprising a second processor, a second memory, and a second communication bus;

[0033] The second communication bus is used to implement a communication connection between the second processor and the second memory;

[0034] The second processor is configured to execute the second data sharing program stored in the second memory to implement the above-mentioned data sharing method applied to the client.

[0035] The present invention provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement any of the data sharing methods described above.

[0036] The present invention provides a data sharing method, server, client, and storage medium. The data sharing method applied to the server includes: obtaining transaction information generated by a client from a blockchain network, in which the transaction recipient is a first account address; verifying the transaction information, and if the transaction information passes the verification, using the transaction information to generate authentication information in which the transaction sender is a second account address; sending the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network; upon receiving data sharing request information sent by the client based on the authentication information, obtaining confirmation information generated by the client based on the authentication information from the blockchain network; and sharing data with the client based on the confirmation information and the data sharing request information. In the technical solution provided by the present invention, the server and the client obtain and verify information based on blockchain technology, and user information and authentication information are separated from the server and stored by the client, thereby improving the security of data sharing between the server and the client. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a data sharing method provided in an embodiment of the present invention Figure 1 ;

[0038] Figure 2 A schematic diagram of an exemplary process for verifying transaction information provided by an embodiment of the present invention;

[0039] Figure 3 A schematic diagram of an exemplary process for generating authentication information provided by an embodiment of the present invention;

[0040] Figure 4 A schematic diagram of an exemplary process for confirming transaction information provided by an embodiment of the present invention;

[0041] Figure 5 A schematic diagram of an exemplary process of responding to a data sharing request provided in an embodiment of the present invention;

[0042] Figure 6 A schematic diagram of an exemplary process of a server responding to a client's data sharing request provided in an embodiment of the present invention;

[0043] Figure 7 A schematic diagram of a data sharing method provided in an embodiment of the present invention Figure 2 ;

[0044] Figure 8A schematic diagram of an exemplary process for generating transaction information provided by an embodiment of the present invention;

[0045] Figure 9 A schematic diagram of an exemplary process of a client initiating a data sharing request provided in an embodiment of the present invention;

[0046] Figure 10 A schematic diagram of the structure of a server provided in an embodiment of the present invention Figure 1 ;

[0047] Figure 11 A schematic diagram of the structure of a server provided in an embodiment of the present invention Figure 2 ;

[0048] Figure 12 A schematic diagram of the structure of a client provided in an embodiment of the present invention Figure 1 ;

[0049] Figure 13 A schematic diagram of the structure of a client provided in an embodiment of the present invention Figure 2 . DETAILED DESCRIPTION

[0050] The following will be combined with the accompanying drawings of the embodiments of the present invention to clearly and completely describe the technical solutions of the present invention. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the related applications and are not intended to limit such applications. It should also be noted that, for ease of description, only the portions relevant to the related applications are shown in the drawings.

[0051] It should be noted that, in the present invention, the data sharing method involves two objects, namely, a server and a client. The following is a detailed description of the data sharing method based on the server and the client.

[0052] The present invention provides a data sharing method, which is applied to a server. Figure 1 A schematic diagram of a data sharing method provided by the present invention Figure 1 .like Figure 1 As shown, it mainly includes the following steps:

[0053] S101. Obtain, from a blockchain network, transaction information generated by a client, where the transaction recipient is a first account address; the first account address is a blockchain account address of a server.

[0054] In an embodiment of the present invention, the server can obtain transaction information generated by the client from the blockchain network, in which the transaction recipient is the first account address, wherein the first account address is the blockchain account address of the server.

[0055] It should be noted that in an embodiment of the present invention, the client purchases an interface provided by the server for realizing data sharing, thereby generating transaction information, and synchronizing the transaction information to the block of the blockchain network. The server obtains the transaction information by continuously synchronizing the newly added blocks in the blockchain network.

[0056] It should be noted that in this embodiment of the present invention, the transaction information obtained by the server from the blockchain network is transaction information in which the transaction recipient is the server's blockchain account address. Furthermore, since the transaction information is generated by the client, the transaction sender is the client's blockchain account address.

[0057] It should be noted that in embodiments of the present invention, transaction information may include information such as the network address of the access interface, interface description, billing mode, interface price, order identifier, interface hash value, and client blockchain account public key, and may also include other transaction-related information. The specific transaction information is not limited in embodiments of the present invention.

[0058] S102. Verify the transaction information. If the transaction information passes the verification, use the transaction information to generate authentication information indicating that the transaction sender is a second account address; the second account address is the client's blockchain account address.

[0059] In an embodiment of the present invention, the server verifies the transaction information, and if the transaction information passes the verification, uses the transaction information to generate authentication information that the transaction sender is a second account address, wherein the second account address is the blockchain account address of the client.

[0060] It should be noted that, in an embodiment of the present invention, after obtaining the transaction information that the transaction recipient is its own blockchain account address, the server needs to verify the transaction information to determine whether the transaction information is legal.

[0061] Figure 2 The following is a flow chart of an exemplary process of verifying transaction information provided by an embodiment of the present invention. Figure 2 As shown, the server verifies the transaction information, which mainly includes the following steps:

[0062] S201. Obtain order information corresponding to the order identifier in the transaction information from the blockchain network, and perform a validity check on the order information.

[0063] In an embodiment of the present invention, after obtaining the transaction information, the server uses the order identifier included in the transaction information to obtain the corresponding order information from the blockchain network and performs a validity check on the order information.

[0064] It should be noted that in the embodiment of the present invention, order information corresponding to different order identifiers is stored in the blockchain network. When the server verifies the legitimacy of the order information, the server obtains the order information from the blockchain network. Due to the characteristics of the blockchain network itself such as non-forgeability, traceability, openness and transparency, and collective maintenance, all changes and modifications to the order information can be directly known, which increases the difficulty of malicious modification and ensures the security of the order information.

[0065] It should be noted that in an embodiment of the present invention, the order information corresponds to the order identifier one-to-one. The server can obtain the order identifier from the transaction information, and further search for the order information corresponding to the order identifier from the blockchain network.

[0066] It should be noted that, in an embodiment of the present invention, after obtaining the order information, the server obtains information in the order information indicating the payment status, such as information on successful payment or failed payment. If the payment fails, the order information verification fails. If the order information payment is successful, it is further determined whether the payment amount included in the order information is consistent with the price corresponding to the interface of the data sharing purchased in the transaction information. If they are consistent, the order information verification is determined to have passed. If they are inconsistent, the order information verification is determined to have failed.

[0067] S202. When the order information is verified, obtain the interface information that matches the interface hash value included in the target interface information in the transaction information from the preset smart contract.

[0068] In an embodiment of the present invention, after obtaining the order information, the server performs a validity check on the order information, and if the order information passes the check, obtains the target interface information in the transaction information.

[0069] It should be noted that, in an embodiment of the present invention, after the order information is verified, the server obtains interface information that matches the interface hash value included in the target interface information in the transaction information from the preset smart contract.

[0070] It should be noted that in an embodiment of the present invention, the preset smart contract is a smart contract created by the server using the data sharing interface information before data sharing, wherein the interface information may include network address, interface description, billing mode, interface price, third-party payment interface, interface hash value and other information, and may also include other information related to the interface information. The specific content of the interface information can be set according to actual needs and application scenarios, and this application does not limit this.

[0071] S203: If the acquired interface information is consistent with the target interface information, it is determined that the transaction information verification has passed.

[0072] In an embodiment of the present invention, when the server obtains the target interface information, it obtains the interface information that matches the interface hash value included in the target interface information from the preset smart contract.

[0073] It should be noted that, in the embodiment of the present invention, the server compares the target interface information with the acquired interface information, and determines that the transaction information verification has passed when the acquired interface information is consistent with the target interface information.

[0074] It should be noted that, in the embodiment of the present invention, if the interface information obtained by the server is inconsistent with the target interface information, it is determined that the transaction information verification has failed, and therefore the server cannot generate authentication information using the transaction information.

[0075] Figure 3 The following is a flow chart of an exemplary process of generating authentication information provided by an embodiment of the present invention. Figure 3 As shown, the server uses the transaction information to generate authentication information that the transaction sender is the second account address, which mainly includes the following steps:

[0076] S301. Generate basic authentication information using target interface information in transaction information.

[0077] In an embodiment of the present invention, the server generates basic authentication information using the target interface information in the transaction information.

[0078] It should be noted that, in the embodiment of the present invention, when the transaction information is verified, the server generates basic authentication information using the target interface information in the transaction information. The basic authentication information includes the time limit information of the specified user for the specified interface at the specified time.

[0079] S302: Generate data sharing restriction information using the billing model and basic authentication information in the transaction information.

[0080] In an embodiment of the present invention, the server generates data sharing restriction information using the billing mode and basic authentication information in the transaction information.

[0081] It should be noted that in the embodiments of the present invention, the billing mode can be monthly billing, quarterly billing, or annual billing, etc. The specific billing mode can be set according to actual needs and application scenarios, and this application does not limit this.

[0082] It should be noted that in an embodiment of the present invention, the server generates data sharing restriction conditions based on the specific billing model and basic authentication information. The data sharing restriction conditions may include key information such as users, interface information, and purchase period. The server may also set them according to scenario requirements and actual applications. The present invention does not limit the specific data sharing restriction conditions.

[0083] S303: Concatenate the data sharing restriction information and the preset random information into information to be signed, and use the server's blockchain account private key to sign the information to be signed to obtain signature identification information.

[0084] In an embodiment of the present invention, the server concatenates the data sharing restriction information and the preset random information into information to be signed, and uses the server's blockchain account private key to sign the information to be signed to obtain signature identification information.

[0085] It should be noted that, in the embodiment of the present invention, the preset random information may be a value randomly generated by the server, and the specific preset random information is not limited in this application.

[0086] It should be noted that, in an embodiment of the present invention, the server assembles the data sharing restriction information and the preset random information into the information to be signed according to the agreement, and then uses the server's blockchain account private key to sign the information to be signed to generate signature identification information. The signature identification information includes an identifier that can represent that the information is generated by the server, so that when the client obtains the signature identification information, it can determine the server that generated the signature identification information.

[0087] It should be noted that in the embodiments of the present invention, the sharing restriction information, preset random information, and signature identification information can be a character string or any other form of information. The specific form of the sharing restriction information, preset random information, and signature identification information is not limited in this application.

[0088] S304: Concatenate the signature identification information and the information to be signed into unencrypted verification information.

[0089] In an embodiment of the present invention, the server concatenates the signature identification information and the information to be signed into unencrypted verification information.

[0090] It should be noted that, in the embodiment of the present invention, the signature identification information and the information to be signed can be a character string spliced ​​together in an agreed format, or can be any other form of information. The specific form of the information is not limited in this application.

[0091] S305. Use the client's blockchain account public key in the transaction information to encrypt the unencrypted verification information to generate encrypted verification information, and encapsulate the encrypted verification information and the server's blockchain account public key into authentication information.

[0092] In an embodiment of the present invention, the server uses the client's blockchain account public key in the transaction information to encrypt the unencrypted verification information, generate encrypted verification information, and encapsulates the encrypted verification information and the server's blockchain account public key into authentication information.

[0093] It should be noted that, in an embodiment of the present invention, the server uses an asymmetric encryption algorithm to protect the user's transaction information. Without obtaining the client's blockchain account private key, the server uses the client's blockchain account public key to encrypt the unencrypted verification information. This is so that when the client obtains the encrypted verification information in the authentication information, it can use the client's blockchain account private key to decrypt it.

[0094] S103: Send the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network.

[0095] In an embodiment of the present invention, the server sends the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network.

[0096] It should be noted that in an embodiment of the present invention, after the server processes the transaction information and generates authentication information, it sends the authentication information to the blockchain network. That is to say, the server only verifies the transaction information and generates authentication information, and does not store it. The client does not need to send the user's personal information to the server, thereby ensuring the security of the user's personal information.

[0097] It should be noted that, in an embodiment of the present invention, the server sends the authentication information to the blockchain network, and the client can obtain the authentication information from the blockchain network and verify the authentication information.

[0098] Figure 4 The following is a flow chart of an exemplary process for confirming transaction information provided by an embodiment of the present invention. Figure 4As shown, when the server obtains the transaction information, it obtains the order identifier from the transaction information, and uses the order identifier to obtain the order information corresponding to the order identifier from the blockchain network, and verifies the order information. If the verification fails, it ends directly. If the verification passes, it generates shared restriction information, which is spliced ​​with the preset random information generated by the server to generate information to be signed. Then, the server's blockchain account private key is used to sign the information to obtain signature identification information, and the information to be signed is spliced ​​with the signature identification information to generate unencrypted verification information. Finally, the client's blockchain account public key in the transaction information is used to encrypt the unencrypted verification information to generate encrypted verification information. The encrypted verification information and the server's blockchain account public key are encapsulated into authentication information and broadcast.

[0099] S104. Upon receiving the data sharing request information sent by the client based on the authentication information, obtain confirmation information generated by the client based on the authentication information from the blockchain network.

[0100] In an embodiment of the present invention, upon receiving data sharing request information sent by the client based on authentication information, the server obtains confirmation information generated by the client based on the authentication information from the blockchain network.

[0101] It should be noted that, in an embodiment of the present invention, after receiving the data sharing request information sent from the client based on the authentication information, the server obtains the confirmation information generated by the client based on the authentication information from the blockchain network, that is, the confirmation information obtained from the blockchain network corresponds to the data sharing request.

[0102] S105: Sharing data with the client based on the confirmation information and the data sharing request information.

[0103] In an embodiment of the present invention, the server shares data with the client based on the confirmation information and the data sharing request information.

[0104] It should be noted that, in an embodiment of the present invention, after the server parses the data sharing request information, it first determines whether the data sharing request information is generated by the client, and then obtains the maximum timestamp from the standard timestamp carried by the confirmation information stored in the blockchain network to determine whether the data sharing request has been responded to. If it has been responded to, the data sharing request is ignored; if it has not been responded to, the data sharing request is responded to and data is shared with the client.

[0105] Figure 5 The following is a flow chart of an exemplary response to a data sharing request message provided by an embodiment of the present invention. Figure 5As shown, the server shares data with the client based on the confirmation information and data sharing request information, mainly including the following steps:

[0106] S501. Parse the data sharing request information to obtain unencrypted verification information, standard timestamp, interface hash value and client's blockchain account address.

[0107] In an embodiment of the present invention, the server parses the data sharing request information to obtain unencrypted verification information, a standard timestamp, an interface hash value, and the client's blockchain account address.

[0108] It should be noted that in an embodiment of the present invention, the server parses the data sharing request information and can perform data analysis in a targeted manner based on the way the client generates the data sharing request, or it can only verify whether the necessary information of the data sharing request information is correct without obtaining specific data. The specific analysis method is not limited in this application.

[0109] S502: Parse the unencrypted verification information to obtain signature identification information, and verify the signature identification information using the server's blockchain account private key.

[0110] In an embodiment of the present invention, the server parses the unencrypted verification information to obtain the signature identification information, and verifies the signature identification information using the server's blockchain account private key.

[0111] It should be noted that, in an embodiment of the present invention, the server needs to verify the signature identification information to verify whether the signature identification information is generated by the client. If it is determined that the signature identification information is generated by the client, the timeliness of the data sharing request is further confirmed. If the signature identification information is not generated by the server for the client, the data sharing request will not be responded to.

[0112] S503: Generate a keyword using the interface hash value and the client's blockchain account address.

[0113] In an embodiment of the present invention, the server generates a keyword using the interface hash value and the client's blockchain account address.

[0114] It should be noted that in an embodiment of the present invention, the server can generate keywords according to the agreed hash algorithm through the interface hash value and the client's blockchain account address, or it can generate keywords according to other algorithms. The specific method of generating keywords is not limited in this application.

[0115] S504: When the signature identification information is verified, the keyword is searched from the local memory, and when the keyword is found, the cache timestamp corresponding to the keyword is obtained.

[0116] In an embodiment of the present invention, when the signature identification information is verified successfully, the server searches for a keyword from the local memory, and when the keyword is found, obtains a cache timestamp corresponding to the keyword.

[0117] It should be noted that, in an embodiment of the present invention, after the server determines that the signature identification information is indeed generated by the client, it searches for the keyword through the server's local memory. If the keyword is found in the local memory, the cache timestamp corresponding to the keyword is obtained. If the keyword is not found in the local memory, it is necessary to further obtain the maximum timestamp in the blockchain network based on the interface hash value.

[0118] S505: When the cache timestamp is smaller than the standard timestamp, respond to the data sharing request information.

[0119] In an embodiment of the present invention, the server responds to the data sharing request information when the cache timestamp is smaller than the standard timestamp.

[0120] It should be noted that, in an embodiment of the present invention, since the data sharing request is encapsulated in the form of a token, it can only be responded to once. If the cache timestamp is less than the standard timestamp, it means that the data sharing request has never been responded to, and the server responds to the data sharing request. If the cache timestamp is greater than or equal to the standard timestamp, it means that the data sharing request information has been responded to, and the server does not respond to the data sharing request.

[0121] Specifically, in an embodiment of the present invention, after the server queries the keyword from the local memory, it also includes: if the keyword is not queried, obtaining the maximum timestamp in the blockchain network according to the interface hash value; if the maximum timestamp is less than the standard timestamp, responding to the data sharing request information and caching the standard timestamp in the blockchain network.

[0122] It should be noted that, in an embodiment of the present invention, when the server fails to find a timestamp in the local memory, it obtains the maximum timestamp from the blockchain network. If the maximum timestamp is smaller than the standard timestamp, it responds to the data sharing request information. If the maximum timestamp is larger than the standard timestamp, it indicates that the data sharing request has been responded to. Therefore, the server does not respond to the data sharing request information, thereby avoiding the server repeatedly responding to the same data sharing request information.

[0123] It should be noted that, in an embodiment of the present invention, the maximum timestamp obtained by the server from the blockchain network is the maximum timestamp in the standard timestamp information carried by the confirmation information sent by the client to the blockchain network.

[0124] Figure 6The following is a flow chart of an exemplary server responding to a client data sharing request provided by an embodiment of the present invention. Figure 6 As shown in the figure, when the server receives a data sharing request, it uses the server's blockchain account private key to decrypt it and obtains the unencrypted verification information, standard timestamp, interface hash value and client's blockchain account address. Then, it parses the unencrypted verification information to obtain the signature identification information and the information to be signed. It uses the server's blockchain account private key to verify the signature identification information. If the verification fails, it ends directly. If the verification passes, it generates a keyword based on the interface hash value and the client's blockchain account address, and obtains the corresponding cache timestamp through the keyword. If the cache timestamp exists, the size of the cache timestamp is compared with the standard timestamp. If the cache timestamp does not exist, it is compared based on the interface hash value. The maximum timestamp included in the confirmation information is obtained by the Xi value. If the maximum timestamp exists, the size of the standard timestamp is compared with the maximum timestamp. If the standard timestamp is greater than or equal to the maximum timestamp or the standard timestamp is greater than or equal to the cached timestamp, the process ends directly. If the standard timestamp is less than the maximum timestamp or the standard timestamp is less than the cached timestamp, the standard timestamp is cached in the corresponding keyword, and the data sharing restriction conditions are parsed from the signature identification information to respond to the data sharing request; if the maximum timestamp does not exist, a keyword is generated and cached in the blockchain according to the agreed hash algorithm and the client's blockchain account address, and then the data sharing restriction conditions are parsed from the signature identification information to respond to the data sharing request.

[0125] The present invention provides a data sharing method, applied to a server, comprising: obtaining transaction information generated by a client from a blockchain network, in which the transaction recipient is a first account address; verifying the transaction information, and, if the transaction information passes the verification, using the transaction information to generate authentication information in which the transaction sender is a second account address; sending the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network; upon receiving data sharing request information sent by the client based on the authentication information, obtaining confirmation information generated by the client based on the authentication information from the blockchain network; and sharing data with the client based on the confirmation information and the data sharing request information. The technical solution provided by the present invention enables the server and client to obtain and verify information based on blockchain technology, and further strips user information and authentication information from the server and stores them on the client, thereby improving the security of data sharing between the server and the client.

[0126] The present invention provides a data sharing method, which is applied to a client. Figure 7 A data sharing process diagram provided by an embodiment of the present invention Figure 2 .like Figure 7 As shown, it mainly includes the following steps:

[0127] S701. Obtain authentication information generated by a server from a blockchain network, where the transaction sender is a second account address, where the second account address is the blockchain account address of the client.

[0128] In an embodiment of the present invention, the client obtains authentication information generated by the server from the blockchain network, in which the transaction sender is the second account address, wherein the second account address is the blockchain account address of the client.

[0129] It should be noted that, in an embodiment of the present invention, the client continuously synchronizes newly added blocks, which store transaction information of users subscribing to data sharing interfaces through the blockchain network.

[0130] It should be noted that, in an embodiment of the present invention, the client obtains transaction information of the blockchain account address of the client from the blockchain network.

[0131] Figure 8 A schematic diagram of an exemplary process for generating transaction information provided by an embodiment of the present invention is shown as follows: Figure 8 As shown, before the client obtains the authentication information generated by the server and indicating that the transaction sender is the second account address from the blockchain network, the client further includes the following steps:

[0132] S801. When a preset smart contract generated by a server is called and order payment is completed according to the target interface information in the preset smart contract, an order identifier is obtained.

[0133] In an embodiment of the present invention, the client obtains the order identifier when calling the preset smart contract generated by the server and completing the order payment according to the target interface information in the preset smart contract.

[0134] It should be noted that, in an embodiment of the present invention, the client calls a preset smart contract generated by the server, selects an interface of interest in the preset smart contract, makes payment through a third-party payment link corresponding to the interface, purchases the right to use the data sharing interface, and obtains an order identifier if the payment is successful.

[0135] S802. Generate transaction information using the order identifier and target interface information, with the transaction sender as the client's blockchain account address and the transaction receiver as the server's blockchain account address.

[0136] In an embodiment of the present invention, the client uses the order identifier and the target interface information to generate transaction information with the transaction sender as the client's blockchain account address and the transaction receiver as the server's blockchain account address.

[0137] It should be noted that, in the embodiment of the present invention, the client generates transaction information using the order identifier and the corresponding target interface information. The transaction information includes the target interface information and the order identifier.

[0138] S803: Send the transaction information to the blockchain network so that the server can obtain the transaction information through the blockchain network.

[0139] In an embodiment of the present invention, the client sends the transaction information to the blockchain network so that the server can obtain the transaction information through the blockchain network.

[0140] It should be noted that in the embodiment of the present invention, the client sends the transaction information to the blockchain network. Due to the characteristics of the blockchain itself, the entire process of the server obtaining the transaction information from the blockchain network is traceable, transparent and open, thereby ensuring the security of the transaction information.

[0141] S702: Verify the authentication information, and if the authentication information verification passes, obtain the current timestamp.

[0142] In an embodiment of the present invention, the client verifies the authentication information and obtains the current timestamp if the authentication information passes the verification.

[0143] It should be noted that, in the embodiment of the present invention, after verifying the authentication information, the client needs to obtain the current timestamp so as to subsequently determine the timeliness of the data sharing information based on the current timestamp.

[0144] Specifically, in an embodiment of the present invention, the client verifies the authentication information, including: using the client's blockchain account private key to decrypt the encrypted verification information in the authentication information to obtain unencrypted verification information, and parsing the unencrypted verification information to obtain signature identification information; obtaining the server's blockchain account public key from the authentication information; and using the server's blockchain account public key to verify the signature identification information.

[0145] It should be noted that, in an embodiment of the present invention, after the server uses the client's blockchain account address public key to encrypt the unencrypted verification information, the corresponding client needs to use the client's blockchain account address private key to decrypt the encrypted verification information. An asymmetric encryption algorithm is used to achieve mutual verification between the client and the server without obtaining the server's blockchain account private key and encryption algorithm. The asymmetric encryption algorithm is used, which is almost impossible to crack within a preset time using existing technical means, thereby ensuring the security of the information.

[0146] It should be noted that, in an embodiment of the present invention, after obtaining the signature identification information, the client uses the blockchain account public key of the server included in the authentication information to verify whether the signature identification information is signed by the corresponding server. If so, it is determined that the authentication information verification has passed. If not, it is determined that the authentication information verification has failed, thereby avoiding the phenomenon of other server information being mistransmitted or stolen by other servers.

[0147] S703: Generate user encryption information and confirmation information based on the current timestamp and authentication information, and encapsulate the user encryption information into data sharing request information.

[0148] In an embodiment of the present invention, the client generates user encryption information and confirmation information based on the current timestamp and authentication information, and encapsulates the user encryption information into data sharing request information.

[0149] Specifically, in an embodiment of the present invention, the client generates user encryption information and confirmation information based on the current timestamp and authentication information, including: obtaining transaction information corresponding to the authentication information, and obtaining target interface information from the transaction information; formatting the current timestamp to generate a standard timestamp, and using the standard timestamp, unencrypted verification information, the interface hash value included in the target interface information, and the client's blockchain account address to generate user information; using the server's blockchain account public key to encrypt the user information to generate user encryption information; and encapsulating the interface hash value and the standard timestamp into confirmation information.

[0150] It should be noted that in an embodiment of the present invention, the client formats the current timestamp obtained, or performs any other form of processing to obtain a standard timestamp, so that if the standard timestamp is stolen or intentionally leaked, it is not easily changed. The specific processing method is not limited by the present invention.

[0151] It should be noted that in the embodiment of the present invention, the client uses the server's blockchain account public key to encrypt user information so that when the server obtains the user's encrypted information, it can decrypt it through the server's blockchain account address private key to obtain the user information.

[0152] It should be noted that, in an embodiment of the present invention, the server can encapsulate user encrypted information as a Token into a data sharing request, and the server can set the validity period of the Token. For example, after responding to a data sharing request carrying a Token once, the Token will become invalid. This can avoid repeated responses to data sharing requests. The specific validity period of the token is not limited in this application.

[0153] S704: Send the data sharing request information to the server, and send the confirmation information to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

[0154] In an embodiment of the present invention, the client sends data sharing request information to the server and sends confirmation information to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

[0155] Figure 9 The following is a flow chart of an exemplary client initiating a data sharing request according to an embodiment of the present invention. Figure 9 As shown, when the client obtains the authentication information of the blockchain account address of the client as the sender of the transaction from the blockchain network, it obtains the encrypted verification information in the authentication information, first uses the client's blockchain account private key to decrypt the encrypted verification information to obtain unencrypted verification information, parses the unencrypted verification information to obtain signature identification information and information to be signed, and then uses the server's blockchain account public key to sign the signature identification information. If the verification fails, it ends directly. If the verification passes, the current timestamp is obtained, and the current timestamp is formatted to generate a standard timestamp, and then the standard timestamp, unencrypted verification information, the interface hash value included in the target interface information, and the client's blockchain account address are used to generate user information. Finally, the server's blockchain account public key is used to encrypt the user information, generate user encrypted information and put it into the data sharing request information, send a request to the server, and encapsulate the interface hash value and standard timestamp into confirmation information for broadcast.

[0156] The present invention provides a data sharing method, applied to a client, comprising: obtaining authentication information generated by a server from a blockchain network, in which the transaction sender is a second account address; verifying the authentication information; and obtaining a current timestamp if the authentication information passes verification; generating user encryption information and confirmation information based on the current timestamp and the authentication information, and encapsulating the user encryption information into data sharing request information; sending the data sharing request information to the server, and sending the confirmation information to the blockchain network, so that the server can share data with the client based on the data sharing request information and confirmation information. The technical solution provided by the present invention enables the server and client to obtain and verify information based on blockchain technology, and further strips the user information and authentication information from the server and stores them on the client, thereby improving the security of data sharing between the server and the client.

[0157] The present invention provides a server, Figure 10 A schematic diagram of the structure of a server provided in an embodiment of the present invention Figure 1 .

[0158] like Figure 10 As shown, the server includes:

[0159] A first acquisition module 1001 is configured to acquire, from a blockchain network, transaction information generated by a client, where the transaction recipient is a first account address; the first account address is the blockchain account address of the server;

[0160] The first processing module 1002 is configured to verify the transaction information and, if the transaction information passes verification, use the transaction information to generate authentication information that the transaction sender is a second account address; the second account address is the blockchain account address of the client;

[0161] A first sending module 1003 is configured to send the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network;

[0162] The first acquisition module 1001 is further configured to, upon receiving data sharing request information sent by the client based on the authentication information, obtain confirmation information generated by the client based on the authentication information from the blockchain network;

[0163] The first processing module 1002 is further configured to share data with the client based on the confirmation information and the data sharing request information.

[0164] Optionally, the first processing module 1002 is specifically used to obtain order information corresponding to the order identifier in the transaction information from the blockchain network, and perform a legitimacy verification on the order information; if the order information verification passes, obtain interface information that matches the interface hash value included in the target interface information in the transaction information from the preset smart contract; if the obtained interface information is consistent with the target interface information, it is determined that the transaction information verification passes.

[0165] Optionally, the first processing module 1002 is specifically used to generate basic authentication information using the target interface information in the transaction information; generate data sharing restriction information using the billing model and the basic authentication information in the transaction information; splice the data sharing restriction information and the preset random information into information to be signed, and use the blockchain account private key of the server to sign the information to obtain signature identification information; splice the signature identification information and the information to be signed into unencrypted verification information; use the blockchain account public key of the client in the transaction information to encrypt the unencrypted verification information to generate encrypted verification information, and encapsulate the encrypted verification information and the blockchain account public key of the server into the authentication information.

[0166] Optionally, the first processing module 1002 is specifically used to parse the data sharing request information to obtain unencrypted verification information, a standard timestamp, an interface hash value and the blockchain account address of the client; parse the unencrypted verification information to obtain signature identification information, and use the blockchain account private key of the server to verify the signature identification information; use the interface hash value and the blockchain account address of the client to generate a keyword; if the signature identification information is verified, query the keyword from the local memory, and if the keyword is queried, obtain the cache timestamp corresponding to the keyword; if the cache timestamp is less than the standard timestamp, respond to the data sharing request information.

[0167] Optionally, the first processing module 1002 is specifically used to obtain the maximum timestamp in the blockchain network according to the interface hash value when the keyword is not queried; when the maximum timestamp is smaller than the standard timestamp, respond to the data sharing request information and cache the standard timestamp in the blockchain network.

[0168] The present invention provides a data sharing method, which is applied to a server and obtains transaction information generated by a client from a blockchain network, in which the transaction recipient is a first account address; verifies the transaction information, and if the transaction information passes the verification, uses the transaction information to generate authentication information in which the transaction sender is a second account address; sends the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network; upon receiving data sharing request information sent by the client based on the authentication information, obtains confirmation information generated by the client based on the authentication information from the blockchain network; and based on the confirmation information and the data sharing request information, shares data with the client. The technical solution provided by the present invention enables the server and client to obtain and verify information based on blockchain technology, and further separates user information and authentication information from the server and stores them on the client, thereby improving the security of data sharing between the server and the client.

[0169] Figure 11 A schematic diagram of the structure of a server provided in an embodiment of the present invention Figure 2 .like Figure 11 As shown, the server includes a first processor 1101, a first memory 1102 and a first communication bus 1103;

[0170] The first communication bus 1103 is used to implement a communication connection between the first processor 1101 and the first memory 1102;

[0171] The first processor 1101 is configured to execute the first data sharing program stored in the first memory 1102 to implement the above-mentioned data sharing method applied to the server.

[0172] Figure 12 A schematic diagram of the structure of a client provided in an embodiment of the present invention Figure 1 .like Figure 12 As shown, the client includes:

[0173] A second acquisition module 1201 is configured to acquire, from the blockchain network, authentication information generated by the server, in which the transaction sender is a second account address, where the second account address is the blockchain account address of the client;

[0174] The second processing module 1202 is configured to verify the authentication information and obtain a current timestamp if the authentication information passes the verification;

[0175] The second processing module 1202 is further configured to generate user encryption information and confirmation information based on the current timestamp and the authentication information, and encapsulate the user encryption information into data sharing request information;

[0176] The second sending module 1203 is used to send the data sharing request information to the server and send the confirmation information to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

[0177] Optionally, the second processing module 1202 is specifically used to use the client's blockchain account private key to decrypt the encrypted verification information in the authentication information to obtain unencrypted verification information, and parse the unencrypted verification information to obtain signature identification information; obtain the server's blockchain account public key from the authentication information; and use the server's blockchain account public key to verify the signature identification information.

[0178] Optionally, the second processing module 1202 is specifically used to obtain transaction information corresponding to the authentication information, and obtain target interface information from the transaction information; format the current timestamp to generate a standard timestamp, and use the standard timestamp, unencrypted verification information, the interface hash value included in the target interface information, and the blockchain account address of the client to generate user information; use the server's blockchain account public key to encrypt the user information to generate user encrypted information; and encapsulate the interface hash value and the standard timestamp into the confirmation information.

[0179] Optionally, the second processing module 1202 is further used to obtain an order identifier when calling the preset smart contract generated by the server and completing the order payment for the target interface information in the preset smart contract; using the order identifier and the target interface information, generate transaction information with the transaction sender as the blockchain account address of the client and the transaction recipient as the blockchain account address of the server; and send the transaction information to the blockchain network so that the server can obtain the transaction information through the blockchain network.

[0180] Figure 13 A schematic diagram of the structure of a client provided in an embodiment of the present invention Figure 2 .like Figure 13 As shown, the client includes a second processor 1301, a second memory 1302 and a second communication bus 1303;

[0181] The second communication bus 1303 is used to implement a communication connection between the second processor 1301 and the second memory 1302;

[0182] The second processor 1301 is configured to execute the second data sharing program stored in the second memory 1302 to implement the above-mentioned data sharing method applied to the client.

[0183] The present invention provides a data sharing method, which is applied to a client and obtains authentication information generated by a server from a blockchain network, indicating that the transaction sender is a second account address. The authentication information is verified and, if the authentication information passes the verification, the current timestamp is obtained. Based on the current timestamp and the authentication information, user encryption information and confirmation information are generated, and the user encryption information is encapsulated into data sharing request information. The data sharing request information is sent to the server, and the confirmation information is sent to the blockchain network, so that the server can share data with the client based on the data sharing request information and confirmation information. The technical solution provided by the present invention enables the server and client to obtain and verify information based on blockchain technology, and the user information and authentication information are stripped from the server and stored by the client, thereby improving the security of data sharing between the server and the client.

[0184] The present invention provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the data sharing method described above.

[0185] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.

[0186] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0189] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.

Claims

1. A data sharing method, characterized in that: Applied to a server, the method includes: Obtaining, from the blockchain network, transaction information generated by a client, where the transaction recipient is a first account address; the first account address is the blockchain account address of the server; Verifying the transaction information and, if the transaction information passes verification, using the transaction information to generate authentication information that the transaction sender is a second account address; the second account address is the blockchain account address of the client; Sending the authentication information to the blockchain network so that the client can obtain the authentication information through the blockchain network; Upon receiving data sharing request information sent by the client based on the authentication information, obtaining confirmation information generated by the client based on the authentication information from the blockchain network; Based on the confirmation information and the data sharing request information, data is shared with the client.

2. The method according to claim 1, characterized in that The verifying the transaction information includes: Obtaining, from the blockchain network, order information corresponding to the order identifier in the transaction information, and performing a validity check on the order information; If the order information is verified, obtain, from the preset smart contract, interface information that matches the interface hash value included in the target interface information in the transaction information; When the acquired interface information is consistent with the target interface information, it is determined that the transaction information verification has passed.

3. The method according to claim 1, characterized in that The step of using the transaction information to generate authentication information that the transaction sender is the second account address includes: Generate basic authentication information using the target interface information in the transaction information; generating data sharing restriction information using the billing mode in the transaction information and the basic authentication information; The data sharing restriction information and the preset random information are spliced ​​into information to be signed, and the information to be signed is signed using the blockchain account private key of the server to obtain signature identification information; Splicing the signature identification information and the information to be signed into unencrypted verification information; The unencrypted verification information is encrypted using the client's blockchain account public key in the transaction information to generate encrypted verification information, and the encrypted verification information and the server's blockchain account public key are encapsulated into the authentication information.

4. The method according to claim 1, wherein The step of sharing data with the client based on the confirmation information and the data sharing request information includes: Parsing the data sharing request information to obtain unencrypted verification information, a standard timestamp, an interface hash value, and the blockchain account address of the client; Parsing the unencrypted verification information to obtain signature identification information, and verifying the signature identification information using the server's blockchain account private key; Generate a keyword using the interface hash value and the client's blockchain account address; If the signature identification information is verified, query the keyword from the local memory, and if the keyword is found, obtain the cache timestamp corresponding to the keyword; In a case where the cache timestamp is smaller than the standard timestamp, the data sharing request information is responded to.

5. The method according to claim 4, characterized in that After querying the keyword from the local memory, the method further includes: If the keyword is not found, obtaining the maximum timestamp in the blockchain network according to the interface hash value; When the maximum timestamp is smaller than the standard timestamp, the data sharing request information is responded to, and the standard timestamp is cached in the blockchain network.

6. A data sharing method, characterized in that: Applied to a client, the method includes: Obtaining, from the blockchain network, authentication information generated by the server, indicating that the transaction sender is a second account address, where the second account address is the blockchain account address of the client; Verifying the authentication information and obtaining a current timestamp if the authentication information passes verification; Generate user encryption information and confirmation information based on the current timestamp and the authentication information, and encapsulate the user encryption information into data sharing request information; The data sharing request information is sent to the server, and the confirmation information is sent to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

7. The method according to claim 6, characterized in that The verifying the authentication information includes: Decrypting the encrypted verification information in the authentication information using the client's blockchain account private key to obtain unencrypted verification information, and parsing the unencrypted verification information to obtain signature identification information; Obtaining the server's blockchain account public key from the authentication information; The signature identification information is verified using the blockchain account public key of the server.

8. The method according to claim 6, characterized in that The generating user encryption information and confirmation information based on the current timestamp and the authentication information includes: Acquire transaction information corresponding to the authentication information, and acquire target interface information from the transaction information; Formatting the current timestamp to generate a standard timestamp, and generating user information using the standard timestamp, unencrypted verification information, the interface hash value included in the target interface information, and the blockchain account address of the client; Encrypt the user information using the server's blockchain account public key to generate user encrypted information; The interface hash value and the standard timestamp are encapsulated into the confirmation information.

9. The method according to claim 6, characterized in that Before obtaining authentication information generated by the server and indicating that the transaction sender is the second account address from the blockchain network, the method further includes: When the preset smart contract generated by the server is called and the order payment is completed according to the target interface information in the preset smart contract, an order identifier is obtained; Generate transaction information using the order identifier and the target interface information, with the transaction sender as the client's blockchain account address and the transaction receiver as the server's blockchain account address; The transaction information is sent to the blockchain network so that the server can obtain the transaction information through the blockchain network.

10. A server, characterized in that: The server includes: A first acquisition module is configured to acquire, from the blockchain network, transaction information generated by a client, where the transaction recipient is a first account address; the first account address is the blockchain account address of the server; a first processing module, configured to verify the transaction information and, if the transaction information passes verification, use the transaction information to generate authentication information that the transaction sender is a second account address; the second account address is the blockchain account address of the client; A first sending module, configured to send the authentication information to the blockchain network, so that the client can obtain the authentication information through the blockchain network; The first acquisition module is further configured to, upon receiving data sharing request information sent by the client based on the authentication information, obtain confirmation information generated by the client based on the authentication information from the blockchain network; The first processing module is further configured to share data with the client based on the confirmation information and the data sharing request information.

11. A client, characterized in that: The client includes: A second acquisition module is configured to obtain, from the blockchain network, authentication information generated by the server, in which the transaction sender is a second account address, where the second account address is the blockchain account address of the client; A second processing module is configured to verify the authentication information and obtain a current timestamp if the authentication information passes the verification; The second processing module is further configured to generate user encryption information and confirmation information based on the current timestamp and the authentication information, and encapsulate the user encryption information into data sharing request information; The second sending module is used to send the data sharing request information to the server and send the confirmation information to the blockchain network, so that the server can share data with the client based on the data sharing request information and the confirmation information.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data sharing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Identity authentication method based on block chain network, server and terminal device

    CN106372940A

  • Blockchain-based data sharing method, device and storage medium

    CN110493220A