[go: up one dir, main page]

CN118312996A - Key value database verifiable range query method and system for freshness guarantee - Google Patents

Key value database verifiable range query method and system for freshness guarantee Download PDF

Info

Publication number
CN118312996A
CN118312996A CN202410416587.8A CN202410416587A CN118312996A CN 118312996 A CN118312996 A CN 118312996A CN 202410416587 A CN202410416587 A CN 202410416587A CN 118312996 A CN118312996 A CN 118312996A
Authority
CN
China
Prior art keywords
data
query
key
chain
time interval
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202410416587.8A
Other languages
Chinese (zh)
Inventor
于熙洵
周玉云
杨天若
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hainan University
Original Assignee
Hainan University
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 Hainan University filed Critical Hainan University
Priority to CN202410416587.8A priority Critical patent/CN118312996A/en
Publication of CN118312996A publication Critical patent/CN118312996A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供了一种新鲜性保障的键值数据库可验证范围查询方法及系统,通过在数据所有者上传的更新数据内引入特定键,并将特定键与MAC链结构结合,保证范围查询数据存储的完整性。云服务器,利用链图构建算法和断链合并算法生成链图存储结构,确保数据各时刻的新鲜性。查询用户基于双线性多集累加器的有效性验证方案对云服务器反馈的结果作验证,实现范围查询结果的正确性验证,并且基于断链合并算法的存储验证方案,实现查询结果的高效新鲜有效性验证。因此本发明在云服务器存在潜在的不信任风险时,范围查询新鲜有效性仍得以有效维护。

The present invention provides a method and system for verifiable range query of a key-value database with freshness guarantee, which introduces a specific key into the updated data uploaded by the data owner and combines the specific key with the MAC chain structure to ensure the integrity of the range query data storage. The cloud server generates a chain graph storage structure using a chain graph construction algorithm and a broken chain merging algorithm to ensure the freshness of the data at all times. The query user verifies the results fed back by the cloud server based on the validity verification scheme of the bilinear multi-set accumulator to realize the correctness verification of the range query results, and realizes the efficient freshness validity verification of the query results based on the storage verification scheme of the broken chain merging algorithm. Therefore, when there is a potential risk of distrust in the cloud server, the freshness validity of the range query can still be effectively maintained.

Description

一种新鲜性保障的键值数据库可验证范围查询方法及系统A freshness-guaranteed key-value database verifiable range query method and system

技术领域Technical Field

本发明属于数据安全技术领域,具体涉及一种新鲜性保障的键值数据库可验证范围查询方法及系统。The present invention belongs to the technical field of data security, and in particular relates to a verifiable range query method and system for a key-value database with freshness assurance.

背景技术Background technique

随着信息技术的迅速发展,NoSQL数据库在大规模、分布式数据存储和处理方面被广泛研究。NoSQL数据库与传统关系数据库相比,提供了更具适应性的数据存储方法,擅长处理半结构化和非结构化数据,为各种数据格式和结构提供强大的支持,可以有效地适应不断变化的数据需求。此外,NoSQL数据库以其水平可扩展性而闻名,能够扩展以处理大数据量和高并发访问场景,具有包括增强的可扩展性、性能和可用性的显著属性,使其更适合需要快速高效数据处理的当代应用程序。从数据存储的角度看,NoSQL数据库可被分为键值型数据库、文档数据库、图数据、列数据库。With the rapid development of information technology, NoSQL databases have been widely studied in large-scale, distributed data storage and processing. Compared with traditional relational databases, NoSQL databases provide a more adaptable data storage method, are good at processing semi-structured and unstructured data, provide strong support for various data formats and structures, and can effectively adapt to changing data needs. In addition, NoSQL databases are known for their horizontal scalability. They can be expanded to handle large data volumes and high concurrent access scenarios. They have significant properties including enhanced scalability, performance, and availability, making them more suitable for contemporary applications that require fast and efficient data processing. From the perspective of data storage, NoSQL databases can be divided into key-value databases, document databases, graph databases, and column databases.

范围查询作为键值型NoSQL数据库中常见的操作,主要用于检索满足特定条件的数据子集,即在允许搜索属于特定范围的数据的安全范围查询。在键值NoSQL中,假设k表示键,v表示数据库键k对应的值,t表示键k更新对应时间戳,Q表示查询范围Q=[l,r],则查询结果可表示为R={(k,v,t)|l<v<r},即在数据值层面上检索满足范围条件的数据子集。在云键值NoSQL存储范围查询过程中,由于云存储的半可信特性,当用户将数据存储在键值型云数据库时,云服务器可能在动态维护数据时遗弃或者篡改数据。在执行范围查询时,如果查询的数据集不完整、数据版本不新鲜,则会导致查询结果错误。同时由于云查询的半可信特性,云服务器也有可能在查询时返回不完整或篡改的查询结果给查询方。Range query is a common operation in key-value NoSQL databases. It is mainly used to retrieve data subsets that meet specific conditions, that is, a safe range query that allows searching for data belonging to a specific range. In key-value NoSQL, assuming that k represents the key, v represents the value corresponding to the database key k, t represents the corresponding timestamp of the key k update, and Q represents the query range Q = [l, r], then the query result can be expressed as R = {(k, v, t) | l < v < r}, that is, the data subset that meets the range condition is retrieved at the data value level. In the cloud key-value NoSQL storage range query process, due to the semi-trusted characteristics of cloud storage, when users store data in key-value cloud databases, cloud servers may abandon or tamper with data when dynamically maintaining data. When executing a range query, if the queried data set is incomplete and the data version is not fresh, the query result will be wrong. At the same time, due to the semi-trusted characteristics of cloud queries, cloud servers may also return incomplete or tampered query results to the query party during the query.

