TWI789652B - A method to prevent tampering and counterfeiting - Google Patents

A method to prevent tampering and counterfeiting Download PDF

Info

Publication number
TWI789652B
TWI789652B TW109142105A TW109142105A TWI789652B TW I789652 B TWI789652 B TW I789652B TW 109142105 A TW109142105 A TW 109142105A TW 109142105 A TW109142105 A TW 109142105A TW I789652 B TWI789652 B TW I789652B
Authority
TW
Taiwan
Prior art keywords
data
module
hash
checked
public chain
Prior art date
Application number
TW109142105A
Other languages
Chinese (zh)
Other versions
TW202223707A (en
Inventor
孫士勝
蔡明志
陳茂南
陳仁
廖婉君
Original Assignee
財團法人中華顧問工程司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 財團法人中華顧問工程司 filed Critical 財團法人中華顧問工程司
Priority to TW109142105A priority Critical patent/TWI789652B/en
Publication of TW202223707A publication Critical patent/TW202223707A/en
Application granted granted Critical
Publication of TWI789652B publication Critical patent/TWI789652B/en

Links

Images

Landscapes

  • Traffic Control Systems (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Bag Frames (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一種可防止竄改偽造之方法,係採取原始資料儲存於本地資料庫,可擁有原始資料之即時性與快速交易,而對該筆資料、或多筆資料進行雜湊函式(Hash function)計算(可為SHA-256或是其他的雜湊函式),透過此Hash機制取得該筆或多筆資料之特徵值(或元資料),而將此Hash特徵值或封裝上鏈至公鏈中,並將此公鏈儲存之Hash資料之主鍵(Prime Key)、連同Hash值同時儲存於在該資料庫中,以供後續的查詢稽核使用。如此不需要資料逐欄或逐筆上鏈,亦可取得資料一定程度之安全性並避免被竄改。 A method that can prevent tampering and forgery is to store the original data in the local database, which can have the real-time and fast transaction of the original data, and perform hash function (Hash function) calculation on the data or multiple data (can be SHA-256 or other hash function), through this Hash mechanism to obtain the feature value (or metadata) of the one or more pieces of data, and upload the Hash feature value or package to the public chain, and The primary key (Prime Key) of the Hash data stored in this public chain, together with the Hash value, is stored in the database at the same time for subsequent query and audit. In this way, there is no need for data to be chained column by column or transaction by transaction, and a certain degree of security of data can be obtained and tampered with.

Description

可防止竄改偽造之方法 A method to prevent tampering and counterfeiting

本發明係有關於一種可防止竄改偽造之方法,特別係指不需要資料逐欄或逐筆上鏈,亦可取得資料一定程度之安全性並避免被竄改者。 The present invention relates to a method that can prevent tampering and forgery, in particular, it refers to a method that can obtain a certain degree of security of data and avoid tampering without the need for data to be linked column by column or transaction by transaction.

區塊鏈為基於網際網路之加密共享分散式帳本技術(Distributed Ledger),其去中心化之特色與傳統主從式(client-server)之集中式網路架構不同,其具備可追蹤且不可竄改之安全性、並具備高度彈性使其應用多元化等諸多特性。區塊鏈作為提供信任之技術,在確保數據安全不被竄改、數據流可追蹤等方面有無可取代之優勢下,配合智能合約的應用,可以讓沒有互信基礎之多方參與者,藉由區塊鏈技術在同一平台上進行協作;目前各行各業也都積極探討並嘗試區塊鏈與本業結合的可能,期望利用區塊鏈技術來解決本業中難解之問題。 Blockchain is an encrypted shared distributed ledger technology (Distributed Ledger) based on the Internet. Its decentralized characteristics are different from the traditional client-server centralized network architecture. It has traceability and It has many characteristics such as unalterable security and high flexibility to diversify its application. As a trust-providing technology, blockchain has irreplaceable advantages in ensuring that data security is not tampered with and data flow can be traced. With the application of smart contracts, multiple participants without mutual trust can use the blockchain Blockchain technology collaborates on the same platform; At present, all walks of life are actively exploring and trying the possibility of combining blockchain with the industry, expecting to use blockchain technology to solve difficult problems in the industry.

區塊鏈公鏈雖具公開透明且具信任機制,且資料可追溯及不可篡改,但因資料之傳遞散佈之各分散之節點、且因工作量證明(Proof of Work,PoW)或權益證明(Proof of Stake,PoS)或等共識決演算法需取得多數之驗證,公鏈之驗證交易需耗費數分鐘之驗證交易時間,而公鏈之交易速度介於每秒數筆至數十筆交易量(Transaction Per Second,TPS);此外,公鏈上鏈成本亦成為資料上鏈不可忽視之成本,以區塊鏈公鏈以太坊為例,在以太坊上的任何操作都會被收取交易手續費用(GAS),如需應用在實務系統需再降低上鏈成本,資料難以逐筆逐欄全數上鏈,而採重要資料或另採取資料運算後(多筆資料做一次特徵值運算)再行上鏈。故,一般習用者係無法符合使用者於實際使用時之所需。 Although the blockchain public chain has an open, transparent and trustworthy mechanism, and the data can be traced and cannot be tampered with, but due to the scattered nodes of the data transmission, and due to the proof of work (Proof of Work, PoW) or proof of rights ( Proof of Stake, PoS) or other consensus decision algorithms need to be verified by the majority. The verification transaction of the public chain takes several minutes to verify the transaction time, and the transaction speed of the public chain ranges from a few to dozens of transactions per second. (Transaction Per Second, TPS); in addition, the cost of on-chaining the public chain has also become a non-negligible cost of data on-chain. Taking the blockchain public chain Ethereum as an example, any operation on Ethereum will be charged a transaction fee ( GAS), if it needs to be applied to the practical system, it is necessary to reduce the cost of on-chain. It is difficult to upload all the data one by one and column by column. However, it is necessary to collect important data or take another data calculation (multiple data for one eigenvalue calculation) before uploading to the chain. . Therefore, general users cannot meet the needs of users in actual use.

本發明之主要目的係在於,克服習知技藝所遭遇之上述問題並提供一種不需要資料逐欄或逐筆上鏈,亦可取得資料一定程度之安全性並避免被竄改之可防止竄改偽造之方法。 The main purpose of the present invention is to overcome the above-mentioned problems encountered in the prior art and provide a method that can prevent tampering and forgery without requiring data to be linked column by column or pen by pen, and can also obtain a certain degree of security of data and avoid tampering. method.

為達以上之目的,本發明係一種可防止竄改偽造之方法,應用於一區塊鏈平台並對該區塊鏈平台中一資料倉儲模組、一區塊鏈應用程式介面(Application Programming Interface,API)模組、一資料寫入上鏈模組、一資料查詢稽核模組、一智能合約編寫呈送模組以及一區塊鏈公鏈介接模組進行執行,該方法至少包含下列步驟:步驟一:透過該資料倉儲模組提供交通運輸資料之原始資料儲存;步驟二:透過該區塊鏈API模組提取該資料倉儲模組內至少一筆資料欄位中之交通運輸資料,以該資料寫入上鏈模組對該至少一筆交通運輸資料進行雜湊函式(Hash function)計算,取得該至少一筆交通運輸資料之Hash特徵值(Hash H1);步驟三:透過該智能合約編寫呈送模組產生一智能合約並提供至該資料寫入上鏈模組,該資料寫入上鏈模組對該Hash H1進行該智能合約之燃料(GAS)出價,並透過該區塊鏈公鏈介接模組介接一公鏈,將已執行該智能合約之Hash H1封裝上鏈至該公鏈中,並將此公鏈儲存之Hash H1之主鍵(Prime Key)、連同該Hash H1透過該區塊鏈API模組同時儲存在該資料倉儲模組中;以及步驟四:透過該資料查詢稽核模組從該公鏈下載一待查資料,並透過該區塊鏈API模組查詢該資料倉儲模組中該待查資料所指定該筆交通運輸資料之Hash H1,提取儲存在該資料倉儲模組中該待查資料,對該待查資料進行雜湊函式計算取得Hash H2,比對該Hash H1與該Hash H2以檢查該資料倉儲模組自寫入資料到資料被要求查詢稽核之時間中是否發生過資料被竄改或偽造之行為。 In order to achieve the above purpose, the present invention is a method for preventing tampering and forgery, which is applied to a block chain platform and includes a data storage module and a block chain application programming interface (Application Programming Interface, API) module, a data writing module on the chain, a data query auditing module, a smart contract writing and submitting module, and a block chain public chain interface module for execution, the method at least includes the following steps: Step 1: Provide raw data storage of transportation data through the data storage module; Step 2: Extract the transportation data in at least one data field in the data storage module through the blockchain API module, and write Enter the on-chain module to perform hash function (Hash function) calculation on the at least one piece of transportation data, and obtain the Hash feature value (Hash H 1 ) of the at least one piece of transportation data; Step 3: Write and submit the module through the smart contract Generate a smart contract and provide it until the data is written into the on-chain module, and the data is written into the on-chain module to bid for the fuel (GAS) of the smart contract on the Hash H 1 , and interface through the blockchain public chain The module is connected to a public chain, and the Hash H 1 that has executed the smart contract is packaged and uploaded to the public chain, and the primary key (Prime Key) of the Hash H 1 stored in the public chain, together with the Hash H 1 , is passed through The blockchain API module is stored in the data storage module at the same time; and step 4: download a data to be checked from the public chain through the data query audit module, and query the data through the blockchain API module Hash H 1 of the transportation data designated by the data to be checked in the warehouse module, extract the data to be checked and stored in the data warehouse module, perform hash function calculation on the data to be checked to obtain Hash H 2 , compare The Hash H 1 and the Hash H 2 are used to check whether the data has been falsified or forged from the time when the data storage module writes the data to the time when the data is required to be checked and audited.

於本發明上述實施例中,該雜湊函式為SHA 256加密演算法或與 Hash相關的雜湊函式。 In the above-mentioned embodiment of the present invention, the hash function is SHA 256 encryption algorithm or Hash-related hash functions.

於本發明上述實施例中,該步驟四之資料查詢稽核模組檢查出該Hash H1與該Hash H2相同時,代表該資料倉儲模組與該公鏈之資料吻合,該待查資料通過資料稽核;當該資料查詢稽核模組檢查出該Hash H1與該Hash H2不相同時,代表該資料倉儲模組中該待查資料遭受竄改。 In the above-mentioned embodiment of the present invention, when the data query and audit module in step 4 checks that the Hash H 1 is identical to the Hash H 2 , it means that the data storage module matches the data of the public chain, and the data to be checked is passed Data audit; when the data query and audit module detects that the Hash H 1 is different from the Hash H 2 , it means that the data to be checked in the data storage module has been tampered with.

於本發明上述實施例中,該步驟四之資料查詢稽核模組於該資料倉儲模組中查找不到該待查資料所指定該筆交通運輸資料之Hash H1時,代表該資料倉儲模組中該待查資料為後期偽造。 In the above-mentioned embodiment of the present invention, when the data query and audit module in step 4 cannot find the Hash H 1 of the transportation data specified by the data to be checked in the data storage module, it represents the data storage module The information to be investigated is later forged.

於本發明上述實施例中,該資料倉儲模組寫入新資料後,該新資料於該公鏈之上鏈動作可隨即自動進行、排程進行或批次進行。 In the above-mentioned embodiments of the present invention, after the data storage module writes new data, the new data can be uploaded to the public chain automatically, scheduled or in batches.

100:區塊鏈平台 100: Blockchain Platform

1:資料倉儲模組 1: Data storage module

2:區塊鏈應用程式介面模組 2: Blockchain API Module

3:資料寫入上鏈模組 3: Write data into the chain module

4:資料查詢稽核模組 4: Data query audit module

5:智能合約編寫呈送模組 5: Smart contract writing and submission module

6:區塊鏈公鏈介接模組 6: Blockchain public chain interface module

步驟一s1~步驟四s4 Step 1 s1~Step 4 s4

s11~s16:步驟 s11~s16: steps

s21~s29:步驟 s21~s29: steps

第1圖,係本發明之流程示意圖。 Fig. 1 is a schematic flow chart of the present invention.

第2圖,係本發明區塊鏈平台之架構示意圖。 Figure 2 is a schematic diagram of the architecture of the blockchain platform of the present invention.

第3圖,係本發明資料儲存及寫入上鏈之流程示意圖。 Figure 3 is a schematic diagram of the process of data storage and writing into the chain in the present invention.

第4圖,係本發明資料查詢稽核之流程示意圖。 Figure 4 is a schematic flow chart of the data query and audit of the present invention.

請參閱『第1圖~第4圖』所示,係分別為本發明之流程示意圖、本發明區塊鏈平台之架構示意圖、本發明資料儲存及寫入上鏈之流程示意圖、及本發明資料查詢稽核之流程示意圖。如圖所示:本發明係一種可防止竄改偽造之方法,可藉由一區塊鏈平台100進行操作,該區塊鏈平台包括一資料倉儲模組1、一區塊鏈應用程式介面(Application Programming Interface,API)模組 2、一資料寫入上鏈模組3、一資料查詢稽核模組4、一智能合約編寫呈送模組5以及一區塊鏈公鏈介接模組6所構成。 Please refer to "Fig. 1 ~ Fig. 4", which are respectively the schematic diagram of the process of the present invention, the schematic diagram of the structure of the blockchain platform of the present invention, the schematic diagram of the process of storing and writing the data of the present invention to the chain, and the data of the present invention Schematic diagram of the query audit process. As shown in the figure: the present invention is a method that can prevent tampering and forgery, and can be operated by a block chain platform 100. The block chain platform includes a data storage module 1, a block chain application programming interface (Application Programming Interface, API) module 2. It is composed of a data writing module 3, a data query and audit module 4, a smart contract writing and submitting module 5, and a blockchain public chain interface module 6.

上述所提之區塊鏈API模組2係分別連接該資料倉儲模組1、該資料寫入上鏈模組3及該資料查詢稽核模組4,而該智能合約編寫呈送模組5係分別連接該資料寫入上鏈模組3、該資料查詢稽核模組4及區塊鏈公鏈介接模組6。該區塊鏈平台100中該區塊鏈API模組2係採用業界標準之表徵性狀態傳輸應用程式介面(Representational State Transfer,Restful API)介接,將提供提取(GET)、新增(POST)以及刪除(DELETE)等資料處理機制,並在此介面增加權限控管功能,以提供其他系統、外部協作者或應用端進行介接存取使用。本發明所提可防止竄改偽造之方法搭配前述各模組之執行說明如下: The above-mentioned blockchain API module 2 is respectively connected to the data warehouse module 1, the data writing module 3 and the data query audit module 4, and the smart contract writing and submission module 5 is respectively Connect the data into the uplink module 3, the data query audit module 4 and the blockchain public chain interface module 6. The blockchain API module 2 in the blockchain platform 100 is interfaced with the industry-standard Representational State Transfer (Restful API), and will provide extract (GET), add (POST) And delete (DELETE) and other data processing mechanisms, and add permission control functions to this interface, so as to provide other systems, external collaborators or application terminals for interface access. The implementation of the method for preventing tampering and forgery proposed in the present invention with the aforementioned modules is described as follows:

步驟一s1:透過該資料倉儲模組1提供交通運輸資料之原始資料儲存。 Step 1 s1: Provide raw data storage of transportation data through the data storage module 1 .

步驟二s2:透過該區塊鏈API模組2提取該資料倉儲模組1內至少一筆資料欄位中之交通運輸資料,以該資料寫入上鏈模組3對該至少一筆交通運輸資料進行雜湊函式(Hash function)計算,取得該至少一筆交通運輸資料之Hash特徵值(Hash H1)。 Step 2 s2: Extract at least one piece of transportation data in the data storage module 1 through the blockchain API module 2, and use the data to write the at least one piece of transportation data into the uplink module 3 Hash function (Hash function) calculation to obtain the Hash feature value (Hash H 1 ) of the at least one transportation data.

步驟三s3:透過該智能合約編寫呈送模組5產生一智能合約並提供至該資料寫入上鏈模組3,該資料寫入上鏈模組3對該Hash H1進行該智能合約之交易手續費用(GAS)出價,並透過該區塊鏈公鏈介接模組6介接一公鏈7,將已執行該智能合約之Hash H1封裝上鏈至該公鏈7中,並將此公鏈7儲存之Hash H1之主鍵(Prime Key)、連同該Hash H1透過該區塊鏈API模組2同時儲存在該資料倉儲模組1中。 Step 3 s3: Generate a smart contract through the smart contract writing and submitting module 5 and provide the data to the on-chain module 3, and the data is written to the on-chain module 3 to perform the smart contract transaction on the Hash H 1 Handling fee (GAS) bid, and connect a public chain 7 through the blockchain public chain interface module 6, package the Hash H 1 that has executed the smart contract to the public chain 7, and send this The primary key (Prime Key) of the Hash H 1 stored in the public chain 7, together with the Hash H 1 , is simultaneously stored in the data storage module 1 through the blockchain API module 2.

步驟四s4:透過該資料查詢稽核模組4從該公鏈7下載一待查資料,並透過該區塊鏈API模組2查詢該資料倉儲模組1中該待查資料所指定該筆交通運輸資料之Hash H1,提取儲存在該資料倉儲模組1中該待查資料,對該待查資料進 行雜湊函式計算取得Hash H2,比對該Hash H1與該Hash H2以檢查該資料倉儲模組1自寫入資料到資料被要求查詢稽核之時間中是否發生過資料被竄改或偽造之行為。如是,藉由上述揭露之流程構成一全新之可防止竄改偽造之方法。 Step 4 s4: Use the data query audit module 4 to download a data to be checked from the public chain 7, and query the traffic specified in the data to be checked in the data storage module 1 through the blockchain API module 2 Hash H 1 of the transportation data, extract the data to be checked stored in the data storage module 1, perform hash function calculation on the data to be checked to obtain Hash H 2 , compare the Hash H 1 and the Hash H 2 to check Whether the data has been tampered with or falsified has occurred in the data storage module 1 from the time when the data is written to the time when the data is required to be checked and audited. If so, a brand-new method that can prevent tampering and forgery is formed by the flow process disclosed above.

當運用時,本發明所提區塊鏈平台100之資料寫入上鏈模組3及資料查詢稽核模組4為獨立之模組,智能合約編寫呈送模組5及區塊鏈公鏈介接模組6則提供上述獨立模組共用,本平台100並實作建置業界標準之RESTful API(區塊鏈API模組2)以供外部協作者或應用端存取使用。 When in use, the data writing module 3 of the block chain platform 100 proposed in the present invention and the data query and audit module 4 are independent modules, and the smart contract writing and presentation module 5 is connected to the public chain of the block chain Module 6 provides the sharing of the above-mentioned independent modules. The platform 100 also implements and builds an industry-standard RESTful API (blockchain API module 2) for external collaborators or application-side access.

該資料寫入上鏈模組3之資料儲存及寫入上鏈之流程如第3圖所示。首先如步驟s11,本平台100通過區塊鏈API模組2連接資料倉儲模組1,由該資料倉儲模組1提供交通運輸資料之原始資料儲存,當資料倉儲模組1寫入新資料後資料於以太坊公鏈之上鏈動作隨即自動進行(亦可視需求排程進行或批次進行);另區塊鏈本身無法對所儲存資料進行加密,因此在資料上鏈前先於本平台100進行加密處理,由於區塊鏈中資料上鏈費用(GAS費用)與資料實體大小直接相關,綜合考量安全性與使用成本,滿足Hash標準的SHA 256加密演算法是最佳的選擇。接著如步驟s12~s14,本平台100之設計將於資料儲存時即進行SHA 256 Hash運算並將其Hash H1值透過智能合約之GAS出價,於步驟s15、s16將此Hash H1值封裝上鏈至公鏈7,並將此公鏈7儲存之Hash H1之Prime Key、連同該Hash H1同時儲存在該資料倉儲模組1中,完成資料之上鏈。 The flow of data storage and writing of the data into the uplink module 3 is shown in FIG. 3 . First, as in step s11, the platform 100 connects to the data storage module 1 through the blockchain API module 2, and the data storage module 1 provides the original data storage of transportation data. When the data storage module 1 writes new data The chain action of data on the Ethereum public chain is automatically carried out immediately (it can also be scheduled or batched according to demand); in addition, the blockchain itself cannot encrypt the stored data, so it is 100 times before the data is uploaded to the chain. For encryption processing, since the data upload fee (GAS fee) in the blockchain is directly related to the size of the data entity, considering security and usage costs, the SHA 256 encryption algorithm that meets the Hash standard is the best choice. Then as steps s12~s14, the design of this platform 100 will perform SHA 256 Hash calculation immediately when the data is stored, and its Hash H 1 value will be bid through the GAS of the smart contract, and the Hash H 1 value will be packaged in steps s15 and s16 Link to the public chain 7, and store the Prime Key of the Hash H 1 stored in the public chain 7, together with the Hash H 1 , in the data storage module 1 at the same time to complete the data on-chain.

該資料查詢稽核模組4為區塊鏈技術之重要功能與應用,可確保數據之安全不被竄改,本平台100利用資料查詢稽核功能來檢查本地資料庫(即資料倉儲模組1)在從寫入資料到資料被要求查詢稽核的時間中是否發生過資料被竄改或偽造之行為。該資料查詢稽核之流程如第4圖所示。首先如步驟s21~s24,從以太坊公鏈下載待查資料於資料倉儲模組1中所指定該筆資料 Hash H1值。接著如步驟s25,提取儲存在資料倉儲模組1中之待查詢資料,對該筆資料進行Hash H2運算。然後如步驟s26,比對上述步驟的Hash H1與Hash H2值,如果該資料查詢稽核模組4檢查出該Hash H1與該Hash H2相同時,則如步驟s27,說明該資料倉儲模組1與該公鏈7之資料吻合,該待查資料通過資料稽核;若此兩筆Hash H1與該Hash H2不相同時,則如步驟s28說明該資料倉儲模組1中該待查資料遭受竄改;此外,於步驟s23若區塊鏈中查找不到該待查資料所指定該筆交通運輸資料之Hash H1時,則如步驟s29,說明該資料倉儲模組1中該筆待查資料為後期偽造。 The data query and audit module 4 is an important function and application of the block chain technology, which can ensure that the security of the data is not tampered with. Whether the data has been falsified or forged during the time when the data is written to the time when the data is required to be queried and audited. The process of data query and audit is shown in Figure 4. First, as in steps s21~s24, download the data to be checked from the Ethereum public chain and specify the Hash H 1 value of the data in the data warehouse module 1. Next, as in step s25, extract the data to be queried stored in the data storage module 1, and perform Hash H 2 calculation on the data. Then as in step s26, compare the Hash H 1 and Hash H 2 values of the above steps, if the data query audit module 4 checks out that the Hash H 1 is identical to the Hash H 2 , then as in step s27, illustrate that the data warehouse Module 1 matches the data of the public chain 7, and the data to be checked has passed the data audit; if the two Hash H 1 and the Hash H 2 are not the same, then as step s28 shows, the data to be checked in the data storage module 1 In addition, in step s23, if the Hash H 1 of the transportation data specified by the data to be checked cannot be found in the block chain, then as in step s29, the Hash H 1 of the transportation data in the data storage module 1 will be explained. The information to be investigated is forged later.

為使本區塊鏈平台供外部協作者存取使用,並可提供交通部之區塊鏈應用提供乘車資料之上鏈、查詢驗證稽核等重點項目介接,本發明實作建置應用程式界面(區塊鏈API模組),提高本區塊鏈平台之擴充性以及可重覆使用性,未來可供推展本區塊鏈平台至交通部所屬單位或各地方政府期望改善之運輸服務場域。 In order to make this blockchain platform available for external collaborators to access and use, and to provide the blockchain application of the Ministry of Communications to provide key projects such as on-chain travel information, query verification and auditing, etc., the present invention implements the construction of application programs The interface (blockchain API module) improves the scalability and reusability of the blockchain platform, and can be used to promote the blockchain platform to the transportation service fields that the Ministry of Communications units or local governments expect to improve in the future area.

於一具體實施例中,本發明區塊鏈平台可實作交通運輸區塊鏈Web操作平台,提供各參與方(例如:資源挹注方、車隊經營方、駕駛司機方、乘車民眾方、以及監理主管方等)於本平台進行交通運輸資料之上鏈、查詢、驗證、以及稽核相關旅次資料等功能,同時提供定期之旅次資料彙整下載,亦可選取特定區間之資料進行匯出下載,以提供相關之關聯方(如補助單位)進行核銷之用。 In a specific embodiment, the blockchain platform of the present invention can be implemented as a transportation blockchain web operation platform, providing various participants (for example: resource injectors, fleet operators, drivers, passengers, and public parties) Supervision and management parties, etc.) carry out functions such as uploading, querying, verifying, and auditing relevant travel data on this platform. At the same time, it provides regular trip data collection and download, and can also select specific interval data for export and download. , to provide relevant related parties (such as subsidy units) for write-off purposes.

藉此,本發明採取原始資料儲存於本地資料庫(即資料倉儲模組),可擁有原始資料之即時性與快速交易,而對該筆資料、或多筆資料進行Hash計算(可為SHA-256或是其他的雜湊函式),透過此Hash機制取得該筆或多筆資料之特徵值(或元資料),而將此Hash特徵值或封裝上鏈至公鏈中,並將此公鏈儲存之Hash資料之Prime Key、連同Hash值同時儲存於在該資料倉儲模組 中,以供後續的查詢稽核使用。如此不需要資料逐欄或逐筆上鏈,亦可取得資料一定程度之安全性並避免被竄改。 In this way, the present invention adopts the original data to be stored in the local database (that is, the data storage module), which can have the real-time and fast transaction of the original data, and perform Hash calculation on the data or multiple data (which can be SHA- 256 or other hash function), obtain the characteristic value (or metadata) of the data or data through this Hash mechanism, and upload the Hash characteristic value or package to the public chain, and the public chain The Prime Key of the stored Hash data, together with the Hash value, is stored in the data storage module at the same time for subsequent query audits. In this way, there is no need for data to be chained column by column or transaction by transaction, and a certain degree of security of data can be obtained and tampered with.

綜上所述,本發明係一種可防止竄改偽造之方法,可有效改善習用之種種缺點,採取原始資料儲存於本地資料庫,可擁有原始資料之即時性與快速交易,而對該筆資料或多筆資料進行Hash計算,透過此Hash機制取得該筆或多筆資料之特徵值,而將此Hash特徵值或封裝上鏈至公鏈中,並將此公鏈儲存之Hash資料之Prime Key、連同Hash值同時儲存於在該資料倉儲模組中,以供後續的查詢稽核使用;如此不需要資料逐欄或逐筆上鏈,亦可取得資料一定程度之安全性並避免被竄改,進而使本發明之產生能更進步、更實用、更符合使用者之所須,確已符合發明專利申請之要件,爰依法提出專利申請。 To sum up, the present invention is a method that can prevent tampering and counterfeiting, and can effectively improve the various shortcomings of conventional use. The original data is stored in the local database, and the real-time and fast transaction of the original data can be obtained. Perform Hash calculation on multiple pieces of data, obtain the feature value of the piece or multiple pieces of data through this Hash mechanism, and upload the Hash feature value or package to the public chain, and store the Prime Key, Prime Key and Together with the Hash value, it is stored in the data storage module at the same time for subsequent query and audit; in this way, it is not necessary to upload the data column by column or transaction by transaction, and can also obtain a certain degree of security of the data and prevent it from being tampered with. The production of the present invention can be more advanced, more practical, and more in line with the needs of users, and has indeed met the requirements for patent applications for inventions, so the patent application should be filed in accordance with the law.

惟以上所述者,僅為本發明之較佳實施例而已,當不能以此限定本發明實施之範圍;故,凡依本發明申請專利範圍及發明說明書內容所作之簡單的等效變化與修飾,皆應仍屬本發明專利涵蓋之範圍內。 But the above-mentioned ones are only preferred embodiments of the present invention, and should not limit the scope of the present invention; therefore, all simple equivalent changes and modifications made according to the patent scope of the present invention and the contents of the description of the invention , should still fall within the scope covered by the patent of the present invention.

步驟一s1~步驟四s4 Step 1 s1~Step 4 s4

Claims (5)

一種可防止竄改偽造之方法,應用於一區塊鏈平台並對該區塊鏈平台中一資料倉儲模組、一區塊鏈應用程式介面(Application Programming Interface,API)模組、一資料寫入上鏈模組、一資料查詢稽核模組、一智能合約編寫呈送模組以及一區塊鏈公鏈介接模組進行執行,該方法至少包含下列步驟:步驟一:透過該資料倉儲模組提供交通運輸資料之原始資料儲存;步驟二:透過該區塊鏈API模組提取該資料倉儲模組內至少一筆資料欄位中之交通運輸資料,以該資料寫入上鏈模組對該至少一筆交通運輸資料進行雜湊函式(Hash function)計算,取得該至少一筆交通運輸資料之Hash特徵值(Hash H1);步驟三:透過該智能合約編寫呈送模組產生一智能合約並提供至該資料寫入上鏈模組,該資料寫入上鏈模組對該Hash H1進行該智能合約之交易手續費用(GAS)出價,並透過該區塊鏈公鏈介接模組介接一公鏈,將已執行該智能合約之Hash H1封裝上鏈至該公鏈中,並將此公鏈儲存之Hash H1之主鍵(Prime Key)、連同該Hash H1透過該區塊鏈API模組同時儲存在該資料倉儲模組中;以及步驟四:透過該資料查詢稽核模組從該公鏈下載一待查資料,並透過該區塊鏈API模組查詢該資料倉儲模組中該待查資料所指定該筆交通運輸資料之Hash H1,提取儲存在該資料倉儲模組中該待查資料,對該待查資料進行雜湊函式計算取得Hash H2,比對該Hash H1與該Hash H2以檢查該資料倉儲模組自寫入資料到資料被要求查詢稽核之時間中是否發生過資料被竄改或偽造之行為。 A method capable of preventing tampering and forgery, applied to a block chain platform and writing a data storage module, a block chain application program interface (Application Programming Interface, API) module, and a data in the block chain platform Uplink module, a data query and audit module, a smart contract writing and submitting module, and a block chain public chain interface module for execution, the method at least includes the following steps: Step 1: Provide Raw data storage of transportation data; Step 2: Extract at least one data column of transportation data in the data storage module through the blockchain API module, and write the data into the uplink module for at least one data field Carry out hash function (Hash function) calculation on the transportation data to obtain the Hash feature value (Hash H 1 ) of the at least one piece of transportation data; Step 3: Generate a smart contract through the smart contract writing and submission module and provide it to the data Write the data into the uplink module, the data is written into the uplink module to bid for the transaction fee (GAS) of the smart contract on the Hash H 1 , and connect a public chain through the blockchain public chain interface module , encapsulate and upload the Hash H 1 that has executed the smart contract to the public chain, and pass the primary key (Prime Key) of the Hash H 1 stored in the public chain together with the Hash H 1 through the blockchain API module At the same time, it is stored in the data storage module; and step 4: download a data to be checked from the public chain through the data query audit module, and query the data to be checked in the data storage module through the blockchain API module Hash H 1 of the transportation data specified by the data, extract the data to be checked stored in the data storage module, perform hash function calculation on the data to be checked to obtain Hash H 2 , compare the Hash H 1 with the Hash H 2 is used to check whether the data has been falsified or forged from the time when the data is written in the data storage module to the time when the data is required to be checked and audited. 依申請專利範圍第1項所述之方法,其中,該雜湊函式為SHA 256加密演算法或與Hash相關的雜湊函式。 According to the method described in item 1 of the scope of the patent application, wherein the hash function is a SHA 256 encryption algorithm or a hash function related to Hash. 依申請專利範圍第1項所述之方法,其中,該步驟四之資料查 詢稽核模組檢查出該Hash H1與該Hash H2相同時,代表該資料倉儲模組與該公鏈之資料吻合,該待查資料通過資料稽核;當該資料查詢稽核模組檢查出該Hash H1與該Hash H2不相同時,代表該資料倉儲模組中該待查資料遭受竄改。 According to the method described in item 1 of the scope of the patent application, wherein, when the data query and audit module of the step 4 checks that the Hash H 1 is the same as the Hash H 2 , it means that the data storage module matches the data of the public chain , the data to be checked has passed the data audit; when the data query and audit module detects that the Hash H 1 is different from the Hash H 2 , it means that the data to be checked in the data warehouse module has been tampered with. 依申請專利範圍第1項所述之方法,其中,該步驟四之資料查詢稽核模組於該資料倉儲模組中查找不到該待查資料所指定該筆交通運輸資料之Hash H1時,代表該資料倉儲模組中該待查資料為後期偽造。 According to the method described in item 1 of the scope of the patent application, wherein, when the data query and audit module of the step 4 cannot find the Hash H 1 of the transportation data specified by the data to be checked in the data warehouse module, Indicates that the data to be checked in the data warehouse module is forged later. 依申請專利範圍第1項所述之方法,其中,該資料倉儲模組寫入新資料後,該新資料於該公鏈之上鏈動作可隨即自動進行、排程進行或批次進行。 According to the method described in item 1 of the scope of the patent application, wherein, after the data warehouse module writes new data, the new data can be linked to the public chain automatically, scheduled or batched.
TW109142105A 2020-11-30 2020-11-30 A method to prevent tampering and counterfeiting TWI789652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109142105A TWI789652B (en) 2020-11-30 2020-11-30 A method to prevent tampering and counterfeiting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109142105A TWI789652B (en) 2020-11-30 2020-11-30 A method to prevent tampering and counterfeiting

Publications (2)

Publication Number Publication Date
TW202223707A TW202223707A (en) 2022-06-16
TWI789652B true TWI789652B (en) 2023-01-11

Family

ID=83062343

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109142105A TWI789652B (en) 2020-11-30 2020-11-30 A method to prevent tampering and counterfeiting

Country Status (1)

Country Link
TW (1) TWI789652B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400734A (en) * 2020-03-16 2020-07-10 江苏荣泽信息科技股份有限公司 Intelligent logistics system based on block chain
CN111724111A (en) * 2020-06-18 2020-09-29 南京龙猫商业智能科技股份有限公司 Intelligent logistics distribution system based on block chain technology
CN111858750A (en) * 2020-06-17 2020-10-30 广东工业大学 Goods warehousing system and method based on intelligent contracts

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400734A (en) * 2020-03-16 2020-07-10 江苏荣泽信息科技股份有限公司 Intelligent logistics system based on block chain
CN111858750A (en) * 2020-06-17 2020-10-30 广东工业大学 Goods warehousing system and method based on intelligent contracts
CN111724111A (en) * 2020-06-18 2020-09-29 南京龙猫商业智能科技股份有限公司 Intelligent logistics distribution system based on block chain technology

Also Published As

Publication number Publication date
TW202223707A (en) 2022-06-16

Similar Documents

Publication Publication Date Title
US11693979B2 (en) Dynamic permission assignment and enforcement for transport process
US11538105B2 (en) Cryptographic-asset collateral management
CN114365133A (en) System or method for implementing forgotten rights on metadata driven blockchains with secret sharing and consensus on reads
US20210226800A1 (en) Preserving privacy of linked cross-network transactions
US20190147553A1 (en) Storing linked lists of mineral rights transactions in directed acyclic graphs of cryptographic hash pointers
AU2021210206B2 (en) Index structure for blockchain ledger
US11599858B2 (en) Blockchain settlement network
US20220329436A1 (en) Token-based identity validation via blockchain
US20220138181A1 (en) Schema-based pruning of blockchain data
CN115380303A (en) Trusted platform based on block chain
US20210406876A1 (en) Permissioned eventing in a decentralized database
Cui et al. Protecting vaccine safety: An improved, blockchain-based, storage-efficient scheme
CN112350863B (en) Decentralized access control method and system based on transaction
TWI789652B (en) A method to prevent tampering and counterfeiting
CN113302612A (en) Trusted platform based on block chain
US20210117919A1 (en) Last-mile deliver coordination
US11321298B1 (en) Automated merge of DLT networks
WO2023046409A1 (en) Digital asset platform with hsm verification
US11314729B2 (en) Multi-candidate data structure for transaction validation
TWI758981B (en) A method that can prevent tampering and forgery and combine the public chain and private chain of the blockchain
TWM610381U (en) Device capable of preventing tampering and forging
CN113491090A (en) Trusted platform based on block chain
TWM610380U (en) Device capable of preventing tampering and forging and combined with public and private chains of blockchain
TW202309762A (en) Method of using Merkle tree for combining blockchain public chain to prevent data tampering and forgery in which data can be uploaded to the chain in batches, and a plurality of data can be packaged and uploaded to the chain each time
US11973857B2 (en) Data archive