A freely configurable structured data fingerprint generation and verification method and system

Through freely configurable structured data fingerprint generation and verification methods and systems, the problems of low data integrity protection efficiency and poor flexibility in the existing technology are solved, and no code intrusion, flexible rule configuration and data tampering detection are realized, which is suitable for Multiple database types ensure data integrity and legal risk avoidance.

CN118468352BActive Publication Date: 2024-09-10BEIJING SILICON INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410910805.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-09-10
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

The existing technology has low efficiency, poor flexibility, and business intrusiveness in protecting structured data integrity, making it difficult to generate and verify data fingerprints without modifying business system codes and database tables.

Method used

Provide a freely configurable structured data fingerprint generation and verification method and system, through fingerprint rule configuration, real-time data perception, fingerprint generation and verification, using a modular design independent of the business system, and using configuration tables and fingerprint tables for fingerprinting Generation and verification, supporting flexible rule configuration and periodic detection.

Benefits of technology

It achieves no code intrusion, flexible rule configuration, has strong adaptability and adaptive capabilities, can detect data tampering in time, avoid legal risks, and is suitable for multiple database types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468352B
    Figure CN118468352B
Patent Text Reader

Abstract

The present invention discloses a freely configurable structured data fingerprint generation and verification method and system, which relates to the field of data security technology, including: configuring fingerprint generation rules for a target database, and writing the fingerprint generation rules into a configuration table; acquiring target data based on the target database, and sensing the target data in real time, and extracting update data; obtaining a generated fingerprint based on the update data using fingerprint generation rules, and writing the generated fingerprint and fingerprint generation time into a fingerprint table; retrieving the corresponding generated fingerprint and fingerprint generation time in the fingerprint table according to the verification target data; extracting the corresponding business data for generating fingerprints according to the verification target data; generating a verification fingerprint based on the business data and the fingerprint generation time using the fingerprint generation rules; comparing the verification fingerprint with the generated fingerprint to obtain a verification result. The present invention provides an independent fingerprint system that is non-invasive, code-free, easy to apply, and has strong demand adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and more particularly to a freely configurable structured data fingerprint generation method and system. Background Art

[0002] In the field of information technology, the security of data itself is of vital importance. In particular, data integrity and non-tamperability are basic capabilities that must be possessed by many business digital systems. In particular, most information systems do not provide relevant protection measures in terms of the integrity of structured business data. In recent years, a large number of legal cases have occurred in which system maintenance personnel were suspected of illegally modifying user data, transaction data, log data, business data, behavioral data, etc. in the background. When law enforcement agencies traced the behavior, they found that they could not identify whether the data had been tampered with or whether the data itself was complete, which brought a series of problems to the case handling.

[0003] If you want to protect the integrity of important data, the mainstream approach is to add a data fingerprint column to each data table that needs to be protected, and then use code to generate and save the fingerprint of a single row of data. In this way, when the data in a field is modified, the entire row of data will not match the fingerprint column data. However, this method is inefficient, inflexible, and business-invasive (that is, each business system needs to have a similar fingerprint generation mechanism, code logic, etc.). On the one hand, it brings inconvenience to business developers, and on the other hand, it is easy to cause business system bugs and lacks the ability to adapt to changes in business data items. Therefore, how to achieve data fingerprint generation and verification without invading the original business system code and database table is a problem that technicians in this field need to solve urgently. Summary of the invention

[0004] In view of this, the present invention provides a freely configurable structured data fingerprint generation and verification method and system, which overcomes the above-mentioned defects.

[0005] In order to achieve the above object, the present invention adopts the following technical solution:

[0006] A freely configurable structured data fingerprint generation and verification method, the specific steps are:

[0007] Fingerprint rule configuration method:

[0008] Perform fingerprint generation rule configuration on the target database, and write the fingerprint generation rule into the configuration table;

[0009] Fingerprint generation method:

[0010] Acquire target data based on the target database, perceive the target data in real time, and extract update data;

[0011] Obtaining a generated fingerprint using the fingerprint generation rule based on the updated data, and writing the generated fingerprint and fingerprint generation time into a fingerprint table;

[0012] Fingerprint verification method:

[0013] Retrieving the corresponding generated fingerprint and the fingerprint generation time in the fingerprint table according to the verification target data;

[0014] Extracting corresponding business data for generating fingerprints according to the verification target data;

[0015] Generate a verification fingerprint using the fingerprint generation rule based on the business data and the fingerprint generation time;

[0016] The verification fingerprint is compared with the generated fingerprint to obtain a verification result.

[0017] Optionally, the table structure of the configuration table includes: configuration ID, first database, first table name, data column information that needs to be protected, fingerprint algorithm, confidentiality Salt value, data tampering check cycle, and data update perception method.