现有技术提出较多的范围查询验证方案,但存在一些局限。例如,Zhang等人[Zhang C,Xu C,Xu J,Tang Y,and Choi B,"Gem^2-tree:A gas-efficient structurefor authenticated range queries in blockchain,"in 2019IEEE 35th internationalconference on data engineering(ICDE),2019,CCF B:IEEE,pp.842-853]提出的区块链中的范围查询结果完整性验证方案;Xu等人[Xu C,Zhang C,Xu J.vchain:Enablingverifiable boolean range queries over blockchain databases[C]//Proceedings ofthe 2019international conference on management of data.2019:141-158]提出的区块链数据库中布尔范围查询完整性验证方案。Xu等人[Xu Z,Lin Y,Sandor V K A,et al.Alightweight privacy and integrity preserving range query scheme for mobilecloud computing[J].Computers&Security,2019,84:318-333]使用加密的数据索引和向量邻居链(VNC)实现了数据隐私和查询结果完整性验证。Bajaj等人[Bajaj S,ChakrabortiA,and Sion R,"ConcurDB:Concurrent query authentication for outsourceddatabases,"IEEE Transactions on Knowledge and Data Engineering,vol.33,no.4,pp.1401-1412,2019]提出了ConcurDB系统,该系统采用基于签名的范围查询验证方法,将查询执行和验证过程解耦,系统根据元组的属性建立链接,通过验证链接来完成完整性验证,同时利用内存检查来保证链接的正确性和完整性。Yao等人[Yao X,Zhang R,Huang D,and Zhang Y,"Verifiable query processing over outsourced social graph,"IEEE/ACM Transactions on Networking,vol.29,no.5,pp.2313-2326,2021]研究了对外包社交图上可验证查询处理。数据消费者可以验证不受信任的SDP返回的任何查询结果完整性,并提出了三种用于单属性范围查询的方案和另一种用于外包社交数据的多属性范围查询的方案。Yang等人[Yang W,Liu L,Liu Y,et al.Secure and efficient multi-dimensionalrange query algorithm over TMWSNs[J].Ad Hoc Networks,2022,130:102820]提出了一种基于多维桶的算法,该算法以桶为传输单位,以桶中感知数据的范围为索引,通过校验查询结果的完整性来验证查询结果的完整性。然而,这些方案针对键进行查询的方案无法高效执行针对数据值的范围查询验证,且不支持数据新鲜性验证。The existing technologies have proposed many range query verification schemes, but they have some limitations. For example, Zhang et al. [Zhang C, Xu C, Xu J, Tang Y, and Choi B,"Gem^2-tree: A gas-efficient structure for authenticated range queries in blockchain," in 2019IEEE 35th international conference on data engineering (ICDE), 2019, CCF B: IEEE, pp. 842-853] proposed a range query result integrity verification scheme in blockchain; Xu et al. [Xu C, Zhang C, Xu J. vchain: Enabling verifiable boolean range queries over blockchain databases [C] // Proceedings of the 2019 international conference on management of data. 2019: 141-158] proposed a Boolean range query integrity verification scheme in blockchain databases. Xu et al. [Xu Z, Lin Y, Sandor V K A, et al. A lightweight privacy and integrity preserving range query scheme for mobile cloud computing [J]. Computers & Security, 2019, 84: 318-333] used encrypted data indexes and vector neighbor chains (VNC) to achieve data privacy and query result integrity verification. Bajaj et al. [Bajaj S, Chakraborti A, and Sion R, "ConcurDB: Concurrent query authentication for outsourced databases," IEEE Transactions on Knowledge and Data Engineering, vol. 33, no. 4, pp. 1401-1412, 2019] proposed the ConcurDB system, which uses a signature-based range query verification method to decouple query execution and verification processes. The system establishes links based on tuple attributes, completes integrity verification by verifying the links, and uses memory checks to ensure the correctness and integrity of the links. Yao et al. [Yao X, Zhang R, Huang D, and Zhang Y,"Verifiable query processing over outsourced social graph," IEEE/ACM Transactions on Networking, vol. 29, no. 5, pp. 2313-2326, 2021] studied verifiable query processing on outsourced social graphs. Data consumers can verify the integrity of any query results returned by untrusted SDPs, and proposed three schemes for single-attribute range queries and another scheme for multi-attribute range queries on outsourced social data. Yang et al. [Yang W, Liu L, Liu Y, et al. Secure and efficient multi-dimensional range query algorithm over TMWSNs [J]. Ad Hoc Networks, 2022, 130: 102820] proposed an algorithm based on multi-dimensional buckets, which uses buckets as transmission units and the range of perceived data in buckets as indexes to verify the integrity of query results by checking the integrity of query results. However, these schemes that query keys cannot efficiently perform range query verification on data values, and do not support data freshness verification.

尽管已经有一些工作探索了基于范围查询的新鲜性验证方案,但是到目前为止,这些方案仍无法高效地在数据值层面上进行新鲜性验证。例如:Hong等人[Hong J,Wen T,Gu Q,et al.Query integrity verification based-on mac chain in cloud storage[C]//2014IEEE/ACIS13th International Conference on Computer and InformationScience(ICIS).IEEE,2014:125-129]提出了MAC Chain的方案。MAC Chain的表结构为R(A1,…,An,Version,Predecessor,Checksum),每次数据更新,对应的Version值就会加1。Predecessor的值表示上一个数据的主键,Checksum中存储哈希值。数据所有者定期向可信第三方(TTP)发送新鲜性摘要信息,并共享密钥以及来自云端记录的哈希值。可信第三方收到新鲜性摘要信息后,如果TTP中保存的元组版本小于新鲜性摘要对应的版本,TTP就进行更新。查询用户通过对比TTP元组的版本来验证数据的新鲜性。在新鲜性验证后,对结果集进行链式处理,如果结果集从上边界到下边界形成完整的链,那么查询结果是完整的。该方案虽然能在一定程度上验证新鲜性,但是对于多间隔键值数据,范围查询效率非常低。Although some works have explored freshness verification schemes based on range queries, so far, these schemes still cannot efficiently perform freshness verification at the data value level. For example, Hong et al. [Hong J, Wen T, Gu Q, et al. Query integrity verification based-on mac chain in cloud storage [C] // 2014 IEEE / ACIS 13th International Conference on Computer and Information Science (ICIS). IEEE, 2014: 125-129] proposed a MAC Chain scheme. The table structure of MAC Chain is R (A1, ..., An, Version, Predecessor, Checksum). Each time the data is updated, the corresponding Version value will increase by 1. The value of Predecessor represents the primary key of the previous data, and the hash value is stored in Checksum. The data owner periodically sends freshness summary information to the trusted third party (TTP) and shares the key and the hash value recorded from the cloud. After the trusted third party receives the freshness summary information, if the tuple version stored in the TTP is less than the version corresponding to the freshness summary, the TTP will be updated. The query user verifies the freshness of the data by comparing the versions of the TTP tuple. After the freshness is verified, the result set is chained. If the result set forms a complete chain from the upper boundary to the lower boundary, the query result is complete. Although this solution can verify freshness to a certain extent, the range query efficiency is very low for multi-interval key value data.

还有一种部分支持新鲜性验证的方案,但只支持在键层面验证,例如Hu等人[HuY,Yao X,Zhang R,et al.Freshness Authentication for Outsourced Multi-VersionKey-Value Stores[J].IEEE Transactions on Dependable and Secure Computing,2022]提出的方案,在外包场景中,该方案对时间进行切片,在每个切片内构建一个LSK-MHT树。其中叶子节点存储当前更新键的键,值和时间戳,没有更新的节点进行合并,存储键和键上次更新所对应的时间切片。通过对比根签名来验证每个切片的完整性,通过时间切片的索引值来获取当前键的最新数据。查询用户依次根据云服务器返回的数据,通过对比时间戳来验证数据的新鲜性。虽然该方案能验证键值型数据库范围查询的新鲜度,但是其查询验证是针对键查询,虽然可扩展至范围查询,但性能受限。There is also a solution that partially supports freshness verification, but only supports verification at the key level, such as the solution proposed by Hu et al. [HuY, Yao X, Zhang R, et al. Freshness Authentication for Outsourced Multi-Version Key-Value Stores [J]. IEEE Transactions on Dependable and Secure Computing, 2022]. In the outsourcing scenario, this solution slices time and builds an LSK-MHT tree in each slice. The leaf nodes store the key, value and timestamp of the current updated key, and the nodes that have not been updated are merged to store the key and the time slice corresponding to the last update of the key. The integrity of each slice is verified by comparing the root signature, and the latest data of the current key is obtained by the index value of the time slice. The query user verifies the freshness of the data by comparing the timestamp based on the data returned by the cloud server in turn. Although this solution can verify the freshness of range queries of key-value databases, its query verification is for key queries. Although it can be extended to range queries, its performance is limited.

综上,现有技术存在以下缺点:In summary, the prior art has the following disadvantages:

1、对于多间隔键值数据,不支持在值层面执行范围查询验证。1. For multi-interval key-value data, range query validation at the value level is not supported.

2、对于多间隔键值数据,不支持范围查询验证,而是将点查询扩展到范围查询,效率较低,且没有考虑云服务器故意忽略一个时间间隔不执行更新的情况。2. For multi-interval key-value data, range query verification is not supported. Instead, point queries are extended to range queries, which is inefficient and does not consider the situation where the cloud server deliberately ignores a time interval and does not perform updates.

3、现有技术通过记录最新数据所在间隔,或记录版本摘要执行查询结果验证,验证复杂度较高。3. The existing technology verifies the query results by recording the interval where the latest data is located, or recording the version summary, and the verification complexity is relatively high.

发明内容Summary of the invention

为了解决现有技术中存在的上述问题,本发明提供了一种新鲜性保障的键值数据库可验证范围查询方法及系统。本发明要解决的技术问题通过以下技术方案实现:In order to solve the above problems existing in the prior art, the present invention provides a method and system for verifiable range query of a key-value database with freshness guarantee. The technical problem to be solved by the present invention is achieved through the following technical solutions:

第一方面,本发明提供了一种新鲜性保障的键值数据库可验证范围查询方法包括:In a first aspect, the present invention provides a method for verifiable range query of a key-value database with freshness guarantee, comprising:

在上传阶段,数据所有者生成数据,并定期将更新数据及对应的MAC链签名上传至云服务器;所述更新数据包括一个特定键kp,所述特定键kp对应的值记录一个与数据更新时间间隔关联的随机数;In the upload phase, the data owner generates data and regularly uploads the updated data and the corresponding MAC chain signature to the cloud server; the updated data includes a specific key kp, and the value corresponding to the specific key kp records a random number associated with the data update time interval;

在构建阶段,所述云服务器利用链图构建算法和断链合并算法,对所述更新数据作处理以构建链图存储结构;接收查询用户请求查询任一时间间隔数据的查询请求,并响应查询请求查询所述链图存储结构生成验证信息和查询结果,从而构建包含验证信息的验证对象并返回给所述查询用户;In the construction phase, the cloud server processes the updated data using a chain graph construction algorithm and a broken chain merging algorithm to construct a chain graph storage structure; receives a query request from a query user requesting to query data of any time interval, and queries the chain graph storage structure in response to the query request to generate verification information and query results, thereby constructing a verification object containing the verification information and returning it to the query user;

在验证阶段,所述查询用户根据所述云服务器返回的查询结果和验证对象,对所述查询结果包含的查询数据作完整性、新鲜性和正确性验证。In the verification stage, the query user verifies the integrity, freshness and correctness of the query data contained in the query result based on the query result and verification object returned by the cloud server.

第二方面,本发明提供了一种新鲜性保障的键值数据库可验证范围查询系统,包括:In a second aspect, the present invention provides a freshness-guaranteed key-value database verifiable range query system, comprising:

数据所有者,用于在上传阶段生成数据,并定期将更新数据及对应的MAC链签名上传至云服务器;所述更新数据包括一个特定键kp,所述特定键kp对应的值记录一个与数据更新时间间隔关联的随机数;The data owner is used to generate data in the upload phase and regularly upload the updated data and the corresponding MAC chain signature to the cloud server; the updated data includes a specific key kp, and the value corresponding to the specific key kp records a random number associated with the data update time interval;

云服务器,用于在构建阶段,所述云服务器利用链图构建算法和断链合并算法,对所述更新数据作处理以构建链图存储结构;接收查询用户请求查询任一时间间隔数据的查询请求,并响应查询请求查询所述链图存储结构生成验证信息和查询结果,从而构建包含验证信息的验证对象并返回给所述查询用户;A cloud server is used for, during the construction phase, using a chain graph construction algorithm and a broken chain merging algorithm to process the updated data to construct a chain graph storage structure; receiving a query request from a query user to query data of any time interval, and querying the chain graph storage structure in response to the query request to generate verification information and query results, thereby constructing a verification object containing the verification information and returning it to the query user;

查询用户,用于在验证阶段,根据所述云服务器返回的查询结果和验证对象,对所述查询结果包含的查询数据作完整性、新鲜性和正确性验证。The query user is used to verify the integrity, freshness and correctness of the query data contained in the query result according to the query result and verification object returned by the cloud server during the verification phase.

有益效果:Beneficial effects:

1、针对现有技术的第一个缺点,本发明提出了一个新型的链图存储结构,直接在值层面执行范围查询。1. In view of the first shortcoming of the prior art, the present invention proposes a novel chain graph storage structure to directly perform range queries at the value level.

2、针对现有技术的第二个缺点,本发明提出了链图存储结构,并引入一个特定键,高效执行范围查询并防止云不执行更新。2. In response to the second shortcoming of the prior art, the present invention proposes a chain graph storage structure and introduces a specific key to efficiently execute range queries and prevent the cloud from not performing updates.

3、针对现有技术的第三个缺点,本发明提出路径探索方式结合双线性映射累加器来实现验证,降低复杂度。3. In view of the third shortcoming of the prior art, the present invention proposes a path exploration method combined with a bilinear mapping accumulator to implement verification and reduce complexity.

以下将结合附图及实施例对本发明做进一步详细说明。The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明系统模型的示意图;FIG1 is a schematic diagram of a system model of the present invention;

图2是本发明的一种新鲜性保障的键值数据库可验证范围查询方法的流程图;FIG2 is a flow chart of a method for verifiable range query of a key-value database with freshness assurance according to the present invention;

图3是本发明提供的可验证范围查询新鲜性系统流程图;3 is a flow chart of a verifiable range query freshness system provided by the present invention;

图4是本发明提供的链图构建算法实例图;FIG4 is a diagram showing an example of a chain graph construction algorithm provided by the present invention;

图5是本发明提供的断链合并算法实例图;FIG5 is a diagram showing an example of a broken link merging algorithm provided by the present invention;

图6是本发明提供的验证结构实例图。FIG. 6 is a diagram showing an example of a verification structure provided by the present invention.

具体实施方式Detailed ways

下面结合具体实施例对本发明做进一步详细的描述,但本发明的实施方式不限于此。The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

在介绍本发明的查询方法之前,首先对本发明的系统模型、安全模型作简单介绍。Before introducing the query method of the present invention, a brief introduction is first given to the system model and security model of the present invention.

参考图1,图1展示了本发明系统模型,涉及三个主要参与方,分别是数据所有者、云服务器以及查询用户。在系统中,数据所有者按照一定时间间隔切片创建键值数据,并定期将更新的数据以附带数据签名的形式上传云服务器的键值型NoSQL数据库。云服务器负责数据的存储,并代表数据所有者回应查询用户的范围查询,向查询用户发送查询结果及新鲜有效性验证对象。查询用户发起查询,并在接收查询结果和验证对象后,对查询结果基于验证对象进行验证。Referring to FIG1 , FIG1 shows the system model of the present invention, which involves three main participants, namely the data owner, the cloud server, and the query user. In the system, the data owner creates key-value data by slicing at a certain time interval, and regularly uploads the updated data to the key-value NoSQL database of the cloud server in the form of an attached data signature. The cloud server is responsible for the storage of data, and responds to the query user's range query on behalf of the data owner, and sends the query result and freshness validity verification object to the query user. The query user initiates a query, and after receiving the query result and verification object, verifies the query result based on the verification object.

本发明基于如下安全假设,其中数据所有者被视为可信实体,能够忠实的执行数据上传操作;云服务器被视为半可信实体,对数据所有者上传的数据可能恶意篡改、不执行更新并欺骗用户数据所有者无更新,或对用户发起的查询故意返回篡改、伪造或基于过时数据版本的查询结果;查询用户被视为可信实体,能够忠实的执行查询和验证。本发明的目标是设计一种新鲜有效性验证方案,即使在云服务器存在潜在的不信任风险时,范围查询新鲜有效性仍得以有效维护。The present invention is based on the following security assumptions, in which the data owner is regarded as a trusted entity and can faithfully perform data upload operations; the cloud server is regarded as a semi-trusted entity, which may maliciously tamper with the data uploaded by the data owner, fail to perform updates and deceive the user data owner that there is no update, or deliberately return tampered, forged or outdated data version query results to the user-initiated query; the query user is regarded as a trusted entity and can faithfully perform queries and verifications. The goal of the present invention is to design a freshness validity verification scheme, so that the freshness validity of range queries can be effectively maintained even when there is a potential risk of distrust in the cloud server.

下面对本发明所涉及的知识作简单介绍。The knowledge involved in the present invention is briefly introduced below.

1)哈希函数1) Hash function

