A data chaining method and system based on summary information

Through the data uploading method based on summary information, the problems in blockchain applications such as large storage occupancy, difficulty in controlling information transparency, difficulty in modifying and deleting data, and low efficiency of change traceability are solved, and the efficient uploading and uploading of large amounts of data to the chain are realized. Retrieval, improving the space utilization and data confidentiality of the blockchain.

CN116521698BActive Publication Date: 2024-09-13CHONGQING CYBERCITY SCI TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310516295.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2024-09-13
Estimated Expiration
2043-05-09

AI Technical Summary

Technical Problem

During the application process of blockchain, there are problems such as large storage occupation, difficulty in controlling information transparency, difficulty in modifying and deleting data, and low efficiency of change traceability. Although existing methods have solved them, they have brought new problems such as private chain restrictions and data encryption. Difficult to retrieve.

Method used

Adopt a data uploading method based on summary information to ensure data security, reduce distributed storage space usage, and realize big data by receiving user data, key data hash calculation, summary information uploading, index information maintenance, and business application integration. Efficient tracing and retrieval of objects.

Benefits of technology

It achieves efficient on-chain and retrieval of large data volumes, improves blockchain space utilization, enhances data confidentiality, relieves concerns about the scope of knowledge, and improves the feasibility of business on-chain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521698B
    Figure CN116521698B
Patent Text Reader

Abstract

The present invention discloses a data chaining method and system based on summary information, which specifically includes the following steps: S1: establishing a business database, receiving and storing the user's business data to be chained; S2: extracting the summary information of the business data to be chained, and then chaining the summary information, thereby completing the business data chaining; S3: constructing an index system based on the data completed on the chain in S2, which is used to retrieve and trace the business data. The present invention does not need to chain the business data, but only chains the extracted summary information, thereby improving the confidentiality of the business data on the chain, eliminating the concerns about the scope of knowledge of the chained business information, and improving the feasibility of chaining the business of various industries; it not only supports the chaining of large data volume business, but also ensures the efficiency of retrieval and query efficiency, and realizes the efficiency of historical data query and retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of blockchain, and more particularly to a method and system for uploading data to a blockchain based on summary information. Background Art

[0002] The core of blockchain is to solve the credit problem. It stipulates that the later block contains the hash summary information of the previous block data based on the linked list structure, and uses decentralized nodes to distribute and store data to build a universal data trust system.

[0003] After more than ten years of rapid development, blockchain has broken through the single native application model of digital currency in the application field, and developed a "blockchain +" application model that combines traditional scenarios and blockchain underlying protocols, enabling blockchain to be widely used in various industries.

[0004] However, due to the limitations of the blockchain's own architectural features and core attributes, various industries are still in a state of forbearance in actual application. The following are typical problems that exist in the application of blockchain.

[0005] The first is the storage occupation problem: the data on the chain will be synchronized to each participant node of the blockchain. The original intention of the distributed design is to prevent tampering by creating backups, but at the same time it causes a lot of data redundancy and huge waste of disk space.

[0006] The second is the issue of information transparency: the data on the chain will be broadcast and shared with every participant, but the data itself often needs to control the scope of knowledge, so that only the participants who should see it can see it; if used carelessly, it will not only conflict with the user's "right to be forgotten", but may even cause data leakage or leaks, causing significant losses to individuals, companies and even countries.

[0007] The third is the issue of data modification: blockchain requires that the data on the chain cannot be modified and must be retained permanently, while data has its own life cycle, such as data generation, data use, data modification, data deletion, etc.

[0008] The fourth is the problem of change tracing: business data is stored in the data segment of the block in the blockchain. The great differences in business make it difficult to build a unified index. As the number of blocks continues to increase, the method of linearly searching the business data on the chain one by one by block will seriously reduce the query efficiency.

[0009] The industry has also provided some solutions to the above problems. For example, introducing private chains and alliance chains and controlling the write and access rights of participants to solve the distribution problem; or solving the information transparency problem by uploading encrypted data to the chain based on trapdoor retrieval; or reducing storage usage by uploading summaries, fingerprints, and external links to the chain.

[0010] Existing methods solve some problems from various points, but they also bring a series of new problems, such as private chains restricting technology selection, controlling participants' writing in violation of the principle of decentralization, and data being difficult to retrieve after being encrypted on the chain. Summary of the invention