[0018] Optionally, the table structure of the fingerprint table includes a fingerprint ID, a second database, a second table name, a table record, a fingerprint, and a time when the fingerprint was generated.

[0019] Optionally, the steps of obtaining the generated fingerprint are:

[0020] Acquire data of each field of the update data according to the fingerprint generation rule;

[0021] and arranging and connecting the data of each field to form a character string d;

[0022] Obtain fingerprint generation data according to the string d, the confidential Salt value and the current timestamp of the server;

[0023] The generated fingerprint is obtained according to the fingerprint generation data using the fingerprint algorithm.

[0024] Optionally, the expression for generating the fingerprint is:

[0025] fp=FP(Sort(C1,C2,C3...)+salt+ts),H);

[0026] In the formula, FP is the fingerprint generation algorithm calling function; H is the fingerprint generation algorithm; Sort is the function for sorting data according to columns; salt is a random string; ts is the current timestamp of the server.

[0027] Optionally, the verification target data includes a database, a table name and the table records.

[0028] Optionally, it also includes updating fingerprint generation rules, and the specific steps are:

[0029] Perform full fingerprint verification on the target data. If the verification succeeds, configure and update the fingerprint generation rules, and generate the updated fingerprint accordingly. If the verification fails, continue to use the fingerprint generation rules.

[0030] A freely configurable structured data fingerprint generation and verification system, comprising: a fingerprint configuration management module, a data update perception module, a fingerprint data generation module, a fingerprint data management module and a fingerprint data verification module;

[0031] The fingerprint configuration management module is used to configure or update the fingerprint generation rules of the target database;

[0032] The data update perception module is used to obtain target data according to the target database, perceive the target data in real time, and extract update data;

[0033] The fingerprint data generating module is used to obtain and generate fingerprint data using the fingerprint generating rule according to the update data;

[0034] The fingerprint data management module is used to store or query the generated fingerprint data;

[0035] The fingerprint data verification module is used to obtain the corresponding generated fingerprint data and business data used to generate the fingerprint according to the verification target data, and obtain the verification fingerprint according to the business data; compare the verification fingerprint with the generated fingerprint data to obtain the verification result.

[0036] Optionally, the data update perception module adopts any one of the perception methods of SDK, database trigger and database log.

[0037] Optionally, the fingerprint data verification module further includes a periodic tampering detection module for periodically detecting the target data.

[0038] It can be seen from the above technical solutions that the present invention discloses a freely configurable structured data fingerprint generation and verification method and system, which has the following beneficial effects compared with the prior art:

[0039] 1. The present invention discloses a fingerprint system that is independent of the business system, non-intrusive, code-free, and completely imperceptible to business developers;

[0040] 2. Flexible rule configuration strategy, with strong demand adaptability, can meet almost all business system requirements;

[0041] 3. Periodically and regularly detect abnormal data tampering to promptly discover hidden dangers and avoid legal risks;

[0042] 4. It can be applied to unstructured, document-based, key-value pair databases similar to redis\neo4j\mongodb, and has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0044] Figure 1 A schematic diagram of the method provided by the present invention;

[0045] Figure 2 The present invention provides a schematic diagram of the system structure. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] This embodiment discloses a freely configurable structured data fingerprint generation and verification method. Figure 1 As shown, the specific steps are:

[0048] Fingerprint rule configuration method:

[0049] Step 1: Configure fingerprint generation rules for the target database and write the fingerprint generation rules into the configuration table;

[0050] Fingerprint generation method:

[0051] Step 2: Obtain target data based on the target database, perceive the target data in real time, and extract and update data;

[0052] Step 3: Obtain the generated fingerprint using the fingerprint generation rule based on the updated data, and write the generated fingerprint and fingerprint generation time into the fingerprint table;

[0053] Fingerprint verification method:

[0054] Step 4: Retrieve the corresponding generated fingerprint and fingerprint generation time in the fingerprint table according to the verification target data;

[0055] Step 5: extracting the business data used to generate the fingerprint according to the verification target data;

[0056] Step 6: Generate a verification fingerprint using fingerprint generation rules based on business data and fingerprint generation time;

[0057] Step 7: Compare the verification fingerprint with the generated fingerprint to obtain the verification result.

[0058] In one embodiment, the table structure of the configuration table includes: configuration ID, first database, first table name, data column information that needs to be protected, fingerprint algorithm, confidentiality Salt value, data tampering check cycle, and data update perception method.

[0059] Furthermore, the configuration ID is obtained by randomly generating, and the first database is used to store configuration rules, etc., wherein the data update perception method includes SDK, database trigger, and database log.

[0060] In one embodiment, the table structure of the fingerprint table includes fingerprint ID, second database, second table name, table record, fingerprint, and fingerprint generation time.