哈希函数是一种将任意长度的输入转为固定长度的输出的单向函数,通常很难根据哈希值逆向推出原始数据。在密码学,被广泛应用于完整性验证。A hash function is a one-way function that converts an input of any length into an output of a fixed length. It is usually difficult to reverse the original data based on the hash value. In cryptography, it is widely used for integrity verification.

2)消息认证码(MAC)2) Message Authentication Code (MAC)

消息认证码又称为MAC,是一种常用来保护数据通信数据完整性的技术,主要思想是首先对消息内容进行哈希运算产生固定长度的值,然后通过对比MAC来验证消息的完整性,确保消息在传输过程中没有被更改。MAC链是一种链式的保护机制,每个消息都依赖于前一条消息,形成一个链式结构。如果有一条消息被篡改,则MAC链就会失效。Message Authentication Code, also known as MAC, is a technology commonly used to protect the integrity of data communications. The main idea is to first perform a hash operation on the message content to generate a value of fixed length, and then verify the integrity of the message by comparing the MAC to ensure that the message has not been changed during transmission. MAC chain is a chain protection mechanism, where each message depends on the previous message to form a chain structure. If a message is tampered with, the MAC chain will become invalid.

3)q-Strong Diffie-Hellman(q-SDE)3)q-Strong Diffie-Hellman (q-SDE)

为双线性为映射对,对于所有多项式q和所有概率多项式时间敌手Adv,q-SDE满足如下公式make is a bilinear mapping pair, For all polynomials q and all probabilistic polynomial-time adversaries Adv, q-SDE satisfies the following formula

Pr[s;p;(c,h)←Adv(σ):h=e(g,g)1/(c+s)]≈0Pr[s;p;(c,h)←Adv(σ):h=e(g,g) 1/(c+s) ]≈0

4)双线性多集累加器4) Bilinear multi-set accumulator