[0011] In view of the technical problem that data on-chain and tracing are difficult in the prior art, the present invention proposes a data on-chain method and system based on summary information. By receiving user data, key data hash calculation, summary information on-chain, index information maintenance, business application integration and other method steps, not only the security of sensitive data on-chain is guaranteed, but also the space occupied by data objects in blockchain distributed storage is reduced, so that the summary of large data objects and the summary of historical change records can be efficiently traced and retrieved on the blockchain, making it possible for various types of big data to be on-chain and applied.

[0012] In order to achieve the above object, the present invention provides the following technical solutions:

[0013] A data chain-up method based on summary information, specifically comprising the following steps:

[0014] S1: Establish a business database to receive and store the user's business data to be uploaded to the chain;

[0015] S2: Extract the summary information of the business data to be uploaded to the chain, and then upload the summary information to the chain, thereby completing the upload of the business data to the chain;

[0016] S3: Based on the data uploaded to the chain in S2, an index system is constructed to retrieve and trace business data.

[0017] Preferably, in S1, the business database is set with the following four principles: each piece of business data needs to have a corresponding business number; the business data itself can only be saved and cannot be deleted; the need to modify business data is handled by adding new records; and the need to delete the business database is handled by logical deletion.

[0018] Preferably, S2 includes the following steps:

[0019] S2-1: Use the existing summary algorithm to extract summary information of the business data to be uploaded to the chain;

[0020] S2-2: Use a hash algorithm to perform hash calculation on the summary information and output a hash code;

[0021] S2-3: Build the on-chain information, push it to the blockchain, and receive the data location information returned by the blockchain to complete the data on-chain.

[0022] Preferably, in S2-3, the on-chain information includes the business number, operation type, summary information, hash code, and on-chain location of the previous version of the business data to be on-chain.

[0023] Preferably, in S3, the index system includes a forward index and a reverse index.

[0024] Preferably, the data structure of the forward index is a mapping set of key-value pairs, denoted as:

[0025] F={W1,W2...W n}, (1)

[0026] In formula (1), F represents the data structure of the forward index; W n =[ID an →A sn ], indicating the mapping relationship of the nth positive index key-value pair, ID an Indicates the nth business number, A s A collection of historical versions of summary information; d ={ID b1 ,ID b2... ,ID bm}, ID bn Represents the business summary of the mth version, that is, the hash code.

[0027] Preferably, the data structure of the inverted index is:

[0028] I={R1,R2...R n} (2)

[0029] In formula (2), I represents the data structure of the inverted index; R n =[ID bn →{H mn ∩ID an}], showing the mapping relationship of the nth inverted index key-value pair, ID bn Indicates the nth business summary information, that is, the hash code; {H mn ∩ID an} indicates the block height and business number, H mn Indicates the nth block height, i.e. the location information of the block, ID an Indicates the nth business number.

[0030] The present invention also provides a data chain system based on summary information, including a business collection unit, a blockchain unit and an index unit;

[0031] The business collection unit includes a business data input unit, a summary information extraction unit, a hash calculation unit and an uplink information push unit;

[0032] Business data input unit, used to input the business data to be uploaded to the chain by the user;

[0033] A summary information extraction unit, used to extract summary information of the business data to be uploaded to the chain using a summary algorithm;

[0034] A hash calculation unit, used to perform hash calculation on the summary information using a hash algorithm and output a hash code;

[0035] The on-chain information push unit is used to construct on-chain information, push it to the blockchain, and receive the data location information returned by the blockchain to complete data on-chain.

[0036] Preferably, the blockchain includes a private chain, a consortium chain, and a public chain.

[0037] Preferably, the index unit includes a forward index module and a reverse index module; the forward index module is used to find business data through business codes; the reverse index module is used to find business codes through business data.

[0038] In summary, due to the adoption of the above technical solution, compared with the prior art, the present invention has at least the following beneficial effects:

[0039] The present invention not only supports the uploading of large data volume services to the chain, but also ensures the high efficiency of retrieval and query, and realizes the high efficiency of historical data query and retrieval;

[0040] The present invention reduces the redundancy of business data stored on the chain and improves the space utilization of the blockchain; avoids the dependence on private chains and alliance chains and improves the freedom of technology selection;

[0041] The present invention does not need to upload business data to the chain, but only uploads the extracted summary information to the chain, thereby improving the confidentiality of business data on the chain, eliminating concerns about the scope of knowledge of the business information on the chain, and improving the feasibility of chaining businesses in various industries. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 The figure is a flow chart of a data uplinking method based on summary information according to an exemplary embodiment of the present invention.

[0043] Figure 2 The figure is a schematic diagram of a data uplinking system based on retrieval summary according to an exemplary embodiment of the present invention.