[0061] Furthermore, the table record is the row ID of the table.

[0062] Furthermore, the fingerprint ID is generated by a snowflake algorithm, the database, table, and table record are used to uniquely locate the data that needs to be protected, and the fingerprint column is used to store the generated fingerprint.

[0063] In one embodiment, the steps of obtaining the generated fingerprint are:

[0064] Step 31, acquiring data of each field of the updated data according to the fingerprint generation rule; wherein the acquisition of data of each field is obtained by relying on the existing query statement;

[0065] Step 32, arrange and connect the data of each field to form a character string d;

[0066] Step 33, obtain fingerprint generation data according to the string d, the confidential Salt value and the current timestamp of the server;

[0067] Step 34: Obtain a generated fingerprint based on the fingerprint generation data using a fingerprint algorithm.

[0068] Furthermore, the current timestamp of the server will also be used as the value of the TS column (i.e., fingerprint generation time) in the fingerprint record in the fingerprint table. In principle, the TS value in the fingerprint record is consistent with the data update time recorded in the business system.

[0069] In one embodiment, the expression for generating the fingerprint is:

[0070] fp=FP(Sort(C1,C2,C3...)+salt+ts),H);

[0071] In the formula, FP is the fingerprint generation algorithm calling function; H is the fingerprint generation algorithm; Sort is the function for sorting data according to columns; salt is a random string; ts is the current timestamp of the server.

[0072] Furthermore, the steps for obtaining the generated fingerprint are: reading the configured fingerprint generation rules, obtaining the data of each field according to the fingerprint generation rules, and arranging the data in ascending order according to the field name, connecting the string set edges of the arranged data set to form an overall string d, and then connecting the string d with the salt in the fingerprint generation rules and the current server timestamp to generate a complete fingerprint generation data D, and then using the fingerprint generation algorithm H selected in the fingerprint generation rules to operate on the fingerprint generation data D to obtain the generated fingerprint fp, that is:

[0073] fp=FP(Sort(C1,C2,C3...)+salt+ts),H).

[0074] Furthermore, the fingerprint generation method is specifically as follows:

[0075] Configure fingerprint generation rules for the specified database and table. The configuration information includes: database Database, table name Table, data column information to be protected, fingerprint algorithm, confidentiality Salt value, data tampering check cycle (unit: seconds), data update perception method (SDK, database trigger, database log). After saving and taking effect, perform corresponding operations according to the selected "data update perception method": SDK method requires developers to introduce code engineering through SDK; database trigger method automatically creates Trigger in the target data table by the configuration module; database log method requires the installation of log detection tools on the database server and specifying the database log directory to be monitored.

[0076] When data update is detected, the data to generate fingerprint is extracted from the updated data according to the fingerprint generation rules, sorted and connected according to the fingerprint generation steps, and the fingerprint generation algorithm is called (SM2, RSA, MD5 are supported, SM2 is used by default) to obtain the generated fingerprint fp, and the snowflake algorithm is used to generate a unique ID, and then (fingerprint id, database db, table name table, table record rid, generated fingerprint fp, fingerprint generation time ts) is written into the fingerprint table.

[0077] In one embodiment, the verification target data includes a database, a table name, and a table record.

[0078] Furthermore, when the generated fingerprint needs to be verified, the generated fingerprint fp and fingerprint generation time ts are first retrieved from the fingerprint table according to (database db, table name table, table record rid), and then the business data bizdata is extracted from the business system based on this condition, and then the fingerprint generation algorithm is used to regenerate the verification fingerprint nfp for bizdata+ts, and compare fp and nfp for consistency. If they are inconsistent, an early warning message is generated and the abnormal fingerprint data record is marked;

[0079] In one embodiment, it also includes updating the fingerprint generation rule, and the specific steps are:

[0080] Perform full fingerprint verification on the target data. If the verification succeeds, configure the updated fingerprint generation rules and generate updated fingerprints accordingly. If the verification fails, use the fingerprint generation rules.

[0081] Furthermore, once the fingerprint generation rules take effect, it is not recommended to modify them. If modification is required, it will trigger full fingerprint verification and regeneration of the target data. The rules can only take effect again after the full verification is passed, otherwise the rule update fails.

[0082] On the other hand, this embodiment discloses a freely configurable structured data fingerprint generation and verification system, such as Figure 2 As shown, it includes: a fingerprint configuration management module, a data update perception module, a fingerprint data generation module, a fingerprint data management module and a fingerprint data verification module;

[0083] Fingerprint configuration management module, used to configure or update fingerprint generation rules for the target database;

[0084] The data update perception module is used to obtain target data according to the target database, perceive the target data in real time, and extract the updated data;

[0085] A fingerprint data generation module, used to obtain and generate fingerprint data using fingerprint generation rules according to update data;