双线性多集累加器是累加器的推广,可以处理多重集合,而不仅仅是一般集合。多重集与一般集合不同,允许元素出现多次。双线性多集累加器以抗碰撞的形式将多集映射到某个循环乘法群中的元素。累加器可以用来证明集合不相交,主要由以下算法组成:Bilinear multiset accumulators are a generalization of accumulators that can handle multisets, not just general sets. Multisets are different from general sets in that they allow elements to appear multiple times. Bilinear multiset accumulators map multisets to elements in a cyclic multiplicative group in a collision-resistant form. Accumulators can be used to prove that sets are disjoint, and consist mainly of the following algorithms:

KeyGen(1λ)→(sk,pk):输入安全参数1λ,输出私钥sk和公钥pk。KeyGen(1 λ )→(sk, pk): input security parameter 1 λ , output private key sk and public key pk.

Setup(X,pk)→acc(X):输入多集X和公钥pk,计算累积值acc(X)。由于多项式插值的特性,可以在不知道私钥的情况下进行计算。Setup(X, pk) → acc(X): Input the multi-set X and the public key pk, and calculate the cumulative value acc(X). Due to the characteristics of polynomial interpolation, the calculation can be performed without knowing the private key.

ProveDisjoint(X1,X2,pk)→π:输入两个多集X1,X2,其中公钥pk,输出一个证明π。ProveDisjoint(X 1 ,X 2 ,pk)→π: Input two multisets X 1 ,X 2 , where Public key pk, output a proof π.

VerifyDisjoint(acc(X1),acc(X2),π,pk)→{0,1}:输入累积值acc(X1),acc(X2),证明π,公钥pk,当且仅当时,输出1。VerifyDisjoint(acc(X 1 ), acc(X 2 ), π, pk) → {0, 1}: Input cumulative values acc(X 1 ), acc(X 2 ), proof π, public key pk, if and only if , output 1.

下面对本发明所涉及到的符号和缩写作解释。The symbols and abbreviations involved in the present invention are explained below.

表1缩略符号说明Table 1 Description of abbreviations

表2缩略语和关键术语定义Table 2 Abbreviations and definitions of key terms

缩略语Abbreviations 全称Full name 翻译translate MACMAC Message Authentication CodeMessage Authentication Code 消息认证码Message Authentication Code DODO Data OwnerData Owner 数据所有者Data Owner VOVO Verification ObjectVerification Object 验证对象Verify the object ADSADS Authenticated Data StructureAuthenticated Data Structure 验证数据结构Verify data structure CGSSCGSS Chain Graph Storage StructureChain Graph Storage Structure 链图存储结构Chain graph storage structure

下面详细介绍本发明一种新鲜性保障的键值数据库可验证范围查询方法的详细过程。The detailed process of a freshness-guaranteed key-value database verifiable range query method of the present invention is described in detail below.

本发明的一种新鲜性保障的键值数据库可验证范围查询方法分为三个阶段:数据所有者上传数据、云服务器构建链图存储结构CGSS和验证对象VO、查询用户查询及验证。在上传阶段,数据所有者DO定期将更新数据D以及MAC链签名sign(H(D))上传到云服务器。在云服务器构建阶段,涉及两个部分:1.云服务器根据本发明提出的链图构建算法和断链合并算法来构建链图存储结构CGSS。2.查询用户发起范围查询Q,云服务器基于查询生成验证结构ADS和查询结果R,构造一个包含结果验证信息的验证对象VO,VO={sign(H(D)),ADS,π,acc(X)},将VO与结果R一起返回给查询用户。在验证阶段,查询用户根据云服务器返回的结果R以及VO验证数据完整性、新鲜性、正确性。A verifiable range query method for a key-value database with freshness guarantee of the present invention is divided into three stages: data owner uploads data, cloud server builds chain graph storage structure CGSS and verification object VO, and query and verification by querying user. In the upload stage, the data owner DO regularly uploads the updated data D and MAC chain signature sign(H(D)) to the cloud server. In the cloud server construction stage, two parts are involved: 1. The cloud server constructs the chain graph storage structure CGSS according to the chain graph construction algorithm and broken chain merging algorithm proposed in the present invention. 2. The query user initiates a range query Q, and the cloud server generates a verification structure ADS and a query result R based on the query, constructs a verification object VO containing result verification information, VO={sign(H(D)), ADS, π, acc(X)}, and returns VO and the result R to the query user. In the verification stage, the query user verifies the data integrity, freshness, and correctness based on the result R and VO returned by the cloud server.

结合图2和图3,本发明提供了一种新鲜性保障的键值数据库可验证范围查询方法包括:In conjunction with FIG. 2 and FIG. 3 , the present invention provides a key-value database verifiable range query method with freshness assurance, including:

1、在上传阶段,数据所有者生成数据,并定期将更新数据及对应的MAC链签名上传至云服务器;所述更新数据包括一个特定键kp,所述特定键kp对应的值记录一个与数据更新时间间隔关联的随机数;1. In the upload phase, the data owner generates data and regularly uploads the updated data and the corresponding MAC chain signature to the cloud server; the updated data includes a specific key kp, and the value corresponding to the specific key kp records a random number associated with the data update time interval;

1.1、更新数据1.1. Update data

所述数据所有者DO生成数据;若在任一时间间隔的所述数据有所更新,则计算该时间间隔的每个更新数据D的MAC链哈希值H(D);对所述MAC链哈希值H(D)进行签名得到签名sign(H(D)),并将更新数据D和签名sign(H(D))上传至云服务器;其中,所述更新数据包括键值存储和一个引入的特定键kp,所述键值存储由数据记录的组合组成,每个数据记录都包含一个唯一的键k∈K和一个数据值,该数据值在不同时间间隔接收不同版本,每个版本对应一个更新节点,表示为o,o=(k,v,t),所述特定键kp对应的值记录一个与数据更新时间间隔关联的随机数。The data owner DO generates data; if the data is updated at any time interval, the MAC chain hash value H(D) of each updated data D in the time interval is calculated; the MAC chain hash value H(D) is signed to obtain a signature sign(H(D)), and the updated data D and the signature sign(H(D)) are uploaded to the cloud server; wherein the updated data includes a key-value storage and an introduced specific key kp, the key-value storage is composed of a combination of data records, each data record contains a unique key k∈K and a data value, the data value receives different versions at different time intervals, each version corresponds to an update node, represented as o, o=(k, v, t), the value corresponding to the specific key kp records a random number associated with the data update time interval.

每个间隔数据所有者都上传随机数签名来防止云服务器不进行更新,无论是否有有效数据更新,云一旦丢弃数据,只要后续间隔有数据更新一定会被发现。故而,假定键表示为K={1,...,|K|},若在时间间隔1里,所有的数据都进行了更新,则所述更新数据为 k∈{1,...,|K|),在时间间隔i时,若数据所有者对部分键更新,若更新键升序排列为记α=ksi[1]为ksi第一个键值,则更新数据表示为 Each interval data owner uploads a random number signature to prevent the cloud server from not updating. Regardless of whether there is valid data update, once the cloud discards the data, as long as there is data update in the subsequent interval, it will be discovered. Therefore, assuming that the key is represented by K = {1, ..., |K|}, if all data are updated in time interval 1, the updated data is k∈{1,...,|K|), At time interval i, if the data owner updates some keys, if the update keys are sorted in ascending order Let α = ks i [1] be the first key value of ks i , then the updated data is expressed as

1.2、生成MAC链1.2. Generate MAC chain

所述数据所有者DO,依次计算时间间隔i的每个更新节点的哈希值并将哈希值按照键顺序进行链接成MAC链,表示为α=ksi[1];The data owner DO calculates each update node of time interval i in turn Hash value And the hash value Link them into a MAC chain in key order, expressed as α=ks i [1];

对MAC链H(Di)进行签名生成sign(H(Di)),并数据所有者DO将更新数据Di和签名sign(H(Di))上传到所述云服务器。The MAC chain H(D i ) is signed to generate sign(H(D i )), and the data owner DO uploads the updated data D i and the signature sign(H(D i )) to the cloud server.

2、在构建阶段,所述云服务器利用链图构建算法和断链合并算法,对所述更新数据作处理以构建链图存储结构;接收查询用户请求查询任一时间间隔数据的查询请求,并响应查询请求查询所述链图存储结构生成验证信息和查询结果,从而构建包含验证信息的验证对象并返回给所述查询用户;2. In the construction phase, the cloud server processes the updated data using the chain graph construction algorithm and the broken chain merging algorithm to construct a chain graph storage structure; receives a query request from a query user requesting to query data of any time interval, and responds to the query request to query the chain graph storage structure to generate verification information and query results, thereby constructing a verification object containing the verification information and returning it to the query user;