[0044] Figure 3 FIG. 4 is a schematic diagram of a business system structure according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0045] The present invention is further described in detail below in conjunction with the examples and specific implementation methods. However, this should not be understood as the scope of the above subject matter of the present invention being limited to the following examples, and all technologies realized based on the content of the present invention belong to the scope of the present invention.

[0046] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0047] like Figure 1 As shown, the present invention provides a data uplink method based on summary information, which specifically includes the following steps:

[0048] S1: Establish a business database to receive and store the user's business data to be uploaded to the chain.

[0049] In this embodiment, the business database established is set up with the following four principles: each business data (Data) needs to have a corresponding business number (Business Number, BnId); business data itself can only be saved and cannot be deleted; the need for business data modification is handled by adding new records; the need for business database deletion is handled by logical deletion. Among them, the business number is the key information for business data tracing, and the process of the corresponding business data can be known by querying the business number, which is convenient for subsequent process tracing and management.

[0050] For example, a user initiates a drafting process, fills in business data, and uploads the attachment of "Project Establishment Management Measures (Draft for Comments)" to the form. The application system performs corresponding processing in the background, including entering process data into the database and storing attachments into the business database. A new process business record is added to the business database, and the business number is: BN202209060001.

[0051] S2: Extract summary information of the business data to be uploaded to the chain, and then upload the summary information to the chain.

[0052] S2-1: Use existing digest algorithms (including SHA-224, SHA-256, SHA-384, SHA-512, SHA-512 / 224, SHA-512 / 256) to extract summary information of the business data to be uploaded to the chain;

[0053] In view of the distributed characteristics of blockchain, all data will be copied to each node, so the amount of data on the chain cannot be too large; and due to the transparency and openness of blockchain data, users in various industries will worry about whether the data will be leaked due to the chain. The industry has seen encrypted data on the chain based on trapdoor retrieval. If this method is adopted, not only will the disk space be too large, but once the attacker obtains the encryption key, the original data can be directly accessed, resulting in data leakage. Or hyperlinks are used to chain. Hyperlinks are only references to the original data. This reference relationship is fragile. Although the space is small, the link can be cut off at any time, and the robustness of the data cannot be guaranteed. The way to chain the summary information is to generate the original data into a fixed-length HashId string through the relevant Hash function, and establish a one-to-one relationship between the original data and the HashId. That is, it takes into account the small disk occupancy and realizes the characteristics of strong data association. That is, the main content of the business data to be chained in the present invention (the capacity may be 1G, 1T) is not chained, but the extractor summary information (generally only tens of kb), which greatly reduces the data capacity and occupies less disk space. At the same time, the corresponding business data can be retrieved through the summary information.

[0054] In this embodiment, the business data is the attachment of "Project Establishment Management Measures (Draft for Comments)", and the extraction of its summary information is a prior art and is not the focus of the present invention, so it will not be elaborated.

[0055] S2-2: Use a hash algorithm (such as SHA256 algorithm) to perform hash calculation on the summary information and output a hash code.

[0056] In this embodiment, the hash code will be used as an input condition for chaining and index creation; the number of hash codes is, for example, efc0eae75f1e8e301e5edd1f1cd8f38f3cadda5d.

[0057] S2-3: Build the on-chain information, push it to the blockchain, and receive the data location information returned by the blockchain, which is generally the block height or transaction hash code, to complete the data on-chain.

[0058] Currently, both relational and non-relational databases allow users to add, modify, delete and query data. Once the database allows modification and deletion, users can question the data, and data maintainers and users may have problems such as tampering, denial, and distrust. Blockchain uses a series of technical means to stipulate that data cannot be modified, thus ensuring the trust of data from the source. Therefore, uploading business data to the chain is a necessary means to ensure data credibility.

[0059] In this embodiment, the on-chain information includes the business number, operation type, summary information, hash code, and the previous version on-chain position of the business data to be on-chain. To facilitate on-chain, the on-chain information must first be converted into hexadecimal data.

[0060] For example, the information on the chain is {'BiCode':'BN202209060001','Operate':'created','File':'《Project Establishment Management Measures》(Draft for Comments).docx','Hash':'efc0eae75f1e8e301e5edd1f1cd8f38f3cadda5d','PreHxHash':'none'}. Among them, BiCode represents the business number; Operate represents the operation type, which is used to describe the business operation type, including creation, modification, and deletion; File represents the object description; Hash represents the hash code; PreHxHash represents the location on the previous version of the chain, and is represented as none when new business data is added.

