TWI717909B - Data verification method - Google Patents

Data verification method Download PDF

Info

Publication number
TWI717909B
TWI717909B TW108142193A TW108142193A TWI717909B TW I717909 B TWI717909 B TW I717909B TW 108142193 A TW108142193 A TW 108142193A TW 108142193 A TW108142193 A TW 108142193A TW I717909 B TWI717909 B TW I717909B
Authority
TW
Taiwan
Prior art keywords
record data
verified
verification
data
verification value
Prior art date
Application number
TW108142193A
Other languages
Chinese (zh)
Other versions
TW202121212A (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 TW108142193A priority Critical patent/TWI717909B/en
Application granted granted Critical
Publication of TWI717909B publication Critical patent/TWI717909B/en
Publication of TW202121212A publication Critical patent/TW202121212A/en

Links

Images

Abstract

A data verification method, which is applied to a server, comprises the following steps: generating a first verification value according to a plurality of first record data included in the plurality of record data groups and received during a period of time, and recording a historical data, wherein each of the record data groups has the first record data having different properties, and the historical data has the properties of the first record data; generating an unverified first verification value according to a plurality of unverified first record data included in the plurality of unverified record data groups and the historical data corresponding to the period of time; and comparing the first verification value with the unverified first verification value. If the first verification value is different from the unverified first verification value, it is determined that the record data groups are different from the unverified record data groups.

Description

資料驗證方法Data verification method

本發明是有關一種資料驗證方法,尤其是有關於一種應用於伺服器的資料驗證方法。The invention relates to a data verification method, in particular to a data verification method applied to a server.

將各種紀錄資料(例如電子設備的操作、檔案的存取、外部網路的存取等紀錄)上傳至伺服器是企業以及公司等常用的方法,並且通常設置有一套機制或方法用於驗證這些紀錄資料,其目的在於日後發生問題時可調閱這些紀錄資料以調查問題發生的原因或是釐清責任歸屬。Uploading various record data (such as the operation of electronic equipment, file access, external network access, etc.) to the server is a common method for enterprises and companies, and there is usually a set of mechanisms or methods to verify these The purpose of recording data is to read these records when problems occur in the future to investigate the cause of the problem or to clarify the attribution of responsibility.

為使這些紀錄資料作為證據時具有法律效力,現有的技術中所使用的資料驗證方法不允許對這些紀錄資料有任何修改,因此在管理的方面不具有彈性。In order to make these recorded data have legal effect when used as evidence, the data verification method used in the existing technology does not allow any modification of these recorded data, so it is not flexible in management.

本發明提供一種資料驗證方法,應用於一伺服器,在維持紀錄資料作為證據時具有法律效力的同時,也提供管理紀錄資料的彈性。The present invention provides a data verification method, which is applied to a server, which not only has legal effect when maintaining record data as evidence, but also provides flexibility in managing record data.

本發明所提供的資料驗證方法包括下列步驟:步驟S101:根據一段時間內伺服器接收到的多個紀錄資料組包括的多個第一紀錄資料產生第一驗證值,並記錄歷史資料,其中每一紀錄資料組包括屬性不同的第一紀錄資料,歷史資料包括第一紀錄資料的屬性;步驟S103:根據所儲存的對應該段時間的多個待驗證紀錄資料組包括的多個待驗證第一紀錄資料及歷史資料,產生待驗證第一驗證值;以及步驟S105:比對第一驗證值與待驗證第一驗證值,若第一驗證值與待驗證第一驗證值不同,則判斷紀錄資料組與待驗證紀錄資料組不同。The data verification method provided by the present invention includes the following steps: Step S101: Generate a first verification value based on a plurality of first record data included in a plurality of record data groups received by a server within a period of time, and record historical data, where each A record data group includes first record data with different attributes, and the historical data includes the attributes of the first record data; Step S103: According to the stored multiple record data groups to be verified corresponding to a period of time, multiple first record data groups to be verified include Record data and historical data to generate a first verification value to be verified; and step S105: compare the first verification value with the first verification value to be verified, and if the first verification value is different from the first verification value to be verified, determine the record data The group is different from the record data group to be verified.

在本發明的一實施例中,上述步驟S103中,該段時間的待驗證紀錄資料組的屬性的數量,多於歷史資料中該段時間所記錄的屬性的數量,根據對應歷史資料中該段時間所記錄的屬性的待驗證第一紀錄資料產生待驗證第一驗證值。In an embodiment of the present invention, in the above step S103, the number of attributes of the record data group to be verified in the period of time is more than the number of attributes recorded in the period of time in the historical data. The first record data to be verified of the attribute recorded by time generates the first verification value to be verified.

在本發明的一實施例中,上述步驟S101中,包括對每一紀錄資料組的第一紀錄資料進行一雜湊演算法,歷史資料更包括第一紀錄資料進行雜湊演算法時,第一紀錄資料對應的屬性的順序。In an embodiment of the present invention, the above step S101 includes performing a hash algorithm on the first record data of each record data group, and the historical data further includes the first record data when the hash algorithm is performed on the first record data. The order of the corresponding attributes.

在本發明的一實施例中,上述步驟S101包括:步驟S1011:對每一紀錄資料組的第一紀錄資料進行第一演算法而產生多個第二驗證值;以及步驟S1013:對第二驗證值進行第二演算法而產生第一驗證值;以及步驟S103包括:步驟S1031:根據歷史資料,對每一待驗證紀錄資料組的待驗證第一紀錄資料進行第一演算法而產生多個待驗證第二驗證值;以及步驟S1033:對待驗證第二驗證值進行第二演算法而產生待驗證第一驗證值。In an embodiment of the present invention, the above step S101 includes: step S1011: performing a first algorithm on the first record data of each record data group to generate a plurality of second verification values; and step S1013: verifying the second The second algorithm is used to generate the first verification value; and step S103 includes: Step S1031: According to historical data, perform the first algorithm on the first record data to be verified in each record data group to be verified to generate a plurality of waiting records. Verify the second verification value; and step S1033: Perform a second algorithm on the second verification value to be verified to generate the first verification value to be verified.

在本發明的一實施例中,上述第一演算法及第二演算法包括雜湊演算法。In an embodiment of the present invention, the above-mentioned first algorithm and second algorithm include a hash algorithm.

在本發明的一實施例中,上述步驟S1011包括:當伺服器接收各紀錄資料時,賦予各紀錄資料順序碼,其中各紀錄資料的順序碼互不相同; 步驟S1013包括:根據順序碼排序第二驗證值後,對排序後的第二驗證值進行第二演算法的雜湊演算法,而產生第一驗證值;以及步驟S1033包括:根據順序碼排序待驗證第二驗證值後,對排序後的待驗證第二驗證值進行第二演算法的雜湊演算法而產生待驗證第一驗證值。In an embodiment of the present invention, the above step S1011 includes: when the server receives each record data, assigning a sequence code to each record data, wherein the sequence code of each record data is different from each other; Step S1013 includes: sorting the record data according to the sequence code. After the second verification value, the hash algorithm of the second algorithm is performed on the sorted second verification value to generate the first verification value; and step S1033 includes: after sorting the second verification value to be verified according to the sequence code, sorting The second verification value to be verified performs the hash algorithm of the second algorithm to generate the first verification value to be verified.

在本發明的一實施例中,上述之資料驗證方法更包括:步驟S107:比對第二驗證值與待驗證第二驗證值,若第二驗證值的其中一個與對應的待驗證第二驗證值不同,則判斷對應的紀錄資料組與對應的待驗證紀錄資料組不同。In an embodiment of the present invention, the above-mentioned data verification method further includes: Step S107: Compare the second verification value with the second verification value to be verified, if one of the second verification values corresponds to the second verification to be verified If the value is different, it is determined that the corresponding record data group is different from the corresponding record data group to be verified.

在本發明的一實施例中,上述步驟S1011包括:透過儲存單元封存第二驗證值。In an embodiment of the present invention, the above step S1011 includes: sealing the second verification value through the storage unit.

在本發明的一實施例中,上述步驟S1011包括:透過區塊鍊、公信單位、電子郵件或電子布告欄公開第二驗證值,其中區塊鍊包括公鍊及/或私鍊。In an embodiment of the present invention, the above step S1011 includes: publishing the second verification value through a blockchain, a public trust unit, an email or an electronic bulletin board, where the blockchain includes a public chain and/or a private chain.

在本發明的一實施例中,上述步驟S101包括:透過儲存單元封存第一驗證值及/或歷史資料。In an embodiment of the present invention, the above step S101 includes: storing the first verification value and/or historical data through the storage unit.

在本發明的一實施例中,上述步驟S101包括:透過區塊鍊、公信單位、電子郵件或電子布告欄公開第一驗證值,其中區塊鍊包括公鍊及/或私鍊。In an embodiment of the present invention, the above-mentioned step S101 includes: publishing the first verification value through a blockchain, a public trust unit, an email or an electronic bulletin board, where the blockchain includes a public chain and/or a private chain.

在本發明的一實施例中,上述紀錄資料組更包括至少一第二紀錄資料,步驟S101中產生第一驗證值時不使用第二紀錄資料。In an embodiment of the present invention, the record data set further includes at least one second record data, and the second record data is not used when generating the first verification value in step S101.

因為本發明採用歷史資料記錄第一紀錄資料的屬性,可以根據歷史資料記錄的屬性找出對應的待驗證第一紀錄資料,再根據對應的待驗證第一紀錄資料產生待驗證第一驗證值,所以當待驗證紀錄資料組的屬性因管理需要而有所增加時,仍能判斷紀錄資料組與待驗證紀錄資料組是否不同,從而提供了管理紀錄資料的彈性。Because the present invention uses historical data to record the attributes of the first record data, the corresponding first record data to be verified can be found based on the attributes of the historical data record, and then the first verification value to be verified is generated based on the corresponding first record data to be verified. Therefore, when the attributes of the record data group to be verified are increased due to management needs, it can still be judged whether the record data group is different from the record data group to be verified, thereby providing flexibility in managing record data.

為讓本發明之上述和其他目的、特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式,作詳細說明如下。In order to make the above and other objects, features and advantages of the present invention more comprehensible, the following specific examples are given in conjunction with the accompanying drawings to describe in detail as follows.

圖1為本發明一實施例的系統架構示意圖。在本實施例中,伺服器100例如是透過區域網路或廣域網路電性連接終端裝置200並接收來自終端裝置200的多個紀錄資料組R,伺服器100也可自己產生並儲存紀錄資料組R,其中終端裝置200例如是電腦等電子裝置,終端裝置200的數量並不以圖1為限,紀錄資料組R例如是有關伺服器100或終端裝置200上的操作內容。伺服器100可安裝有資料庫軟體用於管理接收到的紀錄資料組R,資料庫軟體例如是MySQL、SQL Server、Oracle資料庫等。伺服器100包括儲存單元101用以儲存紀錄資料組R,儲存單元101例如是傳統硬碟(Hard Disk Drive, HDD)或固態硬碟(Solid-State Drive, SSD)等。FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention. In this embodiment, the server 100 is, for example, electrically connected to the terminal device 200 via a local area network or a wide area network and receives multiple record data sets R from the terminal device 200. The server 100 can also generate and store the record data set by itself. R, where the terminal device 200 is an electronic device such as a computer, and the number of the terminal device 200 is not limited to FIG. 1. The record data group R is, for example, related to the operation content of the server 100 or the terminal device 200. The server 100 may be installed with database software for managing the received record data group R, such as MySQL, SQL Server, Oracle database, etc. The server 100 includes a storage unit 101 for storing a record data group R. The storage unit 101 is, for example, a traditional hard disk drive (HDD) or a solid-state drive (SSD).

圖2為本發明一實施例的一段時間內所接收的紀錄資料組R的示意圖。本實施例中,伺服器100接收來自終端裝置200的多個紀錄資料組R,該段時間內所接收的紀錄資料組R包括紀錄資料組R_0~R_3,伺服器100的資料庫軟體以表格的方式管理紀錄資料組R,每一紀錄資料組R包括屬性不同的第一紀錄資料D1以及第二紀錄資料D2,其中每一紀錄資料組R對應表格的一個列(Row),一個屬性對應表格的一個欄(Column),每一紀錄資料組R的第一紀錄資料D1以及第二紀錄資料D2個別填入同一列中對應其屬性的欄。舉例而言,該段時間例如是一天或是一小時,在該段時間內接收的紀錄資料組R_0中,第一紀錄資料D1_00~D1_03的屬性C_0~C_3分別例如是存入資料庫時間、順序碼、使用者、拷貝檔名,第二紀錄資料D2_04的屬性C_4例如是備註。本發明並不限制第一紀錄資料D1以及第二紀錄資料D2的數量以及屬性。FIG. 2 is a schematic diagram of the record data group R received in a period of time according to an embodiment of the present invention. In this embodiment, the server 100 receives multiple record data sets R from the terminal device 200. The record data sets R received during this period include record data sets R_0 to R_3. The database software of the server 100 is in the form of Mode management record data group R, each record data group R includes the first record data D1 and the second record data D2 with different attributes, wherein each record data group R corresponds to a row of the table, and one attribute corresponds to the table In a column, the first record data D1 and the second record data D2 of each record data group R are individually filled in the columns corresponding to their attributes in the same row. For example, the period of time is, for example, one day or one hour. In the record data group R_0 received during this period, the attributes C_0 to C_3 of the first record data D1_00 to D1_03 are, for example, the time and sequence of storage in the database, respectively Code, user, copy file name, and attribute C_4 of the second record data D2_04 are remarks, for example. The present invention does not limit the quantity and attributes of the first record data D1 and the second record data D2.

圖3為本發明一實施例的資料驗證方法的示意圖。本實施例的資料驗證方法包括步驟S101~S107,以下將對各個步驟做進一步說明。FIG. 3 is a schematic diagram of a data verification method according to an embodiment of the invention. The data verification method of this embodiment includes steps S101 to S107, and each step will be further described below.

在本發明一實施例中,步驟S101:根據一段時間內伺服器100接收到的多個紀錄資料組R包括的多個第一紀錄資料D1產生第一驗證值V1,並記錄歷史資料H,其中每一紀錄資料組R包括屬性不同的第一紀錄資料D1,歷史資料H包括第一紀錄資料D1的屬性。In an embodiment of the present invention, step S101: generate a first verification value V1 based on a plurality of first record data D1 included in a plurality of record data sets R received by the server 100 within a period of time, and record historical data H, where Each record data group R includes first record data D1 with different attributes, and the historical data H includes attributes of the first record data D1.

圖4為本發明一實施例的資料驗證方法的步驟S101示意圖。本實施例中,步驟S101包括步驟S1011以及步驟S1013。FIG. 4 is a schematic diagram of step S101 of a data verification method according to an embodiment of the present invention. In this embodiment, step S101 includes step S1011 and step S1013.

其中,步驟S1011:當伺服器100接收各紀錄資料組R時,賦予各紀錄資料組R一個順序碼(步驟S1011a),以紀錄資料組R_0為例,紀錄資料組R_0的順序碼即為第一紀錄資料D1_01,其中各紀錄資料組R的順序碼互不相同,在另一實施例中,順序碼也可以是記錄為第二紀錄資料D2。接著,對該段時間內接收的每一紀錄資料組R的第一紀錄資料D1進行第一演算法而產生第二驗證值V2(步驟S1011b),其中,一個紀錄資料組R對應一個第二驗證值V2,第一演算法例如為雜湊演算法。以紀錄資料組R0為例,對第一紀錄資料(D1_00,D1_01,D1_02,D1_03)進行雜湊演算法而產生第二驗證值V2_0。然後,透過儲存單元101封存第二驗證值V2,及/或透過區塊鍊(包括公鍊及/或私鍊)、公信單位、電子郵件或電子布告欄公開第二驗證值V2(步驟S1011c),使第二驗證值V2具有不可竄改的特性。在另一實施例中,可不包括步驟S1011c。Wherein, step S1011: When the server 100 receives each record data group R, it assigns each record data group R a sequence code (step S1011a). Taking record data group R_0 as an example, the sequence code of record data group R_0 is the first In the record data D1_01, the sequence codes of the record data groups R are different from each other. In another embodiment, the sequence code may also be recorded as the second record data D2. Next, perform the first algorithm on the first record data D1 of each record data group R received during the period of time to generate a second verification value V2 (step S1011b), wherein one record data group R corresponds to a second verification Value V2, the first algorithm is, for example, a hash algorithm. Taking the record data set R0 as an example, a hash algorithm is performed on the first record data (D1_00, D1_01, D1_02, D1_03) to generate the second verification value V2_0. Then, the second verification value V2 is sealed through the storage unit 101, and/or the second verification value V2 is disclosed through the blockchain (including public chain and/or private chain), public trust unit, email or electronic bulletin board (step S1011c) , So that the second verification value V2 can not be tampered with. In another embodiment, step S1011c may not be included.

以及,步驟S1013:根據順序碼排序第二驗證值後(步驟S1013a),在該段時間結束後對排序後的第二驗證值V2進行第二演算法而產生第一驗證值V1(步驟S1013b),第二演算法例如為雜湊演算法。以圖2的表格為例,對根據順序碼D1_01、D1_11、D1_21、D1_31排序後的第二驗證值(V2_0,V2_1,V2_2,V2_3)進行第二演算法產生第一驗證值V1。接著透過儲存單元101封存第一驗證值V1及/或歷史資料H,及/或透過區塊鍊(包括公鍊及/或私鍊)、公信單位、電子郵件或電子布告欄公開第一驗證值V1(步驟S1013c),使第一驗證值V1具有不可竄改的特性。其中歷史資料H例如為資料庫軟體可讀寫的一文字紀錄檔,可包括第一紀錄資料D1的屬性以及進行第一演算法時第一紀錄資料D1對應的屬性的順序,本實施例中歷史資料H例如是記錄:C_0, C_1, C_2, C_3。在另一實施例中,歷史資料H可更包括第一驗證值V1及/或第二驗證值V2並且公開歷史資料H。And, step S1013: after the second verification values are sorted according to the sequence code (step S1013a), after this period of time, a second algorithm is performed on the sorted second verification value V2 to generate the first verification value V1 (step S1013b) , The second algorithm is, for example, a hash algorithm. Taking the table in FIG. 2 as an example, the second verification value (V2_0, V2_1, V2_2, V2_3) sorted according to the sequence codes D1_01, D1_11, D1_21, D1_31 is subjected to the second algorithm to generate the first verification value V1. Then the first verification value V1 and/or historical data H is sealed through the storage unit 101, and/or the first verification value is disclosed through the blockchain (including public chain and/or private chain), public trust unit, email or electronic bulletin board V1 (step S1013c), so that the first verification value V1 has a non-tamperable characteristic. The historical data H is, for example, a text record file readable and writable by database software, which may include the attributes of the first record data D1 and the sequence of the attributes corresponding to the first record data D1 when the first algorithm is performed. In this embodiment, the historical data H is for example records: C_0, C_1, C_2, C_3. In another embodiment, the historical data H may further include the first verification value V1 and/or the second verification value V2 and the historical data H may be disclosed.

第一演算法以及第二演算法的雜湊演算法例如是安全雜湊演算法(Secure Hash Algorithm, SHA)或雜湊訊息確認碼(Hash Message Authentication Code, HMAC)等,第一演算法以及第二演算法可以使用相同或不同的演算法。對於本發明所屬技術領域中具有通常知識者而言,應能具體實施上述演算法,因此其細節於此不再贅述。由於輸入雜湊演算法的資料只要有一點不同,產生的雜湊驗證值就會有很大的差異,因此驗證時必須保證輸入雜湊演算法的資料與原始資料完全相同才能產生相同的雜湊驗證值。The hash algorithms of the first algorithm and the second algorithm are, for example, Secure Hash Algorithm (SHA) or Hash Message Authentication Code (HMAC), etc. The first algorithm and the second algorithm The same or different algorithms can be used. For those with ordinary knowledge in the technical field to which the present invention belongs, they should be able to implement the above algorithm in detail, so the details are not repeated here. As long as the data input to the hash algorithm is different, the generated hash verification value will be very different. Therefore, it is necessary to ensure that the input hash algorithm data is exactly the same as the original data to generate the same hash verification value.

在本發明一實施例中,步驟S103:根據所儲存的對應該段時間的多個待驗證紀錄資料組R’包括的多個待驗證第一紀錄資料D1’及歷史資料H,產生待驗證第一驗證值V1。In an embodiment of the present invention, step S103: generate the first record data to be verified D1' and the historical data H included in the plurality of record data groups R'to be verified corresponding to a period of time stored A verification value V1.

圖5為本發明一實施例的資料驗證方法的步驟S103示意圖。本實施例中,步驟S103包括步驟S1031以及步驟S1033。FIG. 5 is a schematic diagram of step S103 of a data verification method according to an embodiment of the present invention. In this embodiment, step S103 includes step S1031 and step S1033.

其中,步驟S1031:根據所儲存的對應該段時間的多個待驗證紀錄資料組R’包括的多個待驗證第一紀錄資料D1’以及上述歷史資料H,選取並對應歷史資料H中記錄的屬性的順序排序待驗證第一紀錄資料D1’(步驟S1031a),接著,對選取並排序的待驗證第一紀錄資料D1’進行第一演算法產生待驗證第二驗證值V2’(步驟S1031b),然後判斷是否完成對每一待驗證紀錄資料組R’進行演算(步驟S1031c),如果判斷為否,則回到步驟S1031a。Wherein, step S1031: According to the multiple first record data to be verified D1' included in the multiple record data groups R'to be verified and the aforementioned historical data H stored corresponding to the period of time, select and correspond to the records in the historical data H The attributes are sorted in the order of the first record data to be verified D1' (step S1031a), and then the first algorithm is performed on the selected and sorted first record data D1' to be verified to generate the second verification value V2' to be verified (step S1031b) , And then determine whether the calculation for each record data group R'to be verified is completed (step S1031c), if the determination is no, then return to step S1031a.

其中,待驗證紀錄資料組R’ 例如是該段時間所接收的紀錄資料組R經過另一段時間後處於待驗證是否被修改過的狀態。請參考圖6,圖6為圖1所示的實施例中待驗證的紀錄資料組R’的示意圖。圖6與圖2的差異在於,圖6於表格中增加了屬性C_5(電腦),例如是新接收到的紀錄資料組R更包括了屬性C_5(電腦)的第一紀錄資料D1,也就是說,待驗證紀錄資料組R’的屬性的數量,多於歷史資料H中該段時間所記錄的屬性的數量。Among them, the record data group R'to be verified is, for example, the record data group R received in this period of time in a state to be verified whether it has been modified after another period of time. Please refer to FIG. 6, which is a schematic diagram of the record data group R'to be verified in the embodiment shown in FIG. The difference between Figure 6 and Figure 2 is that Figure 6 adds the attribute C_5 (computer) to the table. For example, the newly received record data group R also includes the first record data D1 of the attribute C_5 (computer), which means , The number of attributes of the record data group R'to be verified is more than the number of attributes recorded in the historical data H during the period.

具體而言,以本實施例中的待驗證紀錄資料組R_0’為例,根據歷史資料H中該段時間的屬性以及屬性的順序(C_0,C_1,C_2,C_3),選取並對應屬性的順序排序待驗證第一紀錄資料(D1_00’,D1_01’,D1_02’,D1_03’),其中並不包括待驗證第一紀錄資料D1_05’~D1_35’,接著,對選取並排序的待驗證第一紀錄資料(D1_00’,D1_01’,D1_02’,D1_03’)進行第一演算法而產生待驗證第二驗證值V2_0’,然後對待驗證紀錄資料組R_1’~R_3’重複上述步驟,以此類推直到完成產生待驗證第二驗證值V2_0’~ V2_3’。Specifically, taking the record data group R_0' to be verified in this embodiment as an example, according to the attributes of the period of time in the historical data H and the order of the attributes (C_0, C_1, C_2, C_3), select and correspond to the order of the attributes Sort the first record data to be verified (D1_00', D1_01', D1_02', D1_03'), which does not include the first record data to be verified D1_05'~D1_35', and then select and sort the first record data to be verified (D1_00', D1_01', D1_02', D1_03') Perform the first algorithm to generate the second verification value V2_0' to be verified, and then repeat the above steps for the verification record data set R_1'~R_3', and so on until the generation is completed The second verification value V2_0'~V2_3' to be verified.

接著,步驟S1033:根據順序碼排序待驗證第二驗證值V2’後(步驟S1033a),對排序後的待驗證第二驗證值V2’進行第二演算法的雜湊演算法而產生待驗證第一驗證值V1’(步驟S1033b)。由於各紀錄資料組R的順序碼互不相同,即使紀錄資料組R的存入資料庫時間相同,也能透過順序碼排序。以圖6的表格為例,對根據順序碼D1_01’、D1_11’、D1_21’、D1_31’排序後的待驗證第二驗證值(V2_0’,V2_1’,V2_2’,V2_3’)進行第二演算法產生待驗證第一驗證值V1’。Next, step S1033: After sorting the second verification value V2' to be verified according to the sequence code (step S1033a), perform the hash algorithm of the second algorithm on the sorted second verification value V2' to generate the first verification value V2' to be verified The verification value V1' (step S1033b). Since the sequence codes of each record data group R are different from each other, even if the record data group R is stored in the database at the same time, it can be sorted by the sequence code. Take the table in Figure 6 as an example, perform the second algorithm on the second verification values to be verified (V2_0', V2_1', V2_2', V2_3') sorted according to the sequence codes D1_01', D1_11', D1_21', D1_31' A first verification value V1' to be verified is generated.

在本發明一實施例中,步驟S105:比對第一驗證值V1與待驗證第一驗證值V1’,若第一驗證值V1與待驗證第一驗證值V1’不同,則判斷紀錄資料組R與待驗證紀錄資料組R’不同。In an embodiment of the present invention, step S105: compare the first verification value V1 with the first verification value V1' to be verified, and if the first verification value V1 is different from the first verification value V1' to be verified, determine the record data group R is different from the record data group R'to be verified.

在本發明一實施例中,步驟S107:比對第二驗證值V2與待驗證第二驗證值V2’,若第二驗證值V2的其中一個與對應的待驗證第二驗證值V2’不同,則判斷對應的紀錄資料組R與對應的待驗證紀錄資料組R’不同。例如當第二驗證值V2_3與待驗證第二驗證值V2_3’不同,則判斷紀錄資料組R_3與對應的待驗證紀錄資料組R_3’不同,也就是說,紀錄資料組R_3中的第一紀錄資料D1_30、D1_31、D1_32、D1_33中至少其中之一被修改過。步驟S107可用於進一步判斷多個紀錄資料組R中哪一個被修改過。在另一實施例中,本發明的資料驗證方法可不包括步驟S107,例如是當只需要判斷該段時間是否有任何紀錄資料組R被修改過,或是當在步驟S105中若判斷出紀錄資料組R與待驗證紀錄資料組R’相同時不進行步驟S107。In an embodiment of the present invention, step S107: compare the second verification value V2 with the second verification value V2' to be verified, and if one of the second verification values V2 is different from the corresponding second verification value V2' to be verified, It is determined that the corresponding record data group R is different from the corresponding record data group R'to be verified. For example, when the second verification value V2_3 is different from the second verification value V2_3' to be verified, it is determined that the record data set R_3 is different from the corresponding record data set R_3' to be verified, that is, the first record data in the record data set R_3 At least one of D1_30, D1_31, D1_32, and D1_33 has been modified. Step S107 can be used to further determine which of the multiple record data sets R has been modified. In another embodiment, the data verification method of the present invention may not include step S107, for example, when it is only necessary to determine whether any record data group R has been modified during this period, or when it is determined in step S105 that the record data When the group R is the same as the record data group R'to be verified, step S107 is not performed.

在本發明一實施例中,步驟S101中產生第一驗證值V1時不使用第二紀錄資料D2,例如圖2中的第二紀錄資料D2_04~D2_34;以及步驟S103中產生待驗證第一驗證值V1’時不使用第二紀錄資料D2’,例如圖6中的第二紀錄資料D2_04’~D2_34’,其中,第二紀錄資料D2’例如是經過另一段時間後的第二紀錄資料D2,因此即使改變第二紀錄資料D2的值,經過另一段時間後的第二紀錄資料D2’也不影響驗證紀錄資料組R’中的第一驗證紀錄資料D1’以及待驗證第一驗證值V1’。如圖2所示,第二紀錄資料D2_04~D2_34的屬性C_4例如是備註,可用於方便管理紀錄資料組R。透過第二紀錄資料D2的設置,可根據需求增加不進行演算的欄位,允許資料儲存後還能修改或寫入新資料,能方便人員進行管理。In an embodiment of the present invention, the second record data D2 is not used when the first verification value V1 is generated in step S101, such as the second record data D2_04 to D2_34 in FIG. 2; and the first verification value to be verified is generated in step S103 V1' does not use the second record data D2', such as the second record data D2_04'~D2_34' in Figure 6, where the second record data D2' is, for example, the second record data D2 after another period of time. Even if the value of the second record data D2 is changed, the second record data D2' after another period of time does not affect the first verification record data D1' in the verification record data group R'and the first verification value V1' to be verified. As shown in FIG. 2, the attribute C_4 of the second record data D2_04 to D2_34 is, for example, a note, which can be used to facilitate the management of the record data group R. Through the setting of the second record data D2, you can add fields that do not perform calculations according to your needs, allowing you to modify or write new data after data storage, which is convenient for personnel to manage.

在另一實施例中,該段時間內所接收的紀錄資料組R可不包括第二紀錄資料D2,而例如是在另一段時間之後新接收到的紀錄資料組R增加第二紀錄資料D2。In another embodiment, the record data set R received during the period may not include the second record data D2, but for example, the record data set R newly received after another period of time adds the second record data D2.

在另一實施例中,當使用多張表格儲存紀錄資料組R時,可對不同表格分別記錄歷史資料H,例如包括每一表格的名稱以及每一表格對應的屬性。In another embodiment, when multiple tables are used to store the record data group R, the historical data H can be recorded separately for different tables, for example, including the name of each table and the attribute corresponding to each table.

本發明採用歷史資料記錄第一紀錄資料的屬性,可以根據歷史資料記錄的屬性找出對應的待驗證第一紀錄資料,再根據對應的待驗證第一紀錄資料產生待驗證第一驗證值,所以當待驗證紀錄資料組的屬性因管理需要而有所增加時(例如新接收的紀錄資料組包括之前不具有的屬性),仍能保證資料輸入演算法的方式是正確的,進而判斷紀錄資料組與待驗證紀錄資料組是否不同,從而提供了管理紀錄資料的彈性。The present invention uses historical data to record the attributes of the first record data, can find the corresponding first record data to be verified according to the attributes of the historical data record, and then generate the first verification value to be verified based on the corresponding first record data to be verified. When the attributes of the record data group to be verified are increased due to management needs (for example, the newly received record data group includes attributes that did not exist before), it can still ensure that the data input algorithm is correct, and then determine the record data group Whether it is different from the record data group to be verified, which provides flexibility in managing record data.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field to which the present invention pertains can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to those defined by the attached patent application scope.

100:伺服器 101:儲存單元 200:終端裝置 R、R_0~R_3:紀錄資料組 C_0~C_5:屬性 D1、D1_00~D1_33:第一紀錄資料 D2、D2’、D2_04~D2_34、D2_04’~D2_34’:第二紀錄資料 V2、V2_0~V2_3:第二驗證值 V1:第一驗證值 H:歷史資料 R’、R_0’~R_3’:待驗證紀錄資料組 D1’、D1_00’~D1_35’: 待驗證第一紀錄資料 V2’、V2_0’~V2_3’: 待驗證第二驗證值 V1’: 待驗證第一驗證值 S101、S103、S105、S107、S1011、S1013、S1031、S1033、S1011a、S1011b、S1011c、S1013a、S1013b、S1013c、S1031a、S1031b、S1031c、S1033a、S1033b:步驟100: server 101: storage unit 200: terminal device R, R_0~R_3: record data group C_0~C_5: attributes D1, D1_00~D1_33: the first record data D2, D2’, D2_04~D2_34, D2_04’~D2_34’: the second record data V2, V2_0~V2_3: second verification value V1: first verification value H: Historical data R’, R_0’~R_3’: data group of records to be verified D1’, D1_00’~D1_35’: First record data to be verified V2’, V2_0’~V2_3’: the second verification value to be verified V1’: The first verification value to be verified S101, S103, S105, S107, S1011, S1013, S1031, S1033, S1011a, S1011b, S1011c, S1013a, S1013b, S1013c, S1031a, S1031b, S1031c, S1033a, S1033b: steps

圖1為本發明一實施例的系統架構示意圖。 圖2為本發明一實施例的一段時間內所接收的紀錄資料組的示意圖。 圖3為本發明一實施例的資料驗證方法的示意圖。 圖4為本發明一實施例的資料驗證方法的步驟S101示意圖。 圖5為本發明一實施例的資料驗證方法的步驟S103示意圖。 圖6為本發明一實施例的待驗證的紀錄資料組的示意圖。 FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention. FIG. 2 is a schematic diagram of a record data group received during a period of time according to an embodiment of the present invention. FIG. 3 is a schematic diagram of a data verification method according to an embodiment of the invention. FIG. 4 is a schematic diagram of step S101 of a data verification method according to an embodiment of the present invention. FIG. 5 is a schematic diagram of step S103 of a data verification method according to an embodiment of the present invention. FIG. 6 is a schematic diagram of a record data group to be verified according to an embodiment of the present invention.

S101、S1011、S1013、S1011a、S1011b、S1011c、S1013a、S1013b、S1013c:步驟 S101, S1011, S1013, S1011a, S1011b, S1011c, S1013a, S1013b, S1013c: steps

V2:第二驗證值 V2: Second verification value

V1:第一驗證值 V1: first verification value

H:歷史資料 H: Historical data

Claims (12)

一種資料驗證方法,應用於一伺服器,該資料驗證方法包括下列步驟: 步驟S101:根據一段時間內該伺服器接收到的多個紀錄資料組包括的多個第一紀錄資料產生一第一驗證值,並記錄一歷史資料,其中每一該些紀錄資料組包括屬性不同的該些第一紀錄資料,該歷史資料包括該些第一紀錄資料的屬性; 步驟S103:根據所儲存的對應該段時間的多個待驗證紀錄資料組包括的多個待驗證第一紀錄資料及該歷史資料,產生一待驗證第一驗證值;以及 步驟S105:比對該第一驗證值與該待驗證第一驗證值,若該第一驗證值與該待驗證第一驗證值不同,則判斷該些紀錄資料組與該些待驗證紀錄資料組不同。 A data verification method applied to a server. The data verification method includes the following steps: Step S101: Generate a first verification value based on a plurality of first record data included in a plurality of record data groups received by the server within a period of time, and record a historical data, wherein each of the record data groups includes different attributes The first record data of, the historical data includes the attributes of the first record data; Step S103: Generate a first verification value to be verified according to the plurality of first record data to be verified included in the plurality of record data groups to be verified corresponding to the period of time and the historical data; and Step S105: Compare the first verification value with the first verification value to be verified, and if the first verification value is different from the first verification value to be verified, determine the record data groups and the record data groups to be verified different. 如請求項1所述的資料驗證方法,其中於該步驟S103中,該段時間的該些待驗證紀錄資料組的屬性的數量,多於該歷史資料中該段時間所記錄的該些屬性的數量,根據對應該歷史資料中該段時間所記錄的該些屬性的該些待驗證第一紀錄資料產生該待驗證第一驗證值。The data verification method according to claim 1, wherein in step S103, the number of attributes of the record data groups to be verified in the period of time is greater than the number of attributes recorded in the historical data during the period of time Quantity, the first verification value to be verified is generated based on the first record data to be verified corresponding to the attributes recorded in the period of time in the historical data. 如請求項1所述的資料驗證方法,其中於該步驟S101中,包括對每一該些紀錄資料組的該些第一紀錄資料進行一雜湊演算法,該歷史資料更包括該些第一紀錄資料進行該雜湊演算法時,該些第一紀錄資料對應的該些屬性的順序。The data verification method according to claim 1, wherein the step S101 includes performing a hash algorithm on the first record data of each of the record data groups, and the historical data further includes the first records When the data is used for the hash algorithm, the sequence of the attributes corresponding to the first record data. 如請求項1所述的資料驗證方法,其中: 該步驟S101包括: 步驟S1011:對每一該些紀錄資料組的該些第一紀錄資料進行一第一演算法而產生多個第二驗證值;以及 步驟S1013:對該些第二驗證值進行一第二演算法而產生該第一驗證值;以及 該步驟S103包括: 步驟S1031:根據該歷史資料,對每一該些待驗證紀錄資料組的該些待驗證第一紀錄資料進行該第一演算法而產生多個待驗證第二驗證值;以及 步驟S1033:對該些待驗證第二驗證值進行該第二演算法而產生該待驗證第一驗證值。 The data verification method described in claim 1, wherein: This step S101 includes: Step S1011: Perform a first algorithm on the first record data of each of the record data groups to generate a plurality of second verification values; and Step S1013: Perform a second algorithm on the second verification values to generate the first verification value; and This step S103 includes: Step S1031: According to the historical data, perform the first algorithm on the first record data to be verified in each of the record data groups to be verified to generate a plurality of second verification values to be verified; and Step S1033: Perform the second algorithm on the second verification values to be verified to generate the first verification values to be verified. 如請求項4所述的資料驗證方法,其中該第一演算法及該第二演算法包括雜湊演算法。The data verification method according to claim 4, wherein the first algorithm and the second algorithm include a hash algorithm. 如請求項5所述的資料驗證方法,其中: 該步驟S1011包括:當該伺服器接收各該紀錄資料時,賦予各該紀錄資料一順序碼,其中各該紀錄資料的該順序碼互不相同; 該步驟S1013包括:根據該順序碼排序該些第二驗證值後,對排序後的該些第二驗證值進行該第二演算法的該雜湊演算法而產生該第一驗證值;以及 該步驟S1033包括:根據該順序碼排序該些待驗證第二驗證值後,對排序後的該些待驗證第二驗證值進行該第二演算法的該雜湊演算法而產生該待驗證第一驗證值。 The data verification method described in claim 5, wherein: The step S1011 includes: when the server receives each record data, assigning each record data a sequence code, wherein the sequence code of each record data is different from each other; The step S1013 includes: after sorting the second verification values according to the sequence code, performing the hash algorithm of the second algorithm on the sorted second verification values to generate the first verification value; and The step S1033 includes: after sorting the second verification values to be verified according to the sequence code, performing the hash algorithm of the second algorithm on the sorted second verification values to generate the first to be verified Verification value. 如請求項4所述的資料驗證方法,其中更包括: 步驟S107:比對該些第二驗證值與該些待驗證第二驗證值,若該些第二驗證值的其中一個與對應的該待驗證第二驗證值不同,則判斷對應的該紀錄資料組與對應的該待驗證紀錄資料組不同。 The data verification method described in claim 4 further includes: Step S107: Compare the second verification values with the second verification values to be verified, and if one of the second verification values is different from the corresponding second verification value to be verified, determine the corresponding record data The group is different from the corresponding record data group to be verified. 如請求項4所述的資料驗證方法,其中步驟S1011包括:透過一儲存單元封存該第二驗證值。The data verification method according to claim 4, wherein step S1011 includes: sealing the second verification value through a storage unit. 如請求項4所述的資料驗證方法,其中步驟S1011包括:透過一區塊鍊、一公信單位、一電子郵件或一電子布告欄公開該第二驗證值,其中該區塊鍊包括一公鍊及/或一私鍊。The data verification method according to claim 4, wherein step S1011 includes: disclosing the second verification value through a blockchain, a public trust unit, an email or an electronic bulletin board, wherein the blockchain includes a public chain And/or a private chain. 如請求項1所述的資料驗證方法,其中該步驟S101包括:透過一儲存單元封存該第一驗證值及/或該歷史資料。The data verification method according to claim 1, wherein the step S101 includes: sealing the first verification value and/or the historical data through a storage unit. 如請求項1所述的資料驗證方法,其中該步驟S101包括:透過一區塊鍊、一公信單位、一電子郵件或一電子布告欄公開該第一驗證值,其中該區塊鍊包括一公鍊及/或一私鍊。The data verification method according to claim 1, wherein the step S101 includes: disclosing the first verification value through a blockchain, a public trust unit, an email, or an electronic bulletin board, wherein the blockchain includes a public Chain and/or a private chain. 如請求項1所述的資料驗證方法,其中該些紀錄資料組更包括至少一第二紀錄資料,該步驟S101中產生該第一驗證值時不使用該至少一第二紀錄資料。According to the data verification method of claim 1, wherein the record data groups further include at least one second record data, and the at least one second record data is not used when generating the first verification value in step S101.
TW108142193A 2019-11-20 2019-11-20 Data verification method TWI717909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108142193A TWI717909B (en) 2019-11-20 2019-11-20 Data verification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108142193A TWI717909B (en) 2019-11-20 2019-11-20 Data verification method

Publications (2)

Publication Number Publication Date
TWI717909B true TWI717909B (en) 2021-02-01
TW202121212A TW202121212A (en) 2021-06-01

Family

ID=75745665

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108142193A TWI717909B (en) 2019-11-20 2019-11-20 Data verification method

Country Status (1)

Country Link
TW (1) TWI717909B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699428A (en) * 2009-10-27 2010-04-28 中华电信股份有限公司 Characteristic value comparison based content analysis method
US20160085967A1 (en) * 2014-09-23 2016-03-24 Ramesh Thomas Techniques for enabling co-existence of multiple security measures
TWM531611U (en) * 2016-07-29 2016-11-01 First Commercial Bank Co Ltd File access log and classification management system, personal computer and server
CN106682457A (en) * 2016-12-16 2017-05-17 北京握奇智能科技有限公司 Picture copyright protection method and picture copyright protection system based on blockchain technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699428A (en) * 2009-10-27 2010-04-28 中华电信股份有限公司 Characteristic value comparison based content analysis method
US20160085967A1 (en) * 2014-09-23 2016-03-24 Ramesh Thomas Techniques for enabling co-existence of multiple security measures
TWM531611U (en) * 2016-07-29 2016-11-01 First Commercial Bank Co Ltd File access log and classification management system, personal computer and server
CN106682457A (en) * 2016-12-16 2017-05-17 北京握奇智能科技有限公司 Picture copyright protection method and picture copyright protection system based on blockchain technology

Also Published As

Publication number Publication date
TW202121212A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US20200356901A1 (en) Target variable distribution-based acceptance of machine learning test data sets
WO2021073242A1 (en) Index creation and data querying methods, apparatus and device
O'Donoghue et al. Design choices and trade-offs in health care blockchain implementations: systematic review
US10146600B2 (en) Mutable data objects content verification tool
US9081978B1 (en) Storing tokenized information in untrusted environments
US9122729B2 (en) Chain-of-custody for archived data
CN103136243B (en) File system duplicate removal method based on cloud storage and device
US20140108817A1 (en) Method for processing and verifying remote dynamic data, system using the same, and computer-readable medium
WO2021017422A1 (en) Index creation method in block chain type account book, device and apparatus
CN111602166B (en) Method and apparatus for providing traversable key-value data storage on a blockchain
JP2022070868A (en) Proving method of existence of digital document, system therefor, and tagchain blockchain system
WO2020258858A1 (en) Authorization method, system, apparatus and device in blockchain-type account book
WO2021073240A1 (en) Method, device, and apparatus for storing data in blockchain ledger
US20140244654A1 (en) Data migration
WO2021093461A1 (en) Method and apparatus for aggregation calculation in blockchain-type ledger, and device
US20170103099A1 (en) Database table data fabrication
CN115659417A (en) Audit log storage method, audit log verification method, audit log storage device, audit log verification device and computer equipment
US20150378835A1 (en) Managing data storage system
US10860659B1 (en) Distributed verification of digital work product
US11080280B2 (en) Enable merge join on encrypted data
CN113362068B (en) Method for verifying block chain state transfer by light node
TWI717909B (en) Data verification method
CN107766354A (en) A kind of method and apparatus for being used to ensure data correctness
EP2339445A2 (en) File management information storage apparatus and method and program for controlling the same
JP2018514886A (en) Aggregate large amounts of time data from many overlapping sources