2.1、云服务器构建链图存储结构2.1. Cloud server builds chain graph storage structure

a,云服务器设定链图构建算法的构建规则。a. The cloud server sets the construction rules of the chain graph construction algorithm.

下文介绍本发明的链图构建算法。The chain graph construction algorithm of the present invention is introduced below.

本发明的链图构建算法的构建规则为:除第一个时间间隔的更新数据外,其他每个时间间隔的更新数据均构建由对应键的上一个更新节点指向当前节点的向右指针如果当前节点相邻下一个键节点有更新,则构建向下指针否则构建向左指针令指针集合Pi={pi,1,1,...,pi,i,k},其中,若在时间间隔i删除节点其对应的指针集合pi,j,k=NULL。The construction rule of the chain graph construction algorithm of the present invention is: except for the update data of the first time interval, the update data of each other time interval is constructed by the last update node of the corresponding key Point to the current node Right pointer If the current node Next adjacent key node If there is an update, build a downward pointer Otherwise construct a left pointer Let the pointer set Pi = {pi ,1,1 ,..., pi,i,k }, where, If the node is deleted at time interval i The corresponding pointer set p i,j,k = NULL.

基于上述规则构建算法如算法1所示:The algorithm based on the above rules is shown in Algorithm 1:

b,在时间间隔i内,利用包含所述构建规则的链图构建算法以及上一时间间隔的链图存储结构,递归构建所述时间间隔i内的每个更新节点的对应指针,并组成指针集合;b. In time interval i, recursively construct each updated node in the time interval i using the chain graph construction algorithm containing the construction rule and the chain graph storage structure of the previous time interval The corresponding pointers of and form a pointer set;

云服务器接收到数据所有者本次间隔i上传的数据,在上次构建的链图存储结构CGSSi-1的基础上进行更新,形成本次的链图存储结构CGSSi。该存储结构在i间隔上CGSSi={Bi,Pi},其中Bi为数据节点集合,Pi为链指针集合。Bi由Bi-1经过链图构建算法首先得到B′i=Bi-1∪Di,其次B′i经过断链合并算法,根据该算法选取删除节点集合Si和合并节点集合Mi得到Bi=B′i-Si+Mi,其中删除节点由原本需要删除或合并导致删除的节点组成;Pi由Di和Pi-1经链图构建算法首先得到P′i=Pi-1+DPi,其中DPi为Di的每个节点的指针集合,其次P′i经过断链合并算法,根据该算法选择要断开的链集合CPi得到Pi=P′i/CPiThe cloud server receives the data uploaded by the data owner in this interval i, and updates it based on the chain graph storage structure CGSS i-1 constructed last time to form this chain graph storage structure CGSS i . The storage structure is CGSS i = {B i , Pi } in the i interval, where Bi is the data node set and Pi is the chain pointer set. Bi is first obtained by Bi -1 through the chain graph construction algorithm to obtain B′ i = Bi -1 ∪D i , and then B′ i is subjected to the broken chain merging algorithm. According to the algorithm, the deleted node set S i and the merged node set M i are selected to obtain Bi = B′ i -S i +M i , where the deleted nodes are composed of the nodes that originally need to be deleted or merged to cause deletion; Pi is first obtained by Di and Pi -1 through the chain graph construction algorithm to obtain P′ i = Pi -1 +DP i , where DP i is the pointer set of each node of Di , and then P′ i is subjected to the broken chain merging algorithm. According to the algorithm, the chain set CP i to be disconnected is selected to obtain Pi = P′ i /CP i .

c,利用时间间隔i内的指针集合、所有更新数据以及上一时间间隔的链图存储结构构建时间间隔i内的初步链图存储结构;c. Construct a preliminary chain graph storage structure within time interval i using the pointer set within time interval i, all updated data, and the chain graph storage structure of the previous time interval;

d,利用断链合并算法对所述时间间隔i内的初步链图存储结构作优化得到时间间隔i内的链图存储结构。d. Utilize the broken link merging algorithm to optimize the preliminary chain graph storage structure within the time interval i to obtain the chain graph storage structure within the time interval i.

下面详细介绍本发明的断链合并算法。The broken link merging algorithm of the present invention is described in detail below.

断链合并算法主要以路径探索的方式执行断链,并将同一个键的过期版本数据合并,来减少验证过程中的节点数量,最终输出该间隔链图存储结构CGSSi。断链合并算法主要涉及对B′i集合里的节点删除合并和对P′i集合里面的指针断链。设表示单个节点或多个节点合并后的节点,此时k为键,cti为合并节点在i间隔涉及间隔集合,假设对间隔i′单个节点合并后表示为 存储{k,cti′},此时cti′={i′}。若继续与间隔i节点合并且i>i′,需将间隔i添加至cti中,则合并节点为存储{k,cti},此时cti={i′,i}。删除合并前的节点并将合并节点存储至i间隔。若键k-1指向键k的指针所在间隔为i″,cti最早间隔为i′且键k指向k+1的指针所在间隔为i″′,满足min(i″,i″′)>i′,则cti还需要删除min(i″,i″′)之前的全部间隔。具体断链合并算法如算法2所示:The broken link merging algorithm mainly performs broken links in a path exploration manner and merges the expired version data of the same key to reduce the number of nodes in the verification process, and finally outputs the interval chain graph storage structure CGSS i . The broken link merging algorithm mainly involves deleting and merging nodes in the B′ i set and breaking the pointers in the P′ i set. Assume Indicates a single node or a node after multiple nodes are merged. k is the key, ct i is the merged node in the i interval involving the interval set, assuming that there is a single node in interval i′ After merging, it is expressed as Store {k, ct i′ }, then ct i′ = {i′}. Continue with the interval i node If i>i′ is merged, the interval i needs to be added to ct i , then the merged node is Store {k, ct i }, where ct i = {i′, i}. Delete the node before merging And merge the nodes Store to interval i. If the interval where the pointer of key k-1 points to key k is i″, the earliest interval of ct i is i′ and the interval where the pointer of key k points to k+1 is i″′, and min(i″, i″′)>i′ is satisfied, then ct i also needs to delete all intervals before min(i″, i″′). The specific broken link merging algorithm is shown in Algorithm 2:

云服务器根据上述的链图构建算法以及断链合并算法,对DO发送的更新数据Di递归构建CGSSi。当i=1,k∈K。根据链图构建算法,构建指向的向下指针指向的向下指针此时该间隔数据都为最新数据,无需断链合并,形成链图存储结构CGSS1。当i≠1,假设i间隔部分键更新,更新数据α=ksi[1],本步骤利用断链合并算法对所述时间间隔i内的初步链图存储结构CGSS′i={B′i,P′i),B′i=Bi-1∪Di;P′i=Pi-1+DPi,从第一个键到最后一个键进行路径探索,先探索到每个键的最新数据;再探索到前往下一个键的路径,对于前往下一个键的路上的无关节点进行删除或合并得到时间间隔i内的链图存储结构CGSSi={Bi,Pi},Bi=B′i-Si+Mi;Pi=P′i/CPi;如果在时间间隔i内所有键都进行了更新,则重置该时间间隔i=1。The cloud server recursively constructs CGSS i for the update data Di sent by DO according to the above chain graph construction algorithm and broken chain merging algorithm. When i=1, k∈K. According to the chain graph construction algorithm, construct direction Down pointer direction Down pointer at this time The interval data is the latest data, and there is no need to break the chain and merge, forming a chain graph storage structure CGSS 1. When i≠1, assuming that the i interval part of the key is updated, update the data α=ks i [1], In this step, the broken link merging algorithm is used to perform path exploration from the first key to the last key on the preliminary chain graph storage structure CGSS′ i = {B′ i , P′ i ), B′ i = Bi -1 ∪D i ; P′ i = Pi -1 +DP i within the time interval i, and the latest data of each key is explored first; then the path to the next key is explored, and irrelevant nodes on the way to the next key are deleted or merged to obtain the chain graph storage structure CGSS i = {B i , P i }, B i = B′ i -S i +M i ; P i = P′ i /CP i within the time interval i; if all keys are updated within the time interval i, the time interval i = 1 is reset.