[0061] In this embodiment, since the business summary information is uploaded to the chain, a high degree of freedom is provided in the selection of blockchain technology, and private chains, consortium chains, and public chains can all be supported.

[0062] In this embodiment, after the on-chain information is uploaded to the chain, the blockchain return information needs to be received, and the transaction hash code is expressed as: 0xc8860699b761c1065d3b27b9a948f76fc6c74114ebf254b3651587a27ae46fee.

[0063] S3: Based on the data uploaded to the chain in S2, an index system is constructed to facilitate retrieval of the business data uploaded to the chain.

[0064] In this embodiment, the existing technology mainly uses a traversal method to search for data. Once the amount of data reaches tens of millions or even more, the traversal query time is in minutes or hours. After building an index system, the index query time is in milliseconds, which greatly improves the retrieval efficiency.

[0065] In this embodiment, in order to adapt to different query applications, the constructed index system includes a forward index (Forwardindex) and an inverted index (Inverted index).

[0066] S3-1: Forward index is mainly to establish a business summary fingerprint set, and to convert the business number ID a and summary information set A sIt is stored in the distributed cache database of the blockchain in the form of key-value pairs, recording every change of business data; through the establishment of a positive index, it effectively solves the problem of slow tracing of historical versions of business data on the blockchain and improves the timeliness of tracing.

[0067] The data structure of the forward index is a mapping set of key-value pairs, denoted as:

[0068] F={W1,W2...W n}, (1)

[0069] In formula (1), F represents the data structure of the forward index; W n =[ID an →A s ], indicating the mapping relationship of the nth positive index key-value pair, ID an Indicates the nth business number (key), A s A represents a collection (value) of historical versions of summary information. Business data may be modified many times during the process of being uploaded to the chain. There are multiple modified versions. Each modified version has corresponding summary information, thus forming a summary information collection corresponding to a business number. s ={ID b1 ,ID b2... ,ID bm}, ID bn Represents the summary information of the mth modified version, which can also be understood as a hash code.

[0070] In this embodiment, the forward index structure is, for example, in the following form:

[0071] {'BiCode:BN202209060001':['efc0eae75f1e8e301e5edd1f1cd8f38f3cadda5d']}.

[0072] S3-2: Data is stored in blocks of the blockchain. Each block has an upper limit, such as 4KB, so the database cannot exist in only one block. As the amount of data on the blockchain continues to increase, the number of blocks will be increased synchronously, such as 100 million blocks. It is very difficult to quickly locate data in these blocks. Therefore, an indexing method based on the inverted idea is proposed, which stores the business summary ID (HashId) and block height (Block height) in the distributed cache database of the blockchain as key-value pairs, solving the problem of how to quickly locate business data in the blockchain and improving the query efficiency of business data to the blockchain.

[0073] The data structure of the inverted index is:

[0074] I={R1,R2...R n} (2)

[0075] In formula (2), I represents the data structure of the inverted index; R n =[ID bn →{H mn ∩ID an}], showing the mapping relationship of the nth inverted index key-value pair, ID bn Indicates the nth business summary information (key), that is, the hash code; {H mm ∩ID an} represents the block height and business number (value), H mn Indicates the nth block height, i.e. the location information of the block, ID an Indicates the nth business number.

[0076] In this example, the inverted index structure is, for example, in the following form:

[0077] {'BiDataHash:efc0eae75f1e8e301e5edd1f1cd8f38f3cadda5d':{'BiCode':'BN202209060001' ,'TxHash':'0xc8860699b761c1065d3b27b9a948f76fc6c74114ebf254b3651587a27ae46fee'}}.

[0078] In this example, in this inverted index algorithm, it means that as the blockchain height H m As the number of queries increases, the time required for algorithm execution also increases, and the time complexity is improved from O(n) for linear search to O(1) for constant level, which greatly improves the retrieval efficiency. O is the industry-standard representation of time complexity, namely the big O representation. O(n) means that the running time increases linearly, and O(1) means that the running time is a constant.

[0079] In this embodiment, by establishing an index system, it is possible to find business data through business codes, and to find business codes and historical records through data, thereby providing data support for tracing historical versions of data.

[0080] Find business data through business code: through the forward index, the corresponding relationship between business code and business data, after entering the business code, you can quickly retrieve the summary information set and find the business data; find business code through business data: through the inverted index, there is a corresponding relationship between summary information and business number, so you can quickly find the corresponding business code through any version of business data.

