TWI769672B - Data sharing authorization method, blockchain system, sharing device, and query device - Google Patents
Data sharing authorization method, blockchain system, sharing device, and query device Download PDFInfo
- Publication number
- TWI769672B TWI769672B TW110102212A TW110102212A TWI769672B TW I769672 B TWI769672 B TW I769672B TW 110102212 A TW110102212 A TW 110102212A TW 110102212 A TW110102212 A TW 110102212A TW I769672 B TWI769672 B TW I769672B
- Authority
- TW
- Taiwan
- Prior art keywords
- authorization
- data
- query
- blockchain
- application
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/176—Support for shared access to files; File sharing support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6245—Protecting personal data, e.g. for financial or medical purposes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0816—Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
- H04L9/0819—Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
Abstract
Description
本發明涉及區塊鏈技術領域,尤其涉及一種資料共用授權方法、區塊鏈系統、共用裝置及查詢裝置。 The invention relates to the technical field of blockchain, and in particular, to a data sharing authorization method, a blockchain system, a sharing device and a query device.
區塊鏈是一種新型的去中心化協定,能夠安全地存儲數位貨幣交易或其他資料,區塊鏈的資訊不可偽造和篡改,其上的交易確認由區塊鏈上的所有節點共同完成,由共識演算法保證一致性。基於此,許多節點將隱私資料存儲在區塊鏈上,並藉由私密金鑰進行加密。然而,由於節點之間可以互相訪問資料,在私密金鑰洩露的情況下,查詢端仍然可以訪問節點上的隱私資料,從而降低了資料存儲的安全性。 The blockchain is a new type of decentralized agreement that can securely store digital currency transactions or other information. The information on the blockchain cannot be forged or tampered with. The transaction confirmation on it is completed by all nodes on the blockchain. Consensus algorithms guarantee consistency. Based on this, many nodes store private data on the blockchain and encrypt it with a private key. However, since nodes can access data from each other, in the case of leakage of the private key, the query terminal can still access the private data on the node, thus reducing the security of data storage.
有鑒於此,有必要提供一種資料共用授權方法、區塊鏈系統、共用裝置及查詢裝置,在資料共用時無需提供共用端的私密金鑰及公開金鑰。 In view of this, it is necessary to provide a data sharing authorization method, a block chain system, a sharing device and an inquiry device, which do not need to provide the private key and the public key of the sharing terminal during data sharing.
本發明的第一方面提供一種資料共用授權方法,包括:接收來自查詢裝置對共用資料的授權申請,根據所述授權申請對所述共用資料進行加密且生成授權資訊;接收來自所述查詢裝置對所述共用資料的查詢申請,根據所述授權資訊驗證所述查詢申請是否得到授權;當所述查詢申請得到授權時,分 享所述已加密的共用資料給所述查詢裝置;所述查詢裝置根據一解密規則對所述共用資料進行解密。 A first aspect of the present invention provides a data sharing authorization method, comprising: receiving an authorization application for shared data from a query device, encrypting the shared data and generating authorization information according to the authorization application; For the query application of the shared data, verify whether the query application is authorized according to the authorization information; when the query application is authorized, the sharing the encrypted shared data to the query device; the query device decrypts the shared data according to a decryption rule.
優選地,所述授權申請中包括所述查詢裝置提供的公開金鑰,接收來自所述查詢裝置的共用資料的授權申請後,利用所述公開金鑰對所述共用資料進行加密,所述查詢裝置接收所述加密的共用資料後利用所述公開金鑰對應的私密金鑰對所述共用資料進行解密。 Preferably, the authorization application includes a public key provided by the query device, and after receiving the authorization application for the shared data from the query device, the public key is used to encrypt the shared data, and the query After receiving the encrypted shared data, the device decrypts the shared data by using the private key corresponding to the public key.
優選地,所述授權申請還包括客戶名稱和請求共用資料的資料資訊,所述授權資訊至少包括授權單號、授權對象、請求共用資料的資料資訊、有效時間及查詢次數;所述查詢申請至少包括所述客戶名稱和所述授權單號。 Preferably, the authorization application further includes the client name and data information for requesting shared data, and the authorization information includes at least the authorization order number, the authorization object, the data information for requesting shared data, the valid time and the number of inquiries; the inquiry application at least Include the customer name and the authorization number.
優選地,所述接收來自所述查詢裝置的所述共用資料的查詢申請,根據所述授權資訊驗證所述查詢申請是否得到授權的步驟還包括:判斷所述查詢申請中的授權單號是否與所述授權資訊中的授權單號相同;判斷所述查詢申請中的客戶名稱是否與所述授權資訊中的授權對象相同;及當判定所述查詢申請中的授權單號所述授權資訊中的授權單號相同,且所述查詢申請中的客戶名稱與所述授權資訊中的授權對象相同時,確定所述查詢申請得到授權。 Preferably, the step of receiving an inquiry application for the shared data from the inquiry device, and verifying whether the inquiry application is authorized according to the authorization information further comprises: judging whether the authorization number in the inquiry application is the same as the authorization number in the inquiry application. The authorization order number in the authorization information is the same; it is judged whether the customer name in the inquiry application is the same as the authorization object in the authorization information; and when it is determined that the authorization order number in the inquiry application is the same in the authorization information When the authorization number is the same, and the customer name in the inquiry application is the same as the authorization object in the authorization information, it is determined that the inquiry application is authorized.
本發明的第二方面提供一種應用上述的資料共用授權方法的區塊鏈系統,至少一個查詢裝置接入該區塊鏈系統;所述區塊鏈系統用於接收所述查詢裝置發送的共用資料的授權申請,根據所述授權申請對所述共用資料進行加密且生成授權資訊;所述區塊鏈系統用於接收所述查詢裝置發送的共用資料的查詢申請,根據所述授權資訊驗證所述查詢申請是否得到授權,如果驗證得到授權則所述區塊鏈系統將所述已加密的共用資料分享給所述查詢裝置;所述查詢裝置根據一解密規則對所述共用資料進行解密。 The second aspect of the present invention provides a blockchain system applying the above-mentioned data sharing authorization method, at least one query device is connected to the blockchain system; the blockchain system is used for receiving the shared data sent by the query device. the authorization application, encrypt the shared data and generate authorization information according to the authorization application; the blockchain system is used to receive the inquiry application for the shared data sent by the inquiry device, and verify the authorization information according to the authorization information. Query whether the application is authorized, and if the verification is authorized, the blockchain system shares the encrypted shared data to the query device; the query device decrypts the shared data according to a decryption rule.
優選地,所述區塊鏈系統還包括第一區塊鏈、第二區塊鏈和至少一個共用裝置;所述共用裝置接收所述查詢裝置發送的共用資料的授權申請, 根據授權申請從所述第一區塊鏈上讀取所述共用資料並對所述共用資料進行加密且生成授權資訊,並將經過加密的所述共用資料及所述授權資訊寫入所述第二區塊鏈;所述第二區塊鏈接收所述查詢裝置的查詢申請,並根據所述授權資訊驗證所述查詢申請是否得到授權,如果驗證得到授權則所述第二區塊鏈將經過加密的所述共用資料分享給所述查詢裝置。 Preferably, the blockchain system further includes a first blockchain, a second blockchain and at least one common device; the common device receives an authorization application for common data sent by the query device, Read the shared data from the first blockchain according to the authorization application, encrypt the shared data, generate authorization information, and write the encrypted shared data and the authorization information into the first blockchain Two blockchains; the second blockchain receives the query application from the query device, and verifies whether the query application is authorized according to the authorization information, and if the verification is authorized, the second blockchain will go through The encrypted shared data is shared with the query device.
優選地,所述第一區塊鏈存儲所述共用裝置提供的共用資料,所述第二區塊鏈存儲所述共用資料對應的資料資訊,所述查詢裝置從所述第二區塊鏈獲取需查詢的資料資訊,並根據所述資料資訊將所述共用資料的授權申請發送給提供所述共用資料的所述共用裝置。 Preferably, the first blockchain stores the shared data provided by the shared device, the second blockchain stores the data information corresponding to the shared data, and the query device obtains from the second blockchain The data information to be queried, and according to the data information, an authorization application for the shared data is sent to the shared device that provides the shared data.
優選地,所述共用裝置藉由私密金鑰對共用資料進行加密並寫入所述第一區塊鏈,以及將所述共用資料對應的資料資訊寫入所述第二區塊鏈。 Preferably, the shared device encrypts the shared data with a private key and writes it into the first blockchain, and writes the data information corresponding to the shared data into the second blockchain.
優選地,所述資料資訊包括所述共用資料的資料類型、查詢參數或/及資料說明。 Preferably, the data information includes the data type, query parameters or/and data description of the shared data.
優選地,所述授權申請中包括所述查詢裝置提供的公開金鑰,所述共用裝置藉由所述公開金鑰對所述共用資料進行加密並生成授權資訊;所述查詢裝置接收到所述已加密的所述共用資料後用所述公開金鑰對應的私密金鑰進行解密。 Preferably, the authorization application includes a public key provided by the query device, and the shared device encrypts the shared data and generates authorization information by using the public key; the query device receives the The encrypted shared data is decrypted with the private key corresponding to the public key.
優選地,所述授權申請還包括客戶名稱和請求共用資料的資料資訊,所述授權資訊至少包括授權單號、授權對象、請求共用資料的資料資訊、有效時間及查詢次數;所述查詢申請至少包括所述客戶名稱和所述授權單號。 Preferably, the authorization application further includes the client name and data information for requesting shared data, and the authorization information includes at least the authorization order number, the authorization object, the data information for requesting shared data, the valid time and the number of inquiries; the inquiry application at least Include the customer name and the authorization number.
本發明的第三方面提供一種共用裝置,所述共用裝置包括:第一處理器;以及第一記憶體,所述第一記憶體中存儲有複數程式模組,所述複數程式模組由所述第一處理器載入並執行以下方法:接收來自查詢裝置對共用資料的授權申請,根據所述授權申請對所述共用資料進行加密且生成授權資訊; 將所述已加密的共用資料及所述授權資訊寫入區塊鏈系統,所述區塊鏈系統接收來自所述查詢裝置對所述共用資料的查詢申請,並根據所述查詢申請分享所述已加密的共用資料給所述查詢裝置。 A third aspect of the present invention provides a shared device, the shared device includes: a first processor; and a first memory, the first memory stores a plurality of program modules, the plurality of program modules are The first processor loads and executes the following method: receiving an authorization application for shared data from an inquiry device, encrypting the shared data and generating authorization information according to the authorization application; Write the encrypted shared data and the authorization information into a blockchain system, and the blockchain system receives a query application for the shared data from the query device, and shares the shared data according to the query application The encrypted shared data is given to the inquiry device.
本發明的第四方面提供一種查詢裝置,所述查詢裝置包括:第二處理器;以及第二記憶體,所述第二記憶體中存儲有複數程式模組,所述複數程式模組由所述第二處理器載入並執行以下方法:發送對共用資料的授權申請,所述共用資料根據所述授權申請進行加密且生成授權資訊,所述已加密的共用資料及所述授權資訊寫入區塊鏈系統;發送對所述共用資料的查詢申請,並根據所述查詢申請接收所述區塊鏈系統分享的所述已加密的共用資料;根據一解密規則對所述共用資料進行解密。 A fourth aspect of the present invention provides a query device, the query device includes: a second processor; and a second memory, where a plurality of program modules are stored in the second memory, and the plurality of program modules are The second processor loads and executes the following method: sending an authorization request for the shared data, the shared data is encrypted according to the authorization request and generates authorization information, the encrypted shared data and the authorization information are written A blockchain system; sending a query application for the shared data, and receiving the encrypted shared data shared by the blockchain system according to the query application; decrypting the shared data according to a decryption rule.
上述資料共用授權方法、區塊鏈系統、共用裝置及查詢裝置在進行資料共用時,無需提供共用端的私密金鑰及公開金鑰,即使共用端的私密金鑰洩露,查詢端也無法在未授權的情況下藉由共用端的私密金鑰訪問共用資料,有效保障了資料的存儲安全。 The above-mentioned data sharing authorization method, blockchain system, sharing device and query device do not need to provide the private key and public key of the shared end when sharing data. Even if the private key of the shared end is leaked, the query end cannot use unauthorized In this case, the shared data is accessed through the private key of the shared terminal, which effectively guarantees the storage security of the data.
1:共用裝置 1: Shared device
11:第一處理器 11: The first processor
12:第一記憶體 12: The first memory
13:第一電腦程式 13: The first computer program
2:查詢裝置 2: Query device
21:第二處理器 21: Second processor
22:第二記憶體 22: Second memory
23:第二電腦程式 23: Second computer program
3:區塊鏈系統 3: Blockchain system
301:第一區塊鏈 301: The First Blockchain
302:第二區塊鏈 302: Second Blockchain
S1~S7:步驟 S1~S7: Steps
圖1是本發明較佳實施方式提供的資料共用授權方法的應用環境架構示意圖。 FIG. 1 is a schematic diagram of an application environment architecture of a data sharing authorization method provided by a preferred embodiment of the present invention.
圖2是本發明實施例一提供的資料共用授權方法的流程圖。 FIG. 2 is a flowchart of a data sharing authorization method provided by Embodiment 1 of the present invention.
圖3是本發明實施例二提供的區塊鏈系統的結構示意圖。
FIG. 3 is a schematic structural diagram of a blockchain system provided by
圖4是本發明實施例三提供的共用裝置的結構示意圖。
FIG. 4 is a schematic structural diagram of a sharing device provided in
圖5是本發明實施例四提供的查詢裝置的結構示意圖。 FIG. 5 is a schematic structural diagram of a query apparatus according to Embodiment 4 of the present invention.
為了能夠更清楚地理解本發明的上述目的、特徵和優點,下面結合附圖和具體實施例對本發明進行詳細描述。需要說明的是,在不衝突的情況下,本申請的實施例及實施例中的特徵可以相互組合。 In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments may be combined with each other in the case of no conflict.
在下面的描述中闡述了很多具體細節以便於充分理解本發明,所描述的實施例僅僅是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本發明保護的範圍。 In the following description, many specific details are set forth in order to facilitate a full understanding of the present invention, and the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
除非另有定義,本文所使用的所有的技術和科學術語與屬於本發明的技術領域的技術人員通常理解的含義相同。本文中在本發明的說明書中所使用的術語只是為了描述具體的實施例的目的,不是旨在於限制本發明。 Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention.
請參閱圖1所示,為本發明較佳實施方式提供的資料共用授權方法的應用環境架構示意圖。 Please refer to FIG. 1 , which is a schematic diagram of an application environment architecture of a data sharing authorization method provided by a preferred embodiment of the present invention.
本發明中的資料共用授權方法應用在共用裝置1及查詢裝置2中,所述共用裝置1與所述查詢裝置2藉由網路互相連接。所述網路可以是有線網路,也可以是無線網路,例如無線電、無線保真(Wireless Fidelity,WIFI)、蜂窩等。
The data sharing authorization method of the present invention is applied to the
所述共用裝置1、查詢裝置2及其他設備形成區塊鏈系統3。所述共用裝置1及所述查詢裝置2均為所述區塊鏈系統3的節點。在本實施方式中,所述區塊鏈系統3包括至少一區塊鏈,用於存儲各個節點的共用資料及共用資料對應的資料資訊。
The shared
所述共用裝置1可以為安裝有資料共用授權程式的電子設備,例如個人電腦、伺服器等,其中,所述伺服器可以是單一的伺服器、伺服器集群或雲端伺服器等。所述共用裝置1用於共用資料。
The
所述查詢裝置2也可以為安裝有資料共用授權程式的電子設備,例如個人電腦、伺服器等,用於申請查詢所述共用裝置1的共用資料。
The inquiring
實施例一 Example 1
請參閱圖2所示,是本發明實施例一提供的資料共用授權方法的流程圖。根據不同的需求,所述流程圖中步驟的順序可以改變,某些步驟可以省略。 Please refer to FIG. 2 , which is a flowchart of a data sharing authorization method provided by Embodiment 1 of the present invention. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
S1,藉由第一私密金鑰對共用資料進行加密並寫入所述區塊鏈系統3。
S1, the shared data is encrypted by the first private key and written into the
在本實施方式中,所述共用資料為客戶訂單資訊。所述第一私密金鑰為所述共用裝置1設置的隨機數,為256位的二進位數字。S1具體包括:所述共用裝置1藉由所述第一私密金鑰採用加密演算法生成第一公開金鑰,並基於所述第一公開金鑰對所述共用資料進行加密,並將已加密的資料寫入所述區塊鏈系統3。
In this embodiment, the shared data is customer order information. The first private key is a random number set by the
S2,將所述共用資料對應的資料資訊寫入所述區塊鏈系統3。
S2, write the data information corresponding to the shared data into the
在本實施方式中,所述資料資訊至少包括所述共用資料的資料類型、查詢參數及/或資料說明。其中,所述查詢參數為所述共用資料支援的查詢參數,查詢者可以藉由所述查詢裝置2將查詢參數及對應的設置值發送給所述共用裝置1。需要說明的是,所述區塊鏈系統3上的資料資訊為公開信息,任何查詢裝置都可以訪問。
In this embodiment, the data information includes at least the data type, query parameters and/or data description of the shared data. Wherein, the query parameter is a query parameter supported by the shared data, and the queryer can send the query parameter and the corresponding setting value to the shared
在本實施方式中,如圖3所示,所述區塊鏈系統3包括第一區塊鏈301和第二區塊鏈302。所述第一區塊鏈301用於存儲所述共用裝置1提供的共用資料,所述第二區塊鏈302存儲所述共用資料對應的資料資訊。優選地,所述共用裝置1將已加密的共用資料寫入所述區塊鏈系統3的第一區塊鏈301,將所述共用資料對應的資料資訊寫入所述區塊鏈系統3的第二區塊鏈302。
In this embodiment, as shown in FIG. 3 , the
S3,接收來自查詢裝置2對共用資料的授權申請,根據所述授權申請對所述共用資料進行加密且生成授權資訊。
S3: Receive an authorization application for shared data from the
在本實施方式中,所述查詢裝置2從所述區塊鏈系統3,優選為從所述第二區塊鏈302獲取需查詢的資料資訊,並根據所述資料資訊發送對所述共用資料的授權申請。在本實施方式中,所述授權申請包括所述查詢裝置2的客戶名稱、請求共用資料的資料資訊及所述查詢裝置2的第二公開金鑰。例如,所述資料資訊中的資料類型為電池產品訂單,查詢參數為A12222222,所述第二公開金鑰由所述查詢裝置2藉由其第二私密金鑰採用SECP256K1(橢圓曲線演算法)演算法處理生成。
In this embodiment, the
在第一實施方式中,所述查詢裝置2將所述共用資料的授權申請發送至所述區塊鏈系統3。所述區塊鏈系統3,優選為所述第二區塊鏈302接收所述授權申請,根據所述授權申請中的資料資訊及所述共用裝置1的第一公開金鑰從所述第一區塊鏈301解密獲取對應的共用資料。
In the first embodiment, the
例如,當所述資料類型為電池產品訂單,所述查詢參數為A12222222時,所述第二區塊鏈302根據所述查詢參數的格式識別出所述查詢參數為訂單編號,從而從所述第一區塊鏈301獲取的共用資料為電池產品訂單中訂單編號為A12222222的訂單資料。
For example, when the data type is a battery product order and the query parameter is A12222222, the
進一步地,所述區塊鏈系統3根據所述查詢裝置2的第二公開金鑰對所述共用資料進行加密,並生成所述授權資訊。在本實施方式中,所述授權資訊至少包括授權單號、授權對象、有效時間及查詢次數。其中,所述授權資訊為所述共用裝置1與所述查詢裝置2之間的智慧合約。例如,所述授權資訊中的授權單號為B100000,授權對象為客戶B,有效時間為2020-8-1 00:00:00,查詢次數為5。
Further, the
進一步地,所述區塊鏈系統3寫入所述已加密的共用資料及所述授權資訊,並將所述授權資訊中的授權單號發送至所述查詢裝置2。優選地,所述區塊鏈系統3將所述已加密的共用資料及所述授權資訊寫入所述第二區塊鏈302。
Further, the
在第二實施方式中,所述查詢裝置2將所述共用資料的授權申請發送至所述共用裝置1。所述共用裝置1接收所述授權申請,根據所述授權申請中的資料資訊確定對應的共用資料。進一步地,所述共用裝置1根據所述查詢裝置2的公開金鑰對所述共用資料進行加密,並生成所述授權資訊。進一步地,所述共用裝置1將所述已加密的共用資料及所述授權資訊寫入所述區塊鏈系統3,優選為所述第二區塊鏈302,並將所述授權資訊中的授權單號發送至所述查詢裝置2。
In the second embodiment, the
在第三實施方式中,所述查詢裝置2將所述共用資料的授權申請發送至所述區塊鏈系統3。所述區塊鏈系統3,優選為所述第二區塊鏈302接收所述授權申請,將所述授權申請發送至所述共用裝置1進行確認。若所述共用裝置1授權所述查詢裝置2進行共用資料的查詢,發送一確認資訊至所述區塊鏈系統3。當所述區塊鏈系統3接收到所述共用裝置1發送的確認資訊時,根據所述授權申請中的資料資訊及所述共用裝置1的第一公開金鑰從所述第一區塊鏈301解密獲取對應的共用資料。進一步地,所述區塊鏈系統3根據所述查詢裝置2的第二公開金鑰對所述共用資料進行加密,並生成所述授權資訊。進一步地,所述區塊鏈系統3寫入所述已加密的共用資料及所述授權資訊,並將所述授權資訊中的授權單號發送至所述查詢裝置2。優選地,所述區塊鏈系統3將所述已加密的共用資料及所述授權資訊寫入所述第二區塊鏈302。
In the third embodiment, the
在其他實施方式中,所述授權資訊包括公開部分及隱私部分。所述隱私部分經過加密後被寫入所述第二區塊鏈302,所述公開部分被直接寫入所
述第二區塊鏈302,並設置為公開。在本實施方式中,所述公開部分至少包括授權單號。
In other embodiments, the authorization information includes a public part and a private part. The private part is encrypted and written into the
S4,接收來自所述查詢裝置2對所述共用資料的查詢申請,根據所述授權資訊驗證所述查詢申請是否得到授權。
S4: Receive an inquiry application for the shared data from the
在本實施方式中,所述查詢裝置2根據客戶名稱及所述授權單號生成所述查詢申請,並將生成的所述查詢申請發送至所述區塊鏈系統3,優選為所述第二區塊鏈302。
In this embodiment, the
所述區塊鏈系統3在接收到所述查詢申請時,根據所述授權資訊驗證所述查詢申請是否得到授權。具體的,藉由判斷所述查詢申請中的授權單號是否與所述授權資訊中的授權單號相同,並判斷所述查詢申請中的客戶名稱是否與所述授權資訊中的授權對象相同以判斷所述查詢申請是否得到授權。當判定所述查詢申請中的授權單號所述授權資訊中的授權單號相同,且所述查詢申請中的客戶名稱與所述授權資訊中的授權對象相同時,確定所述查詢申請得到授權,然後流程進入S5。當判定所述查詢申請中的授權單號所述授權資訊中的授權單號不同,及/或所述查詢申請中的客戶名稱與所述授權資訊中的授權對象不同時,確定所述查詢申請未得到授權,然後流程進入S7。
When receiving the query application, the
S5,分享所述已加密的共用資料給所述查詢裝置2。
S5 , share the encrypted shared data to the
在本實施方式中,當所述查詢申請得到授權時,所述區塊鏈系統3從所述第二區塊鏈302獲取與所述查詢申請中的授權單號和客戶名稱對應的已加密的資料,並將所述已加密的共用資料分享給所述查詢裝置2,即將所述已加密的共用資料發送給所述查詢裝置2。
In this embodiment, when the query application is authorized, the
S6,所述查詢裝置2根據一解密規則對所述共用資料進行解密。
S6, the
在本實施方式中,所述解密規則為所述查詢裝置2利用所述第二公開金鑰對應的第二私密金鑰對所述共用資料進行解密。即,所述查詢裝置2接
收所述加密的共用資料後,利用所述第二公開金鑰對應的第二私密金鑰對所述共用資料進行解密。
In this embodiment, the decryption rule is that the
S7,發送提示資訊至所述查詢裝置2以拒絕所述查詢申請。
S7, sending prompt information to the
本發明提供的資料共用授權方法在進行資料共用時,無需提供共用端的私密金鑰及公開金鑰,如此即使共用端的私密金鑰洩露,查詢端也無法在未授權的情況下藉由共用端的私密金鑰訪問共用資料,有效保障了資料的存儲安全。 The data sharing authorization method provided by the present invention does not need to provide the private key and public key of the shared end when performing data sharing, so even if the private key of the shared end is leaked, the query end cannot use the private key of the shared end without authorization. The key accesses shared data, which effectively guarantees the storage security of the data.
實施例二
請參閱圖3所示,為本發明實施例三提供的資料共用授權方法的應用環境架構示意圖。
Please refer to FIG. 3 , which is a schematic diagram of an application environment architecture of the data sharing authorization method provided by
所述區塊鏈系統3包括,但不僅限於,第一區塊鏈301、第二區塊鏈302、至少一個共用裝置1及至少一個查詢裝置2。
The
所述共用裝置1藉由第一私密金鑰對共用資料進行加密並寫入所述區塊鏈系統3。
The shared
在本實施方式中,所述共用資料為客戶訂單資訊。所述第一私密金鑰為所述共用裝置1設置的隨機數,為256位的二進位數字。S1具體包括:所述共用裝置1藉由所述第一私密金鑰採用加密演算法生成第一公開金鑰,並基於所述第一公開金鑰對所述共用資料進行加密,並將已加密的資料寫入所述區塊鏈系統3。
In this embodiment, the shared data is customer order information. The first private key is a random number set by the
所述共用裝置1還將所述共用資料對應的資料資訊寫入所述區塊鏈系統3。
The shared
在本實施方式中,所述資料資訊至少包括所述共用資料的資料類型、查詢參數及/或資料說明。其中,所述查詢參數為所述共用資料支援的查詢參數,查詢者可以藉由所述查詢裝置2將查詢參數及對應的設置值發送給所述共
用裝置1。需要說明的是,所述區塊鏈系統3上的資料資訊為公開信息,任何查詢裝置都可以訪問。
In this embodiment, the data information includes at least the data type, query parameters and/or data description of the shared data. Wherein, the query parameter is the query parameter supported by the shared data, and the queryer can send the query parameter and the corresponding setting value to the shared data through the
在本實施方式中,所述第一區塊鏈301用於存儲所述共用裝置1提供的共用資料,所述第二區塊鏈302存儲所述共用資料對應的資料資訊。優選地,所述共用裝置1將已加密的共用資料寫入所述區塊鏈系統3的第一區塊鏈301,將所述共用資料對應的資料資訊寫入所述區塊鏈系統3的第二區塊鏈302。
In this embodiment, the
所述區塊鏈系統3用於接收來自查詢裝置2對共用資料的授權申請,根據所述授權申請對所述共用資料進行加密且生成授權資訊。
The
在本實施方式中,所述查詢裝置2從所述區塊鏈系統3,優選為從所述第二區塊鏈302獲取需查詢的資料資訊,並根據所述資料資訊發送對所述共用資料的授權申請。在本實施方式中,所述授權申請包括所述查詢裝置2的客戶名稱、請求共用資料的資料資訊及所述查詢裝置2的第二公開金鑰。例如,所述資料資訊中的資料類型為電池產品訂單,查詢參數為A12222222,所述第二公開金鑰由所述查詢裝置2藉由其第二私密金鑰採用SECP256K1(橢圓曲線演算法)演算法處理生成。
In this embodiment, the
在第一實施方式中,所述查詢裝置2將所述共用資料的授權申請發送至所述區塊鏈系統3。所述區塊鏈系統3,優選為所述第二區塊鏈302接收所述授權申請,根據所述授權申請中的資料資訊及所述共用裝置1的第一公開金鑰從所述第一區塊鏈301解密獲取對應的共用資料。
In the first embodiment, the
例如,當所述資料類型為電池產品訂單,所述查詢參數為A12222222時,所述第二區塊鏈302根據所述查詢參數的格式識別出所述查詢參數為訂單編號,從而從所述第一區塊鏈301獲取的共用資料為電池產品訂單中訂單編號為A12222222的訂單資料。
For example, when the data type is a battery product order and the query parameter is A12222222, the
進一步地,所述區塊鏈系統3根據所述查詢裝置2的第二公開金鑰對所述共用資料進行加密,並生成所述授權資訊。在本實施方式中,所述授權資訊至少包括授權單號、授權對象、有效時間及查詢次數。其中,所述授權資訊為所述共用裝置1與所述查詢裝置2之間的智慧合約。例如,所述授權資訊中的授權單號為B100000,授權對象為客戶B,有效時間為2020-8-1 00:00:00,查詢次數為5。
Further, the
進一步地,所述區塊鏈系統3寫入所述已加密的共用資料及所述授權資訊,並將所述授權資訊中的授權單號發送至所述查詢裝置2。優選地,所述區塊鏈系統3將所述已加密的共用資料及所述授權資訊寫入所述第二區塊鏈302。
Further, the
在第二實施方式中,所述查詢裝置2將所述共用資料的授權申請發送至所述共用裝置1。所述共用裝置1接收所述授權申請,根據所述授權申請中的資料資訊確定對應的共用資料。進一步地,所述共用裝置1根據所述查詢裝置2的第二公開金鑰對所述共用資料進行加密,並生成所述授權資訊。進一步地,所述共用裝置1將所述已加密的共用資料及所述授權資訊寫入所述區塊鏈系統3,優選為所述第二區塊鏈302,並將所述授權資訊中的授權單號發送至所述查詢裝置2。
In the second embodiment, the
在第三實施方式中,所述查詢裝置2將所述共用資料的授權申請發送至所述區塊鏈系統3。所述區塊鏈系統3,優選為所述第二區塊鏈302接收所述授權申請,將所述授權申請發送至所述共用裝置1進行確認。若所述共用裝置1授權所述查詢裝置2進行共用資料的查詢,發送一確認資訊至所述區塊鏈系統3。當所述區塊鏈系統3接收到所述共用裝置1發送的確認資訊時,根據所述授權申請中的資料資訊及所述共用裝置1的第一公開金鑰從所述第一區塊鏈301解密獲取對應的共用資料。進一步地,所述區塊鏈系統3根據所述查詢裝置2的第二
公開金鑰對所述共用資料進行加密,並生成所述授權資訊。進一步地,所述區塊鏈系統3寫入所述已加密的共用資料及所述授權資訊,並將所述授權資訊中的授權單號發送至所述查詢裝置2。優選地,所述區塊鏈系統3將所述已加密的共用資料及所述授權資訊寫入所述第二區塊鏈302。
In the third embodiment, the
在其他實施方式中,所述授權資訊包括公開部分及隱私部分。所述隱私部分經過加密後被寫入所述第二區塊鏈302,所述公開部分被直接寫入所述第二區塊鏈302,並設置為公開。在本實施方式中,所述公開部分至少包括授權單號。
In other embodiments, the authorization information includes a public part and a private part. The private part is encrypted and written into the
所述區塊鏈系統3還用於接收來自所述查詢裝置2對所述共用資料的查詢申請,根據所述授權資訊驗證所述查詢申請是否得到授權。
The
在本實施方式中,所述查詢裝置2根據客戶名稱及所述授權單號生成所述查詢申請,並將生成的所述查詢申請發送至所述區塊鏈系統3,優選為所述第二區塊鏈302。
In this embodiment, the
所述區塊鏈系統3在接收到所述查詢申請時,根據所述授權資訊驗證所述查詢申請是否得到授權。具體的,藉由判斷所述查詢申請中的授權單號是否與所述授權資訊中的授權單號相同,並判斷所述查詢申請中的客戶名稱是否與所述授權資訊中的授權對象相同以判斷所述查詢申請是否得到授權。當判定所述查詢申請中的授權單號所述授權資訊中的授權單號相同,且所述查詢申請中的客戶名稱與所述授權資訊中的授權對象相同時,確定所述查詢申請得到授權。當判定所述查詢申請中的授權單號所述授權資訊中的授權單號不同,及/或所述查詢申請中的客戶名稱與所述授權資訊中的授權對象不同時,確定所述查詢申請未得到授權,並發送提示資訊至所述查詢裝置2以拒絕所述查詢申請。
When receiving the query application, the
所述區塊鏈系統3還用於當所述查詢申請得到授權時,分享所述已加密的共用資料給所述查詢裝置2。
The
在本實施方式中,當所述查詢申請得到授權時,所述區塊鏈系統3從所述第二區塊鏈302獲取與所述查詢申請中的授權單號和客戶名稱對應的已加密的資料,並將所述已加密的共用資料分享給所述查詢裝置2,即將所述已加密的共用資料發送給所述查詢裝置2。
In this embodiment, when the query application is authorized, the
所述查詢裝置2根據一解密規則對所述共用資料進行解密。
The
在本實施方式中,所述解密規則為所述查詢裝置2利用所述第二公開金鑰對應的第二私密金鑰對所述共用資料進行解密。即,所述查詢裝置2接收所述加密的共用資料後,利用所述第二公開金鑰對應的第二私密金鑰對所述共用資料進行解密。
In this embodiment, the decryption rule is that the
實施例三
請參閱圖4所示,為本發明實施例三提供的共用裝置的結構示意圖。
Please refer to FIG. 4 , which is a schematic structural diagram of a sharing device according to
所述共用裝置1包括,但不僅限於,第一處理器11、第一記憶體12以及存儲在所述第一記憶體12中並可在所述第一處理器11上運行的第一電腦程式13,例如資料共用授權程式。所述第一處理器11執行所述第一電腦程式13時實現資料共用授權方法中的部分步驟。
The shared
具體的,所述共用裝置1接入該區塊鏈系統3。所述第一處理器11執行所述第一電腦程式13時實現以下方法:接收來自查詢裝置2對共用資料的授權申請,根據所述授權申請對所述共用資料進行加密且生成授權資訊;將所述已加密的共用資料及所述授權資訊寫入區塊鏈系統3,所述區塊鏈系統3接收來自所述查詢裝置2對所述共用資料的查詢申請,並根據所述查詢申請分享所述已加密的共用資料給所述查詢裝置2。
Specifically, the shared
示例性的,所述第一電腦程式13可以被分割成一個或複數模組/單元,所述一個或者複數模組/單元被存儲在所述第一記憶體12中,並由所述第一處理器11執行。所述一個或複數模組/單元可以是能夠完成特定功能的一系列電腦程式指令段,所述指令段用於描述所述第一電腦程式13在所述共用裝置1中的執行過程。
Exemplarily, the
本領域技術人員可以理解,所述示意圖僅僅是共用裝置1的示例,並不構成對共用裝置1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述共用裝置1還可以包括輸入輸出設備、網路接入設備、匯流排等。
Those skilled in the art can understand that the schematic diagram is only an example of the shared
實施例四 Embodiment 4
請參閱圖5所示,為本發明實施例三提供的查詢裝置的結構示意圖。
Please refer to FIG. 5 , which is a schematic structural diagram of a query apparatus according to
所述查詢裝置2包括,但不僅限於,第二處理器21、第二記憶體22以及存儲在所述第二記憶體22中並可在所述第二處理器21上運行的第二電腦程式23,例如資料共用授權程式。所述第二處理器21執行所述第二電腦程式23時實現資料共用授權方法中的部分步驟。
The
具體的,所述查詢裝置2接入該區塊鏈系統3。所述第二處理器21執行所述第二電腦程式23時實現以下方法:發送對共用資料的授權申請至共用裝置1或區塊鏈系統3,所述共用裝置1或區塊鏈系統3根據所述授權申請對所述共用資料進行加密且生成授權資訊,所述已加密的共用資料及所述授權資訊寫入區塊鏈系統3;發送對所述共用資料的查詢申請,並根據所述查詢申請接收所述區塊鏈系統3分享的所述已加密的共用資料;根據一解密規則對所述共用資料進行解密。
Specifically, the
本領域技術人員可以理解,所述示意圖僅僅是查詢裝置2的示例,並不構成對查詢裝置2的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述查詢裝置2還可以包括輸入輸出設備、網路接入設備、匯流排等。
Those skilled in the art can understand that the schematic diagram is only an example of the
所稱第一處理器11及第二處理器21可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現成可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。通用處理器可以是微處理器或者任何常規的處理器等,所述第一處理器11是所述共用裝置1的控制中心,利用各種介面和線路連接整個共用裝置1的各個部分,所述第二處理器21是所述查詢裝置2的控制中心,利用各種介面和線路連接整個查詢裝置2的各個部分。
The so-called
所述第一記憶體12及第二記憶體22可用於存儲所述電腦程式和/或模組/單元,所述第一處理器11藉由運行或執行存儲在所述第一記憶體12內的電腦程式和/或模組/單元,以及調用存儲在第一記憶體12內的資料,實現所述共用裝置1的各種功能。所述第二處理器21藉由運行或執行存儲在所述第二記憶體22內的電腦程式和/或模組/單元,以及調用存儲在第二記憶體22內的資料,實現所述查詢裝置2的各種功能。所述第一記憶體12及第二記憶體22可主要包括存儲程式區和存儲資料區,其中,存儲程式區可存儲操作裝置、至少一個功能所需的應用程式(比如聲音播放功能、圖像播放功能等)等;存儲資料區可存儲根據共用裝置1或查詢裝置2的使用所創建的資料(比如音訊資料、電話本等)等。此外,所述第一記憶體12及第二記憶體22可以易失性記憶體,還可以包括非易失性記憶體,例如硬碟、記憶體、插接式硬碟,智慧存儲卡(Smart Media Card,
SMC),安全數位(Secure Digital,SD)卡,快閃記憶體卡(Flash Card)、至少一個磁碟記憶體件、快閃記憶體器件、或其他記憶體件。
The
本發明提供的資料共用授權方法、區塊鏈系統、共用裝置及查詢裝置在進行資料共用時,無需提供共用端的私密金鑰及公開金鑰,如此即使共用端的私密金鑰洩露,查詢端也無法在未授權的情況下藉由共用端的私密金鑰訪問共用資料,有效保障了資料的存儲安全。 The data sharing authorization method, blockchain system, sharing device and query device provided by the present invention do not need to provide the private key and public key of the shared end when sharing data, so even if the private key of the shared end is leaked, the query end cannot In the case of unauthorized access to the shared data through the private key of the shared terminal, the storage security of the data is effectively guaranteed.
對於本領域技術人員而言,顯然本發明不限於上述示範性實施例的細節,而且在不背離本發明的精神或基本特徵的情況下,能夠以其他的具體形式實現本發明。因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本發明的範圍由所附申請專利範圍而不是上述說明限定,因此旨在將落在申請專利範圍的等同要件的含義和範圍內的所有變化涵括在本發明內。不應將申請專利範圍中的任何附圖標記視為限制所涉及的申請專利範圍。此外,顯然“包括”一詞不排除其他單元或步驟,單數不排除複數。裝置申請專利範圍中陳述的複數單元或裝置也可以由同一個單元或裝置藉由軟體或者硬體來實現。第一,第二等詞語用來表示名稱,而並不表示任何特定的順序。 It will be apparent to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, but that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as exemplary and not restrictive, and the scope of the present invention is defined by the appended claims rather than the foregoing description, and is therefore intended to fall within the scope of the application. All changes within the meaning and scope of equivalents to the scope of the patent are included in the present invention. Any reference signs in the patentable scope should not be construed as limiting the claimed scope. Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Plural units or devices stated in the scope of the device application can also be realized by software or hardware by the same unit or device. The terms first, second, etc. are used to denote names and do not denote any particular order.
綜上所述,本發明符合發明專利要件,爰依法提出專利申請。惟,以上所述者僅為本發明之較佳實施方式,舉凡熟悉本案技藝之人士,於爰依本發明精神所作之等效修飾或變化,皆應涵蓋於以下之申請專利範圍內。 To sum up, the present invention complies with the requirements of an invention patent, and a patent application can be filed in accordance with the law. However, the above descriptions are only the preferred embodiments of the present invention, and for those who are familiar with the art of the present invention, equivalent modifications or changes made in accordance with the spirit of the present invention should all be covered within the scope of the following patent application.
S1~S7:步驟 S1~S7: Steps
Claims (11)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011308750.7A CN114519041A (en) | 2020-11-20 | 2020-11-20 | Data sharing authorization method, block chain system, sharing device and query device |
CN202011308750.7 | 2020-11-20 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202221541A TW202221541A (en) | 2022-06-01 |
TWI769672B true TWI769672B (en) | 2022-07-01 |
Family
ID=81594259
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW110102212A TWI769672B (en) | 2020-11-20 | 2021-01-20 | Data sharing authorization method, blockchain system, sharing device, and query device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114519041A (en) |
TW (1) | TWI769672B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW202021309A (en) * | 2018-11-27 | 2020-06-01 | 香港商阿里巴巴集團服務有限公司 | Data storage and attestation method and system based on multiple blockchain networks |
TW202026909A (en) * | 2018-11-23 | 2020-07-16 | 香港商阿里巴巴集團服務有限公司 | Blockchain certificate storage method and apparatus, and computer device |
TW202036441A (en) * | 2018-11-27 | 2020-10-01 | 香港商阿里巴巴集團服務有限公司 | Data reading method based on a plurality of block chain networks and system |
-
2020
- 2020-11-20 CN CN202011308750.7A patent/CN114519041A/en active Pending
-
2021
- 2021-01-20 TW TW110102212A patent/TWI769672B/en active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW202026909A (en) * | 2018-11-23 | 2020-07-16 | 香港商阿里巴巴集團服務有限公司 | Blockchain certificate storage method and apparatus, and computer device |
TW202021309A (en) * | 2018-11-27 | 2020-06-01 | 香港商阿里巴巴集團服務有限公司 | Data storage and attestation method and system based on multiple blockchain networks |
TW202036441A (en) * | 2018-11-27 | 2020-10-01 | 香港商阿里巴巴集團服務有限公司 | Data reading method based on a plurality of block chain networks and system |
Also Published As
Publication number | Publication date |
---|---|
TW202221541A (en) | 2022-06-01 |
CN114519041A (en) | 2022-05-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI713353B (en) | Communication method between blockchain nodes, digital certificate management method, device and electronic equipment | |
US11115418B2 (en) | Registration and authorization method device and system | |
WO2019214068A1 (en) | Method and apparatus for verifying users on blockchain system, terminal device, and storage medium | |
WO2020057002A1 (en) | Invoice data sharing system and method based on blockchain | |
US11790119B2 (en) | Application integrity attestation | |
CN111986764A (en) | Block chain-based medical data sharing method and device, terminal and storage medium | |
WO2020228365A1 (en) | Reconciliation method and device employing consortium chain, and electronic apparatus | |
CN113169866A (en) | Techniques to prevent collusion using simultaneous key distribution | |
WO2019214069A1 (en) | Method and apparatus for encrypted user communication on blockchain, and terminal device and storage medium | |
WO2022134812A1 (en) | Consortium blockchain-based multi-institution data processing method, apparatus, and related device | |
CN111683082A (en) | Data sharing method and system based on block chain and electronic equipment | |
WO2021169767A1 (en) | Data processing method and apparatus, device and medium | |
WO2021057124A1 (en) | Fpga-based privacy block chain implementing method and device | |
WO2021109718A1 (en) | Verification method and apparatus based on block chain system | |
WO2021036511A1 (en) | Method for data encryption, storage and reading, terminal device, and storage medium | |
WO2022057545A1 (en) | File transfer method and apparatus, electronic device and computer-readable medium | |
TWI769672B (en) | Data sharing authorization method, blockchain system, sharing device, and query device | |
US20230028854A1 (en) | System and method of cryptographic key management in a plurality of blockchain based computer networks | |
CN117157623A (en) | System and method for protecting secrets when used in conjunction with containerized applications | |
CN114223176B (en) | Certificate management method and device | |
CN112907245A (en) | Key management method and device in block chain, electronic equipment and storage medium | |
WO2020119477A1 (en) | Identity authentication method employing blockchain, and terminal apparatus | |
TWI765538B (en) | Data query method, blockchain system, sharing device, and query device | |
KR102476081B1 (en) | Method for performing mutual authentication in communication using locator id separation protocol, apparatus and system for performing the same | |
CN114944949B (en) | Data authorization method, system, device and storage medium based on block chain |