示例性的,给定更新数据如表3所示,数据表有7个键,4个间隔,每个键在不同间隔都对应一个格子,如果格子为空,则表示对应的键在该间隔中没有更新数据。如果有数据,则表示键在间隔里更新的具体值。图4给出了前4个间隔经链图构建算法最终的输出结构图。图5给出了在图4的基础上进行断链合并输出的链图存储结构图。For example, given the updated data as shown in Table 3, the data table has 7 keys and 4 intervals. Each key corresponds to a grid in different intervals. If the grid is empty, it means that the corresponding key has no updated data in the interval. If there is data, it indicates the specific value of the key updated in the interval. Figure 4 shows the final output structure diagram of the chain graph construction algorithm for the first 4 intervals. Figure 5 shows the chain graph storage structure diagram of the broken chain merge output based on Figure 4.

表3.更新数据实例Table 3. Update data example

2.2查询用户生成查询2.2 Query User-Generated Queries

查询用户在间隔i时发起范围查询Qi=[l,r],要求返回所有符合条件的(k,v,t)元组,其中v∈[l,r],且要求查询后的结果有效且新鲜。令X1={l,l+1,...,r),定义了一个双线性对,其中为具有相同素数阶p的两个循环乘法群,e为单位元,g为生成元,随机选择属于整数环的数a作为私钥s,则公钥为查询用户计算 并将p(X1),pk和查询间隔i发送给云服务器。The query user initiates a range query Qi = [l, r] at interval i, requiring the return of all (k, v, t) tuples that meet the conditions, where v∈[l, r], and the query results are required to be valid and fresh. Let X1 = {l, l+1, ..., r), A bilinear pairing is defined where and are two cyclic multiplicative groups with the same prime order p, e is the identity element, g is the generator, and a random number belonging to the integer ring is selected The number a is used as the private key s, then the public key is Query user calculation And send p(X 1 ), pk and query interval i to the cloud server.

2.3云服务器构建验证对象VO2.3 Cloud Server Builds Verification Object VO

所述服务器,接收查询用户在时间间隔i时发起的查询请求Qi=[l,r],所述范围查询请求要求返回所有符合条件的(k,v,t)元组,以及p(X1),pk和查询的时间间隔i;利用所述p(X1),pk和查询的时间间隔i构建验证结构ADSi,并生成验证对象VOi和查询结果集RiThe server receives a query request Qi = [l, r] initiated by a query user at a time interval i, wherein the range query request requires the return of all (k, v, t) tuples that meet the conditions, as well as p( X1 ), pk and the query time interval i; constructs a verification structure ADSi using the p( X1 ), pk and the query time interval i, and generates a verification object VOi and a query result set Ri .

2.3.1构建ADS2.3.1 Building ADS

在链图存储结CGSSi={Bi,Pi}的基础上,其中Pi={pi,1,1,...,pi,i,k},将CGSSi={Bi,Pi)中的每个键最新值映射到整数环通过累加器单独判断每个节点是否在范围里,并将所有不在范围内的最新节点里的值加入集合X2On the basis of the chain graph storage structure CGSS i = {B i , Pi }, where Pi = {pi , 1, 1 , ..., pi, i, k }, the latest value of each key in CGSS i = {B i , Pi } is mapped to an integer ring The accumulator determines whether each node is in range and adds all the latest nodes that are not in range. inner The value is added to the set X 2 ;

将集合X2映射到整数环中,并计算p(X1)和p(X2)的累积值 如果当前节点和相邻节点值不在范围里,则进行合并,将合并后的节点存放至合并前涉及的第一个键的k-1位置得到验证结构ADSi;如果相邻键存在单个合并的节点,则进行列向合并得到验证结构ADSi;其中,除最后一个节点对应的向下节点不删除外,其余涉及的节点均删除,存储{{k-1,k),i);将在范围内最新的节点组成查询结果集RiMap the set X2 to the ring of integers and calculate the cumulative values of p(X 1 ) and p(X 2 ) If the current node and adjacent nodes of If the value is not in the range, it will be merged and the merged node Store it in the k-1 position of the first key involved before merging to obtain the verification structure ADS i ; if there is a single merged node for the adjacent keys, perform column-wise merging to obtain the verification structure ADS i ; except for the last node Except for the corresponding downward nodes, all other nodes involved are deleted. Store {{k-1, k), i); the latest node in the range The query result set R i is formed.

接表3的示例,若间隔为3时,查询用户查询范围[5,7],则验证结构ADS3如图6所示。Continuing with the example in Table 3, if the interval is 3, and the query user query range is [5, 7], then the verification structure ADS 3 is as shown in FIG6 .

2.3.2构建VO2.3.2 Constructing VO

结合上述验证结构ADS,构造验证对象VO。根据p(X1)和p(X2)计算出Q1,Q2和不在范围内证明将MAC哈希签名sign(H(Di)),验证结构ADSi,链图存储结构CGSSi中的新鲜节点的累加值acC(X2),以及不在范围内证明πi组成验证对象VOi={sign(H(Di)),ADSi,πi,acc(X2)}。Combined with the above verification structure ADS, the verification object VO is constructed. According to p(X 1 ) and p(X 2 ), Q 1 , Q 2 and the proof that they are not in the range are calculated. Sign the MAC hash sign (H (D i )), verify the structure ADS i , and store the fresh node in the chain graph structure CGSS i The accumulated value acC(X 2 ) and the out-of-range proof π i constitute the verification object VO i ={sign(H(D i )), ADS i , π i , acc(X 2 )}.

3、在验证阶段,所述查询用户根据所述云服务器返回的查询结果和验证对象,对所述查询结果包含的查询数据做完整性、新鲜性和正确性验证。3. In the verification phase, the query user verifies the integrity, freshness and correctness of the query data contained in the query result based on the query result and verification object returned by the cloud server.

所述查询用户,接收所述云服务器返回的查询结果集Ri和验证对象VOi={sign(H(Di)),ADSi,πi,acc(X2)};The query user receives the query result set R i and the verification object VO i ={sign(H(D i )), ADS i , π i , acc(X 2 )} returned by the cloud server;

所述查询用户,计算所述验证结构ADSi中时间间隔i的数据ADi的签名sign(H(ADi)),并对比sign(H(ADi))和sign(H(Di))是否相等,如果相等,则表示所述查询数据完整;The querying user calculates the signature sign(H(AD i )) of the data AD i in the time interval i in the verification structure ADS i , and compares whether sign(H(AD i )) and sign(H(D i )) are equal. If they are equal, it indicates that the query data is complete;

值得说明的是:由于链图验证结构横向合并的数据都在最新数据的左边,即使数据遭到了篡改,对最新的数据都不存在影响。因此在本发明中,横向合并的数据不参与完整性验证,只要证明每个键的最新数据没有遭到丢弃和篡改即可。由于数据所有者每个间隔都上传一个签名的随机数rand_value(i),云服务器一旦丢弃该间隔数据而不进行更新,只要后续间隔有数据更新一定会被检测出来。令ADi为ADSi里每个间隔i的数据,查询用户通过计算sign(H(ADi)),对比sign(H(ADi))和sign(H(Di))是否相等来验证完整性,相等则证明数据完整。It is worth noting that: since the data merged horizontally in the chain graph verification structure are all on the left side of the latest data, even if the data is tampered with, it will not affect the latest data. Therefore, in the present invention, the horizontally merged data does not participate in the integrity verification, as long as it proves that the latest data of each key has not been discarded or tampered with. Since the data owner uploads a signed random number rand_value(i) for each interval, once the cloud server discards the interval data without updating it, it will be detected as long as there is data update in the subsequent interval. Let AD i be the data of each interval i in ADS i . The query user verifies the integrity by calculating sign(H(AD i )) and comparing whether sign(H(AD i )) and sign(H(D i )) are equal. If they are equal, the data is complete.

所述查询用户,如果对比所述查询结果集Ri里的每个节点和ADSi对应节点的时间戳是否相等,如果一致,则表示所述查询数据是新鲜数据;The query user, if comparing each node in the query result set Ri Corresponding node to ADS i Timestamp and Are they equal? If they are equal, it means that the query data is fresh data;