[0086] Fingerprint data management module, used to store or query the generated fingerprint data;

[0087] The fingerprint data verification module is used to obtain the corresponding generated fingerprint data and the business data used to generate the fingerprint according to the verification target data, and obtain the verification fingerprint according to the business data; compare the verification fingerprint with the generated fingerprint data to obtain the verification result.

[0088] In one embodiment, the data update perception module adopts any one of the perception methods including SDK, database trigger, and database log.

[0089] In one embodiment, the fingerprint data verification module further includes a periodic tampering detection module for periodically detecting the target data.

[0090] Furthermore, the fingerprint data verification module provides fingerprint verification services, supporting single data detection, multiple data batch detection, full table data detection, and full database data detection. At the same time, according to the detection cycle in the fingerprint generation rule, single table data tampering detection is performed regularly, and warning information is generated for tampered data. In order to avoid periodic verification affecting the performance of the business system, a small batch multi-round detection method is generally adopted, and the data in the business database will not be accessed one by one.

[0091] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0092] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A freely configurable structured data fingerprint generation and verification method, It is characterized in that The specific steps are: Fingerprint rule configuration method: Perform fingerprint generation rule configuration on the target database, and write the fingerprint generation rule into the configuration table; Fingerprint generation method: Acquire target data based on the target database, perceive the target data in real time, and extract update data; Obtaining a generated fingerprint using the fingerprint generation rule based on the updated data, and writing the generated fingerprint and fingerprint generation time into a fingerprint table; Fingerprint verification method: Retrieving the corresponding generated fingerprint and the fingerprint generation time in the fingerprint table according to the verification target data; Extracting corresponding business data for generating fingerprints according to the verification target data; Generate a verification fingerprint using the fingerprint generation rule based on the business data and the fingerprint generation time; The verification fingerprint is compared with the generated fingerprint to obtain a verification result.

2. A freely configurable structured data fingerprint generation and verification method according to claim 1, It is characterized in that The table structure of the configuration table includes: configuration ID, first database, first table name, data column information that needs to be protected, fingerprint algorithm, confidentiality Salt value, data tampering check cycle, and data update perception method.

3. A freely configurable structured data fingerprint generation and verification method according to claim 1, It is characterized in that The table structure of the fingerprint table includes fingerprint ID, second database, second table name, table record, fingerprint, and fingerprint generation time.

4. A freely configurable structured data fingerprint generation and verification method according to claim 2, It is characterized in that The steps of obtaining the generated fingerprint are: Acquire data of each field of the update data according to the fingerprint generation rule; and arranging and connecting the data of each field to form a character string d; Obtain fingerprint generation data according to the string d, the confidential Salt value and the current timestamp of the server; The generated fingerprint is obtained according to the fingerprint generation data using the fingerprint algorithm.

5. A freely configurable structured data fingerprint generation and verification method according to claim 4, It is characterized in that The expression for generating fingerprint is: fp=FP(Sort(C1,C2,C3...)+salt+ts),H); In the formula, FP is the fingerprint generation algorithm calling function; H is the fingerprint generation algorithm; Sort is the function for sorting data according to columns; salt is a random string; ts is the current timestamp of the server.

6. A freely configurable structured data fingerprint generation and verification method according to claim 3, It is characterized in that The verification target data includes a database, a table name and the table records.

7. A freely configurable structured data fingerprint generation and verification method according to claim 1, It is characterized in that It also includes the update of fingerprint generation rules, the specific steps are: Perform full fingerprint verification on the target data. If the verification succeeds, configure and update the fingerprint generation rules, and generate the updated fingerprint accordingly. If the verification fails, continue to use the fingerprint generation rules.

8. A freely configurable structured data fingerprint generation and verification system, It is characterized in that include: Fingerprint configuration management module, data update perception module, fingerprint data generation module, fingerprint data management module and fingerprint data verification module; The fingerprint configuration management module is used to configure or update the fingerprint generation rules of the target database; The data update perception module is used to obtain target data according to the target database, perceive the target data in real time, and extract update data; The fingerprint data generating module is used to obtain and generate fingerprint data using the fingerprint generating rule according to the update data; The fingerprint data management module is used to store or query the generated fingerprint data; The fingerprint data verification module is used to obtain the corresponding generated fingerprint data and business data used to generate the fingerprint according to the verification target data, and obtain the verification fingerprint according to the business data; compare the verification fingerprint with the generated fingerprint data to obtain the verification result.

9. A freely configurable structured data fingerprint generation and verification system according to claim 8, It is characterized in that The data update perception module adopts any one of the perception modes of SDK, database trigger and database log.

10. A freely configurable structured data fingerprint generation and verification system according to claim 8, It is characterized in that The fingerprint data verification module also includes a periodic tampering detection module for periodically detecting the target data.