[0081] In this embodiment, at any stage, users are allowed to backtrack the attachment version, view the change record of the attachment during the business process, and provide the ability to verify each version of the attachment on the chain. Based on the summary information and index system on the blockchain, it is possible to associate the attachment list and detailed information through the business, and to associate any attachment with the business information and the chain information to which it belongs.

[0082] Based on the above method, in this embodiment, if Figure 2 As shown, a data chain system based on retrieval summary is also provided, including a business collection unit, a blockchain unit and an index unit. The business collection unit is any business system, such as OA, ERP, OMS; the blockchain unit is a trusted system used to save data status and improve users' trust in information systems and data; the index unit is the connection relationship between several units, used to establish connections and improve retrieval efficiency.

[0083] In this embodiment, Figure 3 As shown, the business collection unit includes a business data input unit, a summary information extraction unit, a hash calculation unit and an uplink information push unit;

[0084] Business data input unit, used to input the business data to be uploaded to the chain by the user;

[0085] A summary information extraction unit, used to extract summary information of the business data to be uploaded to the chain using a summary algorithm;

[0086] A hash calculation unit, used to perform hash calculation on the summary information using a hash algorithm (such as the SHA256 algorithm) and output a hash code;

[0087] The on-chain information push unit is used to construct on-chain information, push it to the blockchain, and receive data location information returned by the blockchain, generally the block height or transaction hash code, to complete data on-chain.

[0088] In this embodiment, since the business summary information is uploaded to the chain, a high degree of freedom is provided in the selection of blockchain technology. Blockchain includes private chain, alliance chain, public chain, etc.

[0089] In this embodiment, the index unit includes a forward index module and a reverse index module; the forward index module is used to find business data through business codes; the reverse index module is used to find business codes through business data.

[0090] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.

Claims

1. A data chain-up method based on summary information, It is characterized in that The specific steps include: S1: Establish a business database to receive and store the user's business data to be uploaded to the chain; the business database is set up with the following four principles: each business data needs to have a corresponding business number; the business data itself can only be saved and cannot be deleted; the need to modify business data is handled by adding new records; the need to delete the business database is handled by logical deletion; S2: Extract the summary information of the business data to be uploaded to the chain, and then upload the summary information to the chain, thereby completing the upload of the business data to the chain; S2-1: Use the existing summary algorithm to extract summary information of the business data to be uploaded to the chain; S2-2: Use a hash algorithm to perform hash calculation on the summary information and output a hash code; S2-3: Build the on-chain information, push it to the blockchain, and receive the data location information returned by the blockchain to complete the data on-chain; the on-chain information includes the business number, operation type, summary information, hash code, and the on-chain location of the previous version of the business data to be on-chain; S3: Based on the data uploaded to the chain in S2, an index system is constructed to search and trace business data; The index system includes a forward index and a reverse index; The data structure of the forward index is a mapping set of key-value pairs, denoted as: F={W 1 ,W 2 ...W n }, (1) In formula (1), F represents the data structure of the forward index; W n =[ID an →A sn ], indicating the mapping relationship of the nth positive index key-value pair, ID an Indicates the nth business number, A s A collection of historical versions of summary information; s ={ID b1 ,ID b2 ...,ID bm }, ID bn Represents the business summary of the mth version, i.e., the hash code; The data structure of the inverted index is: I={R 1 ,R 2 ...R n } (2) In formula (2), I represents the data structure of the inverted index; R n =[ID bn →{H mn ∩ID an ], showing the mapping relationship of the nth inverted index key-value pair, ID bn Indicates the nth business summary information, that is, the hash code; {H mn ∩ID an } indicates the block height and business number, H mn Indicates the nth block height, i.e. the location information of the block, ID an Indicates the nth business number.

2. A data uplink system based on summary information based on the method of claim 1, It is characterized in that It includes business collection unit, blockchain unit and index unit; The business collection unit includes a business data input unit, a summary information extraction unit, a hash calculation unit and an uplink information push unit; Business data input unit, used to input the business data to be uploaded to the chain by the user; A summary information extraction unit, used to extract summary information of the business data to be uploaded to the chain using a summary algorithm; A hash calculation unit, used to perform hash calculation on the summary information using a hash algorithm and output a hash code; The on-chain information push unit is used to construct on-chain information, push it to the blockchain, and receive the data location information returned by the blockchain to complete data on-chain.

3. A data uplink system based on summary information as claimed in claim 2, It is characterized in that The blockchain includes private chain, alliance chain and public chain.

4. A data uplink system based on summary information as claimed in claim 2, It is characterized in that The index unit includes a forward index module and a reverse index module; the forward index module is used to find business data through business codes; the reverse index module is used to find business codes through business data.