值得说明的是:对于新鲜性。查询用户结合路径探索方式构建的ADSi验证每个键的最新数据都被保留。在验证ADSi完整性和正确性的基础上,此时ADSi中的每个更新节点均是真实来自数据所有者上传的未经篡改的最新鲜数据。查询用户对比结果集Ri里的每个节点和ADSi对应节点的时间戳是否相等。如果一致,则说明云返回的查询结果是基于新鲜数据。It is worth noting that for freshness, the query user combines the path exploration method to build ADS i to verify that the latest data of each key is retained. On the basis of verifying the integrity and correctness of ADS i , at this time, each updated node in ADS i All are the latest data uploaded by the data owner without tampering. Query the user to compare each node in the result set R i Corresponding node to ADS i Timestamp and Are they equal? If they are, it means that the query results returned by the cloud are based on fresh data.

所述查询用户,对比所述查询结果集Ri的每个节点和ADSi,判断是否属于在所述查询范围内,对于不在范围内的新鲜数据,云服务器给出证明 The query user compares each node of the query result set R i and ADS i , judge Whether it is within the query scope, the cloud server will provide proof for fresh data that is not within the scope

所述查询用户利用πi和acc(X2)验证与e(g,g)是否相等,如果相等,说明数据确实不在查询范围之内;如果数据不相等,则确认所述云服务器篡改了数据。The querying user verifies using π i and acc(X 2 ) Are they equal to e(g, g)? If they are equal, it means that the data is indeed not within the query range; if the data are not equal, it is confirmed that the cloud server has tampered with the data.

值得说明的是:对于正确性。查询用户通过对比返回的结果集Ri的每个节点和ADSi,可判断是否属于查询范围。对于不在范围内的新鲜数据,云服务器给出证明利用πi和acc(X2),查询用户验证如果相等,说明数据确实不在查询范围之内。如果数据不相等,那么查询用户就会发现云服务器篡改了数据。It is worth noting that for correctness, the query user compares each node of the returned result set R i and ADS i , it can be determined Whether it is within the query scope. For fresh data that is not within the scope, the cloud server will provide a certificate Using π i and acc(X 2 ), query user authentication If they are equal, it means that the data is indeed not within the query range. If the data is not equal, the querying user will find that the cloud server has tampered with the data.

如果上述验证全部通过,则证明查询结果新鲜且有效。If all the above verifications pass, it proves that the query results are fresh and valid.

第二方面,本发明提供了一种新鲜性保障的键值数据库可验证范围查询系统包括:In a second aspect, the present invention provides a key-value database verifiable range query system with freshness guarantee, comprising:

数据所有者,用于在上传阶段生成数据,并定期将更新数据及对应的MAC链签名上传至云服务器;所述更新数据包括一个特定键kp,所述特定键kp对应的值记录一个与数据更新时间间隔关联的随机数;The data owner is used to generate data in the upload phase and regularly upload the updated data and the corresponding MAC chain signature to the cloud server; the updated data includes a specific key kp, and the value corresponding to the specific key kp records a random number associated with the data update time interval;

云服务器,用于在构建阶段,所述云服务器利用链图构建算法和断链合并算法,对所述更新数据作处理以构建链图存储结构;接收查询用户请求查询任一时间间隔数据的查询请求,并响应查询请求查询所述链图存储结构生成验证信息和查询结果,从而构建包含验证信息的验证对象并返回给所述查询用户;A cloud server is used for, during the construction phase, using a chain graph construction algorithm and a broken chain merging algorithm to process the updated data to construct a chain graph storage structure; receiving a query request from a query user to query data of any time interval, and querying the chain graph storage structure in response to the query request to generate verification information and query results, thereby constructing a verification object containing the verification information and returning it to the query user;

查询用户,用于在验证阶段,根据所述云服务器返回的查询结果和验证对象,对所述查询结果包含的查询数据作完整性、新鲜性和正确性验证。The query user is used to verify the integrity, freshness and correctness of the query data contained in the query result according to the query result and verification object returned by the cloud server during the verification phase.

本发明的系统实施方式与方法实施方式的具体细节相同,此处不再一一赘述。The specific details of the system implementation and method implementation of the present invention are the same and will not be repeated here.

本发明提供了一种新鲜性保障的键值数据库可验证范围查询方法及系统,通过在数据所有者上传的更新数据内引入特定键,并将特定键与MAC链结构结合,保证范围查询数据存储的完整性。云服务器,利用链图构建算法和断链合并算法生成链图存储结构,确保数据各时刻的新鲜性。查询用户基于双线性多集累加器的有效性验证方案对云服务器反馈的结果作验证,实现范围查询结果的正确性验证,并且基于断链合并算法的存储验证方案,实现查询结果的高效新鲜有效性验证。因此本发明在云服务器存在潜在的不信任风险时,范围查询新鲜有效性仍得以有效维护。The present invention provides a method and system for verifiable range query of a key-value database with freshness guarantee, which introduces a specific key into the updated data uploaded by the data owner and combines the specific key with the MAC chain structure to ensure the integrity of the range query data storage. The cloud server generates a chain graph storage structure using a chain graph construction algorithm and a broken chain merging algorithm to ensure the freshness of the data at all times. The query user verifies the results fed back by the cloud server based on the validity verification scheme of the bilinear multi-set accumulator to realize the correctness verification of the range query results, and realizes the efficient freshness validity verification of the query results based on the storage verification scheme of the broken chain merging algorithm. Therefore, when there is a potential risk of distrust in the cloud server, the freshness validity of the range query can still be effectively maintained.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality of components or steps.

以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所述技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field of the present invention, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.

Claims (10)

1. The key value database verifiable range query method for ensuring freshness is characterized by comprising the following steps of:
In the uploading stage, a data owner generates data and periodically uploads updated data and a corresponding MAC chain signature to a cloud server; the updating data comprises a specific key kp, wherein a value corresponding to the specific key kp records a random number associated with a data updating time interval;
In the construction stage, the cloud server processes the updated data by using a chain map construction algorithm and a broken chain merging algorithm to construct a chain map storage structure; receiving a query request of a query user for querying any time interval data, querying the chain map storage structure in response to the query request to generate verification information and a query result, thereby constructing a verification object containing the verification information and returning the verification object to the query user;
In the verification stage, the query user verifies the integrity, freshness and correctness of the query data contained in the query result according to the query result and the verification object returned by the cloud server.
2. The freshness guarantee key database verifiable range query method of claim 1, wherein the uploading stage, the data owner uploading the update data and the corresponding chain signature to the cloud server periodically, comprises:
the data owner DO generates data;
if the data in any time interval is updated, calculating a MAC chain hash value H (D) of each updated data D in the time interval;
Signing the MAC chain hash value H (D) to obtain a signature sign (H (D)), and uploading updated data D and the signature sign (H (D)) to a cloud server;
Wherein the update data comprises a key value store and an introduced specific key kp, the key value store is composed of a combination of data records, each data record comprises a unique key K epsilon K and a data value, the data value receives different versions at different time intervals, each version corresponds to an update node and is expressed as o, o= (K, v, t), and the value corresponding to the specific key kp records a random number associated with the data update time interval.
3. The freshness protection key database verifiable range query method as claimed in claim 2, wherein if all data is updated in time interval 1, the updated data isk∈{1,…,|K|},At time interval i, if the data owner updates part of the keys, the updated keys are arranged in ascending orderLet α=ks i [1] be the first key of ks i, then the update data is expressed as
4. The freshness guarantee key value database verifiable range query method of claim 3, wherein signing the MAC chain hash value H (D) to obtain a signature sign (H (D)), and uploading the update data D and the signature sign (H (D)) to a cloud server comprises:
The data owner DO calculates each update node of the time interval i in turn Hash value of (a)And hash the valueLinking into MAC chains in key order, denoted asα=ksi[1];
The MAC chain H (D i) is signed to generate sign (H (D i)), and the data owner DO uploads the update data D i and the signed sign (H (D i)) to the cloud server.
5. The freshness assured key database verifiable range query method of claim 3, wherein, at the build stage, said cloud server processing said update data to build a chain map storage structure using a chain map build algorithm and a broken-chain merge algorithm comprises:
in the construction stage, the cloud server is configured to:
setting a construction rule of a chain diagram construction algorithm; the construction rule is as follows:
the update data of each time interval except the update data of the first time interval constructs the last update node of the corresponding key Pointing to the current nodeRight pointer of (2)If the current nodeAdjacent next key nodeWith updates, then the down pointer is constructedOtherwise construct left pointerLet the set of pointers P i={pi,1,1,…,pi,i,k, wherein,If node is deleted in time interval iIts corresponding pointer set p i,j,k = NULL;
Within a time interval i, recursively constructing each updated node within the time interval i by using a chain graph construction algorithm containing the construction rule and a chain graph storage structure of the previous time interval Corresponding pointers of the corresponding pointers, and forming a pointer set;
constructing a preliminary chain diagram storage structure in the time interval i by utilizing the pointer set in the time interval i, all updated data and the chain diagram storage structure of the previous time interval;
And optimizing the preliminary chain map storage structure in the time interval i by using a chain breaking merging algorithm to obtain the chain map storage structure in the time interval i.
6. The method for querying a verifiable range of a freshness ensured key-value database according to claim 5, wherein optimizing the preliminary chain-map storage structure in the time interval i by using a broken-chain merging algorithm to obtain the chain-map storage structure in the time interval i comprises:
The method comprises the steps of utilizing a broken-link merging algorithm to search a path of a preliminary chain diagram storage structure CGSS′i={B′i,P′i},B′i=Bi-1∪Di;P′i=Pi-1+DPi, from a first key to a last key in a time interval i, and searching the latest data of each key; the path to the next key is explored again, and irrelevant nodes on the path to the next key are deleted or merged to obtain a chain map storage structure CGSSi={Bi,Pi},Bi=B′i-Si+Mi;Pi=P′i/CPi; in a time interval i, and if all keys are updated in the time interval i, the time interval i=1 is reset.
7. The method for querying a verifiable range of a key-value database for ensuring freshness according to claim 6, wherein the steps of receiving a query request for querying data at any time interval from a querying user, querying the chain map storage structure in response to the query request to generate verification information and a query result, thereby constructing a verification object containing the verification information, and returning the verification object to the querying user comprise:
The server receives a query request Q i = [ l, r ] initiated by a query user at a time interval i, wherein the range query request requires to return all qualified (k, v, t) tuples, p (X 1), pk and the time interval i of the query;
Wherein v is [ l, r ], X1={l,l+1,…,r},Defining a bilinear pair, whereinAndFor two cyclic multiplication groups with the same prime order p, e is a unit element, g is a generator element, and the two cyclic multiplication groups are randomly selected to belong to an integer ringThe public key is the private key s
Using the p (X 1), pk and the time interval i of the query, a verification structure ADS i is constructed, and a verification object VO i and a query result set R i are generated.
8. The freshness ensured key database verifiable range query method of claim 7, wherein constructing a verification structure ADS i using p (X 1), pk and a time interval i of the query, and generating a verification object VO i and a query result set R i comprises:
mapping each key up-to-date value in GCSS i={Bi,Pi to an integer ring Determining whether each node is in range by accumulator and updating all nodes not in rangeLining of the bagThe value is added to the set X 2;
Mapping set X 2 to integer rings And calculates the cumulative value of p (X 1) and p (X 2) If the current nodeAnd adjacent nodeA kind of electronic deviceIf the value is not in the range, merging, and merging the merged nodesThe k-1 position of the first key involved before merging is stored to obtain a verification structure ADS i; if a single combined node exists in the adjacent keys, performing column-direction combination to obtain a verification structure ADS i;
Wherein the last node is divided Except that the corresponding down node is not deleted, the remaining involved nodes are deleted,Storing { { k-1, k }, i };
Nodes that will be up-to-date in range Forming a query result set R i;
Calculation of Q 1,Q2 from p (X 1) and p (X 2) and proof of being out of range
The MAC hash is signed (H (D i)), structure ADS i is validated, and fresh nodes in the chain graph storage structure CGSS i Is (X 2) and does not prove within range that pi i constitutes the verification object VO i={sign(H(Di)),ADSii,acc(X2).
9. The method for querying a verifiable range of a key-value database for ensuring freshness according to claim 8, wherein in a verification stage, the querying user verifies the integrity, freshness and correctness of the query data contained in the query result according to the query result and the verification object returned by the cloud server, wherein the verification stage comprises:
The query user receives a query result set R i and a verification object VO i={sign(H(Di)),ADSi, πi,acc(X2) returned by the cloud server;
The inquiring user calculates signature sign (H (AD i)) of data AD i of a time interval i in the verification structure ADS i, compares whether sign (H (AD i)) and sign (H (D i)) are equal, and if so, indicates that the inquiring data are complete;
The querying user, if comparing each node in the query result set R i Node corresponding to ADS i Time stamp of (a)AndWhether the query data are equal, if so, indicating that the query data are fresh data;
The query user compares each node of the query result set R i And ADS i, judgeWhether it is within the query range, the cloud server gives a proof of fresh data that is not within the range
The querying user verifies with pi i and acc (X 2)If equal to e (g, g), the description data is not in the query range; and if the data are not equal, confirming that the cloud server tampers the data.
10. A freshness-assured key-value database verifiable range query system, comprising:
The data owner is used for generating data in the uploading stage and uploading the updated data and the corresponding MAC chain signature to the cloud server at regular intervals; the updating data comprises a specific key kp, wherein a value corresponding to the specific key kp records a random number associated with a data updating time interval;
the cloud server is used for processing the updated data by utilizing a chain diagram construction algorithm and a broken chain merging algorithm in a construction stage so as to construct a chain diagram storage structure; receiving a query request of a query user for querying any time interval data, querying the chain map storage structure in response to the query request to generate verification information and a query result, thereby constructing a verification object containing the verification information and returning the verification object to the query user;
and the query user is used for verifying the integrity, freshness and correctness of the query data contained in the query result according to the query result and the verification object returned by the cloud server in the verification stage.
CN202410416587.8A 2024-04-08 2024-04-08 Key value database verifiable range query method and system for freshness guarantee Pending CN118312996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410416587.8A CN118312996A (en) 2024-04-08 2024-04-08 Key value database verifiable range query method and system for freshness guarantee

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410416587.8A CN118312996A (en) 2024-04-08 2024-04-08 Key value database verifiable range query method and system for freshness guarantee

Publications (1)

Publication Number Publication Date
CN118312996A true CN118312996A (en) 2024-07-09

Family

ID=91720267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410416587.8A Pending CN118312996A (en) 2024-04-08 2024-04-08 Key value database verifiable range query method and system for freshness guarantee

Country Status (1)

Country Link
CN (1) CN118312996A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119202098A (en) * 2024-11-29 2024-12-27 西安电子科技大学 Cloud distributed data query method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119202098A (en) * 2024-11-29 2024-12-27 西安电子科技大学 Cloud distributed data query method and system

Similar Documents

Publication Publication Date Title
CN110474986B (en) A consensus method, device and system based on blockchain system
US11283616B2 (en) Method for index-based and integrity-assured search in a blockchain
US9098725B2 (en) Cryptographic accumulators for authenticated hash tables
US8572385B2 (en) System and method for optimal verification of operations on dynamic sets
Wang et al. Enabling public verifiability and data dynamics for storage security in cloud computing
Wang et al. Enabling public auditability and data dynamics for storage security in cloud computing
US7257711B2 (en) Efficient authenticated dictionaries with skip lists and commutative hashing
Esiner et al. Flexdpdp: Flexlist-based optimized dynamic provable data possession
CN114915404A (en) Block chain data storage extension model construction method for Internet of things
CN108197499B (en) Verifiable ciphertext data range query method
CN111898164A (en) A Data Integrity Audit Method Supporting Tag Blockchain Storage and Query
CN114710357B (en) A Dynamically Searchable Encryption Method Supporting Block Verification in Editable Blockchain
CN106991148B (en) A database verification system and method supporting full update operation
Tas et al. Vector commitments with efficient updates
CN116910173B (en) A verifiable and efficient query method for blockchain
CN118312996A (en) Key value database verifiable range query method and system for freshness guarantee
CN115328875A (en) A data authentication method and system
CN116028947A (en) Verifiable query index and device based on encryption key words
Patgiri et al. Hex-bloom: An efficient method for authenticity and integrity verification in privacy-preserving computing
Tang et al. Reputation audit in multi-cloud storage through integrity verification and data dynamics
CN112671712B (en) A cloud data integrity verification method and system supporting efficient dynamic update
Chen et al. Ensuring dynamic data integrity with public auditability for cloud storage
Li et al. Authenticated Keyword Search on Large-Scale Graphs in Hybrid-Storage Blockchains
CN117194418A (en) Verifiable multi-mode space-time data index structure and space-time range query verification method
Zhang et al. Achieving public verifiability and data dynamics for cloud data in the standard model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination