WO2025227641A1 - 基于元组信息增益的数据查询服务交易处理方法及装置 - Google Patents
基于元组信息增益的数据查询服务交易处理方法及装置Info
- Publication number
- WO2025227641A1 WO2025227641A1 PCT/CN2024/129247 CN2024129247W WO2025227641A1 WO 2025227641 A1 WO2025227641 A1 WO 2025227641A1 CN 2024129247 W CN2024129247 W CN 2024129247W WO 2025227641 A1 WO2025227641 A1 WO 2025227641A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- sub
- query
- information gain
- data
- price
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9532—Query formulation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
Definitions
- This application relates to the field of big data processing technology, and in particular to a data query service transaction processing method and apparatus based on tuple information gain.
- Arbitrage refers to the phenomenon where data consumers can infer the result of a high-priced query Q by purchasing multiple inexpensive queries Q1 , Q2 , ..., Q1 .
- the purpose of this application is to provide a data query service transaction processing method and apparatus based on tuple information gain, so as to solve the problems of low computational efficiency and poor interpretability in related technologies.
- a data query service transaction processing method based on tuple information gain including:
- Each support set Si contains the set of possible values for the tuples in the corresponding relation table Ri .
- the set Si is stored in the database server where D resides;
- E ⁇ sub>t ⁇ /sub> represents the set of possible values for each tuple t
- ) represents the uncertainty eliminated by t under Q, i.e., the information gain of tuple t.
- a query Q For a query Q input by a data consumer on multiple tables R1 , R2 , ..., Rk , rewrite query Q as Q', and construct auxiliary queries Q1 , Q2 , ..., Qk on support sets S1 , S2 , ..., Sk based on Q'.
- a data query service transaction processing apparatus based on tuple information gain comprising:
- the support set construction module is used to construct a support set Si for each relation table Ri in database D according to the support set size
- Each support set Si contains the set of possible values of the tuples in the corresponding relation table Ri .
- Each support set Si is stored in the database server where D is located.
- the single-table query processing module is used to replace the table name Ri in the single-table query Q input by the data consumer with Si , obtain the auxiliary query Q' on the support set Si , execute queries Q and Q' in the database server, and obtain query results O and O'.
- the single-table query transaction module is used to calculate the information gain (
- the gain-price function sets the price of query Q for trading, where E ⁇ sub>t ⁇ /sub> represents the set of possible values for each tuple t, and (
- the multi-table query processing module is used to rewrite the query Q input by the data consumer on multiple tables R1 , R2 , ..., Rk as Q', and construct auxiliary queries Q1 , Q2 , ..., Qk on the support set S1 , S2 , ..., Sk based on Q'.
- the query Q', Q1 , Q2 , ..., Qk is executed in the database server to obtain the query results W, W1 , W2 , ..., Wk .
- the multi-table query transaction module is used to calculate the information gain (
- an electronic device comprising:
- One or more processors are One or more processors;
- Memory used to store one or more programs
- the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in the first aspect.
- a computer-readable storage medium that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in the first aspect.
- this invention provides data sellers with an efficient and arbitrage-free data query transaction processing method.
- a support set is constructed for each relation table in the database, with the size specified by the data seller.
- an auxiliary query is constructed for a single-table query input by the data consumer.
- the information gain of all tuples in the corresponding table is calculated based on the original query results and the auxiliary query results.
- the query price is then published based on the overall information gain and a price function.
- the original query is rewritten, and an auxiliary query is constructed for each table.
- the original query results and auxiliary query results are extracted and deduplicated.
- the information gain of all tuples in each table is then calculated.
- the query price is set based on the overall information gain and a price function.
- Figure 1 illustrates a data query service transaction based on tuple information gain provided in an embodiment of the present invention.
- Figure 2 is a database example diagram provided in an embodiment of the present invention.
- Figure 3 is an example diagram of the support set provided in an embodiment of the present invention.
- Figure 4 is an example of a single-table query result provided in an embodiment of the present invention.
- Figure 5 is an example of the multi-table query results provided in an embodiment of the present invention.
- Figure 6 is an example diagram of the query processing results provided in an embodiment of the present invention.
- Figure 7 is a comparison of transaction price and running time in the transaction processing method provided in this embodiment of the invention on the MoveLens movie rating dataset.
- Figure 8 is a block diagram of a data query transaction processing device based on tuple information gain provided in an embodiment of the present invention.
- This invention provides a data query service transaction processing method based on tuple information gain, applicable to online transaction scenarios where queries input by data consumers are priced.
- each data consumer queries data according to their individual needs. For example, a data analyst might be interested in movies (i.e., tuples) from 1900 onwards in a movie rating dataset (as shown in Figure 2), selecting information from these movies for querying and analysis.
- Data query transaction processing requires online pricing for such queries; the method of this invention will be described in detail below with reference to this scenario.
- the method may include the following steps:
- Each support set Si contains the set of possible values of the tuples in the corresponding relation table Ri .
- S3 Calculate the information gain (
- E ⁇ sub> t ⁇ /sub> represents the set of possible values for each tuple t
- ) represents the uncertainty eliminated by t under Q, i.e., the information gain of tuple t.
- v ⁇ S i and Q(v) v t ⁇ , and
- ) can be obtained by traversing O' and counting the frequency of v t .
- the data seller can choose an information gain-price function to transform the information gain into a query price.
- This function needs to satisfy monotonically increasing and subadditivity within the range of positive integers to ensure the arbitrage-free nature of the query price. Substituting this total information gain into the information gain-price function chosen by the data seller yields the price of query Q, and the transaction is then conducted at this price.
- the query result W (or Wi ) includes multiple rows and columns of data. Each column in W (or Wi ) is checked in turn. If the column belongs to the relation table Ri , the column is kept; otherwise, the column is removed, resulting in the result W' (or W′ i ) of W (or Wi ) in Ri .
- query Q' (or Qi ) is a multi-table query
- the extracted query result W' (or W′ i ) may contain duplicate data.
- the transaction processing method of this invention was implemented on an Ubuntu 18.04 system on a server with 192GB of memory and an Intel core 2.80GHz.
- the performance of the transaction processing of this embodiment on the MovieLens dataset was tested under different selectivity (i.e., the ratio of the size of the query result set to the size of the data table).
- ARIA data query transaction processing method
- this application also provides embodiments of the data query service transaction processing apparatus based on tuple information gain.
- the data query service transaction processing apparatus based on tuple information gain includes:
- Support set construction module 1 is used to construct a support set Si for each relation table Ri in database D according to the support set size
- Each support set Si contains the set of possible values of the tuples in the corresponding relation table Ri .
- Each support set Si is stored in the database server where D is located.
- the single-table query processing module 2 is used to replace the table name Ri in the single-table query Q input by the data consumer with Si , obtain the auxiliary query Q' on the support set Si , execute the queries Q and Q' in the database server, and obtain the query results O and O'.
- the single-table query transaction module 3 is used to calculate the information gain (
- E ⁇ sub> t ⁇ /sub> represents the set of possible values of each tuple t
- ) represents the uncertainty eliminated by t under Q, that is, the information gain of tuple t.
- Multi-table query processing module 4 is used to process queries input from multiple tables R1 , R2 , ..., Rk by the data consumer.
- Q is rewritten as Q', and auxiliary queries Q1 , Q2 , ..., Qk are constructed on the support set S1 , S2 , ..., Sk based on Q'.
- the queries Q', Q1 , Q2 , ... , Qk are executed in the database server to obtain the query results W, W1 , W2 , ..., Wk .
- the data W' and W′i of the query results W and Wi on Ri are extracted, and the results are deduplicated to obtain Oi and O′i .
- the multi-table query transaction module 5 is used to calculate the information gain (
- ) of each tuple t in Ri under Q based on each set of results O i and O′ i , accumulate the information gains of all tuples in Ri , obtain the price of query Q on Ri according to the information gain-price function selected by the data seller, and accumulate the prices on all relation tables Ri (i 1,...,k) to obtain the price of query Q for transaction.
- the relevant parts can be referred to in the description of the method embodiments.
- the device embodiments described above are merely illustrative.
- the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
- this application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the data query transaction processing method based on tuple information gain as described above.
- this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the data query transaction processing method based on tuple information gain as described above.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种基于元组信息增益的数据查询服务交易处理方法及装置,根据数据卖家指定集合大小为数据库中的每个关系表构建支撑集,对于数据消费者输入的单表查询,构建一个辅助查询,根据原始查询结果和辅助查询结果计算该查询在对应表上所有元组的信息增益,并根据总体信息增益和价格函数发布查询价格;对于数据消费者输入的多表查询,改写原始查询,并为每个表构建一个辅助查询,对原始查询结果和辅助查询结果进行抽取和去重,进而计算多表查询在每个表上所有元组的信息增益,最后根据总体信息增益和价格函数设置查询价格。
Description
本申请涉及大数据处理技术领域,尤其涉及一种基于元组信息增益的数据查询服务交易处理方法及装置。
随着物联网设备、5G通信技术和互联网技术的普及与发展,数据及其应用产生了巨大的价值。有关大数据的交互、整合、交换需求日益增多,大数据交易应运而生。不同组织与个人具有不同的数据分析与交易需求,如何在满足多种数据需求的同时,实现高效且有效的数据交易,是当前数据交易平台落地面临的一大挑战。基于查询的数据交易模式具有广泛应用场景,允许预算有限的数据消费者通过查询表达数据需求,购买所需数据,避免购买整个数据集的高昂代价。由于查询形式多样且复杂,简单的查询定价交易过程将带来套利问题。
套利(Arbitrage)是指数据消费者可以通过购买多个价格低廉的查询Q1,Q2,…,Ql以推断一个高价查询Q的结果。例如,查询Q为选择年龄大于20岁的用户的年龄和性别数据,即Q=“select age,gender from User where age>20”,而通过查询Q1=“select age from User where age>20”和Q2=“select gender from User where age>20”可推断查询Q的结果,若查询Q的价格大于Q1和Q2的价格之和,数据消费者可通过低价购买Q1和Q2得到查询Q的结果。若查询交易处理过程存在套利,投机的数据消费者将不断尝试以最低价格获取所需数据,降低交易收益;套利的存在也会让普通的数据消费者感受到不公平,减少交易的意愿。因此,数据查询价格函数需要满足无套利(Arbitrage-free)性质,同时保证查询交易处理的高效性。已有方法在数据查询交易中存在计算效率低、可解释性差的问题。
发明内容
本申请实施例的目的是提供一种基于元组信息增益的数据查询服务交易处理方法及装置,以解决相关技术中存在的计算效率低、可解释性差的问题。
根据本申请实施例的第一方面,提供一种基于元组信息增益的数据查询服务交易处理方法,包括:
根据数据卖家指定的支撑集大小|S|,为数据库D中每个关系表Ri构建一个支撑集Si,每个支撑集Si包含对应关系表Ri中元组的可能取值集合,将每个支
撑集Si存储到D所在的数据库服务器中;
对于数据消费者输入的单表Ri上的查询Q,将查询Q中的表名Ri替换成Si,得到支撑集Si上的辅助查询Q’,在数据库服务器中执行查询Q和Q’,得到查询结果O和O’;
根据查询结果O和O’计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数设置查询Q的价格进行交易,其中,Et表示每个元组t的可能取值集合,(|Si|-|Et|)表示t在Q下消除的不确定性,即元组t的信息增益;
对于数据消费者输入的多表R1,R2,…,Rk上的查询Q,改写查询Q为Q’,并根据Q’构建支撑集S1,S2,…,Sk上的辅助查询Q1,Q2,…,Qk,在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk,对于每个关系表Ri,抽取查询结果W和Wi在Ri上的数据W’和W′i,并对结果进行去重,得到Oi和O′i,i=1,…,k;
根据每组结果Oi和O′i计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数得到查询Q在Ri上的价格,累加所有关系表Ri上的价格得到查询Q的价格进行交易。
根据本申请实施例的第二方面,提供一种基于元组信息增益的数据查询服务交易处理装置,包括:
支撑集构建模块,用于根据数据卖家指定的支撑集大小|S|,为数据库D中每个关系表Ri构建一个支撑集Si,每个支撑集Si包含对应关系表Ri中元组的可能取值集合,将每个支撑集Si存储到D所在的数据库服务器中;
单表查询处理模块,用于将数据消费者输入的单表查询Q中的表名Ri替换成Si,得到支撑集Si上的辅助查询Q’,在数据库服务器中执行查询Q和Q’,得到查询结果O和O’;
单表查询交易模块,用于根据查询结果O和O’计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息
增益-价格函数设置查询Q的价格进行交易,其中,Et表示每个元组t的可能取值集合,(|Si|-|Et|)表示t在Q下消除的不确定性,即元组t的信息增益;
多表查询处理模块,用于将数据消费者输入的多表R1,R2,…,Rk上的查询Q,改写为Q’,并根据Q’构建支撑集S1,S2,…,Sk上的辅助查询Q1,Q2,…,Qk,在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk;对于每个关系表Ri,抽取查询结果W和Wi在Ri上的数据W’和W′i,并对结果进行去重,得到Oi和O′i,i=1,…,k;
多表查询交易模块,用于根据每组结果Oi和O′i计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数得到查询Q在Ri上的价格,累加所有关系表Ri上的价格得到查询Q的价格进行交易。
根据本申请实施例的第三方面,提供一种电子设备,包括:
一个或多个处理器;
存储器,用于存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的方法。
根据本申请实施例的第四方面,提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
根据以上技术方案,本发明实施例为数据卖家提供了高效且无套利的数据查询交易处理方式。根据数据卖家指定集合大小为数据库中的每个关系表构建支撑集,对于数据消费者输入的单表查询,构建一个辅助查询,根据原始查询结果和辅助查询结果计算该查询在对应表上所有元组的信息增益,并根据总体信息增益和价格函数发布查询价格;对于数据消费者输入的多表查询,改写原始查询,并为每个表构建一个辅助查询,对原始查询结果和辅助查询结果进行抽取和去重,进而计算多表查询在每个表上所有元组的信息增益,最后根据总体信息增益和价格函数设置查询价格。该方法解决了数据查询交易处理效率低、可解释性差的难题,支持数据查询交易的落地应用。
图1为本发明实施例提供的一种基于元组信息增益的数据查询服务交易处
理方法的流程图。
图2为本发明实施例提供的数据库示例图。
图3为本发明实施例提供的支撑集示例图。
图4为本发明实施例提供的单表查询结果示例图。
图5为本发明实施例提供的多表查询结果示例图。
图6为本发明实施例提供的查询处理结果示例图。
图7为本发明实施例提供的交易处理方法中的交易价格和运行时间在MoveLens电影评分数据集上的对比图。
图8为本发明实施例提供的一种基于元组信息增益的数据查询交易处理装置的框图。
下面结合本发明的具体内容,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。本发明实施例中未作出详细描述的内容属于本领域专业技术人员公知的现有技术。
本发明实施例提供一种基于元组信息增益的数据查询服务交易处理方法,可用于在线为数据消费者输入的查询进行定价的交易场景中。在该在线数据交易市场中,每个数据消费者依据个人需求对数据进行查询,例如,数据分析师可能对电影评分数据集(如图2所示)中1900年以后的电影(即元组,Tuples)感兴趣,选择这些电影的信息进行查询并分析。数据消费者输入的查询Q可以是单表查询,如电影movie表上的查询Q=”select*from movie where year>=1990”;也可以是多表查询,如电影movie表和user表上的查询Q=”select title,name,rating from movie,user,rating where rating>=4and rating.userID=user.userID and rating.movieID=movie.movieID”,用于查询评分大于等于四分的电影名称、用户和具体评分。数据查询交易处理需要在线对这样的查询进行交易定价;以下结合该场景对本发明的方法做详细说明。
参考图1,该方法可以包括以下步骤:
S1:根据数据卖家指定的支撑集大小|S|,为数据库D中每个关系表Ri构建一个支撑集Si,每个支撑集Si包含对应关系表Ri中元组的可能取值集合,将每个支撑集Si存储到D所在的数据库服务器中。
具体地,首先根据数据卖家指定的支撑集总大小|S|=12和数据库中每个关系表Ri的大小|Ri|(即|R1|=|R2|=|R3|=3)计算每个支撑集Si的大小,即
其中R1,R2,…,R3是电影评分数据库D中所有的电影表、用户表和电影评分表;
然后,对于每个关系表Ri(对于i=1,2,3),令Ti为Ri中不重复的元组个数,则有Ti=3,由于|Si|=4大于Ti,将Ri中所有不重复的元组加入Si中,并根据关系表上Ri的约束,生成1个不重复的元组,加入Si中。最终得到每个关系表Ri上的支撑集Si(如图3所示),并将其存储到D所在的数据库服务器中。
S2:对于数据消费者输入的单表Ri上的查询Q=”select*from movie where year>=1990”,将查询Q中的表名Ri替换成Si,即将movie替换成movie_support,得到支撑集Si上的辅助查询Q’=”select*from movie_support where year>=1990”,在数据库服务器中执行查询Q和Q’,得到查询结果O和O’,如图4所示。
S3:根据查询结果O和O’计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数设置查询Q的价格进行交易,其中,Et表示每个元组t的可能取值集合,(|Si|-|Et|)表示t在Q下消除的不确定性,即元组t的信息增益。
上述过程中每个元组t的可能取值集合Et的具体定义包括:
若元组t在查询Q下的结果为vt且vt非空,t的可能取值集合Et包含Si中查询结果为vt的元素集合,即Et={v|v∈Si and Q(v)=vt},可通过遍历O’统计vt的出现频率得到|Et|和信息增益(|Si|-|Et|);
若元组t在查询Q下的结果为空,t的可能取值集合Et包含Si中不满足查询条件的元素集合,即则有|Et|=|Si|-|O|和信息增益|Si|-|Et|=|O|;
根据上述定义,若某些单表查询Q1,Q2,…,Ql可推断查询Q,那么对于Ri中每个元组t,满足其中为元组t在Q下的可能取值集合,是元组查询Qj(j=1,2,…,l)的可能取值集合,这种子集关系保证了直接基于信息增益进行定价,每个元组t在Q下的价格必然小于等于其在Q1,
Q2,…,Ql下的总价格,从而确保了无套利性质;同时,在此定义下,每个元组在查询上的价格与其信息增益相对应,为数据查询交易定价提供了解释依据。
具体地,遍历O’统计每个元素o的出现频率ho,得到每个元素的出现频率均为1,Ri中所有元组t的总体信息增益为
进一步地,数据卖家可选择一个信息增益-价格函数,将信息增益转化为查询价格。该函数需要在正整数范围满足单调递增性(Monotone increasing)和次可加性(Subadditivity),从而保证查询价格的无套利性。将该总体信息增益代入数据卖家选择的信息增益-价格函数中,得到查询Q的价格,并按照此价格进行交易。
具体地,若卖家选择的信息增益-价格函数为f(x)=log(x+1),则该查询Q的价格是log 10。
S4:对于数据消费者输入的多表R1,R2,…,Rk上的查询Q,改写查询Q为Q’,并根据Q’构建支撑集S1,S2,…,Sk上的辅助查询Q1,Q2,…,Qk,在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk;对于每个关系表Ri(i=1,…,k),抽取查询结果W和Wi在Ri上的数据W’和W′i,并对结果进行去重,得到Oi和O′i。
针对查询Q涉及的所有表R1,R2,…,Rk,在查询Q的Selection子句中添加所有表R1,R2,…,Rk上的主键属性,从而将查询Q改写为查询Q’;在Q’的基础上,对于查询Q涉及的每个表Ri(i=1,2,…,k),将Q’中的表名Ri替换成Si,得到辅助查询Qi(i=1,2,…,k);在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk;
具体地,若查询Q为Q=”select title,name,rating from movie,user,rating where rating>=4and rating.userID=user.userID and rating.movieID=movie.movieID”,通过在查询Q的Selection子句中添加所有表上的主键属性(即movieID和userID),从而将查询Q改写为查询Q’=”select movie.movieID,user.userID,rating.movieID,rating.userID,title,name,rating from movie,user,
rating where rating>=4and rating.userID=user.userID and rating.movieID=movie.movieID”;进一步地,通过表名替换,得到3个辅助查询Q1=”select movie_support.movieID,user.userID,rating.movieID,rating.userID,title,name,rating from movie_support,user,rating where rating>=4and rating.userID=user.userID and rating.movieID=movie_support.movieID”,Q2=”select movie.movieID,user_support.userID,rating.movieID,rating.userID,title,name,rating from movie,user_support,rating where rating>=4and rating.userID=user_support.userID and rating.movieID=movie.movieID”,Q3=”select movie.movieID,user.userID,rating_support.movieID,rating_support.userID,title,name,rating from movie,user,rating_support where rating>=4and rating_support.userID=user.userID andrating_support.movieID=movie.movieID”;查询Q’,Q1,Q2和Q3的结果W,W1,W2和W3如图5所示。
由于查询Q’(或Qi)指定了查询筛选条件和需要输出的列,查询结果W(或Wi)包括多行多列数据,依次检查W(或Wi)中的每一列,若该列属于关系表Ri,则保留该列,否则去除该列,得到W(或Wi)在Ri的结果W’(或W′i)。
由于查询Q’(或Qi)是多表查询,抽取的查询结果W’(或W′i)可能包含重复数据,依次检查W’(或W′i)中的每一行,去除重复的查询结果,并删除在查询改写过程中添加的主键列,得到Oi(或O′i)。
具体地,对于i=1,2,3,每组查询结果W和Wi经过筛选、去重、删除主键列得到的处理结果Oi和O′i如图6所示。例如,对于i=1(即movie表),W和W1上的movie.movieID和title列被保留,其余列被删除;然后重复元素被删除,主键列movie.movieID被删除,得到图6中的O1和O′1。
S5:根据每组结果Oi和O′i计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数得到查询Q在Ri上的价格,累加所有关系表Ri(i=1,…,k)上的价格得到查询Q的价格进行交易。
遍历O′i统计每个元素o的出现频率ho,Ri中所有元组t的总体信息增益为
将Ri上的总体信息增益代入数据卖家选择的信息增益-价格函数中,得到查询Q在Ri上的价格,累加所有关系表R1,R2,…,Rk上的价格,得到查询Q的最终价格并交易。
具体地,通过遍历O′1、O′2和O′3,三个表R1、R2和R3的信息增益分别为
和基于信息增益-价格函数f(x)=log(x+1),可得到Q在三个表上的价格均为log 9,总价格为3·log 9。
实施例
本发明的交易处理办法,实施运行在192GB内存的Intel核心2.80GHz的服务器上的Ubuntu 18.04系统上,测试不同Selectivity(即查询结果集合大小与数据表大小的比例)下,本发明实施例在MovieLens数据集上查询交易处理的性能。
通过模拟实验测试分析本发明提出的数据查询交易处理方法(即ARIA)的性能效果,结果如图7所示。可以看出,ARIA相比于已有基于数据库信息增益的处理方法(即QIRANA方法)更加高效,ARIA方法所制定的查询价格更高,因为其考虑了更加细粒度的信息增益,更加全面。
与前述的基于元组信息增益的数据查询服务交易处理方法的实施例相对应,本申请还提供了基于元组信息增益的数据查询服务交易处理装置的实施例。
参照图8,该基于元组信息增益的数据查询服务交易处理装置包括:
支撑集构建模块1,用于根据数据卖家指定的支撑集大小|S|,为数据库D中每个关系表Ri构建一个支撑集Si,每个支撑集Si包含对应关系表Ri中元组的可能取值集合,将每个支撑集Si存储到D所在的数据库服务器中;
单表查询处理模块2,用于将数据消费者输入的单表查询Q中的表名Ri替换成Si,得到支撑集Si上的辅助查询Q’,在数据库服务器中执行查询Q和Q’,得到查询结果O和O’;
单表查询交易模块3,用于根据查询结果O和O’计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数设置查询Q的价格进行交易,其中,Et表示每个元组t的可能取值集合,(|Si|-|Et|)表示t在Q下消除的不确定性,即元组t的信息增益;
多表查询处理模块4,用于将数据消费者输入的多表R1,R2,…,Rk上的查询
Q,改写为Q’,并根据Q’构建支撑集S1,S2,…,Sk上的辅助查询Q1,Q2,…,Qk,在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk;对于每个关系表Ri(i=1,…,k),抽取查询结果W和Wi在Ri上的数据W’和W′i,并对结果进行去重,得到Oi和O′i;
多表查询交易模块5,用于根据每组结果Oi和O′i计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数得到查询Q在Ri上的价格,累加所有关系表Ri(i=1,…,k)上的价格得到查询Q的价格进行交易。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
相应的,本申请还提供一种电子设备,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上述的基于元组信息增益的数据查询交易处理方法。
相应的,本申请还提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如上述的基于元组信息增益的数据查询交易处理方法。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。
Claims (10)
- 一种基于元组信息增益的数据查询服务交易处理方法,其特征在于,包括:根据数据卖家指定的支撑集大小|S|,为数据库D中每个关系表Ri构建一个支撑集Si,每个支撑集Si包含对应关系表Ri中元组的可能取值集合,将每个支撑集Si存储到D所在的数据库服务器中;对于数据消费者输入的单表Ri上的查询Q,将查询Q中的表名Ri替换成Si,得到支撑集Si上的辅助查询Q’,在数据库服务器中执行查询Q和Q’,得到查询结果O和O’;根据查询结果O和O’计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数设置查询Q的价格进行交易,其中,Et表示每个元组t的可能取值集合,(|Si|-|Et|)表示t在Q下消除的不确定性,即元组t的信息增益;对于数据消费者输入的多表R1,R2,…,Rk上的查询Q,改写查询Q为Q’,并根据Q’构建支撑集S1,S2,…,Sk上的辅助查询Q1,Q2,…,Qk,在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk,对于每个关系表Ri,抽取查询结果W和Wi在Ri上的数据W’和W′i,并对结果进行去重,得到Oi和O′i,i=1,…,k;根据每组结果Oi和O′i计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数得到查询Q在Ri上的价格,累加所有关系表Ri上的价格得到查询Q的价格进行交易。
- 根据权利要求1所述的方法,其特征在于,所述每个关系表Ri上的支撑集Si的构建方式如下:首先根据数据卖家指定的支撑集总大小|S|和数据库中每个关系表Ri的大小|Ri|计算每个支撑集Si的大小,即其中R1,R2,…,Rm是数据库D中所有的关系表;然后,对于每个关系表Ri,对应支撑集Si的构建方式如下:令Ti为Ri中不重复的元组个数,若|Si|小于等于Ti,从Ri中随机选择|Si|个不重复的元组加入Si中;若|Si|大于Ti,将Ri中所有不重复的元组加入Si中,并根据关系表上Ri的约束,生成(|Si|-Ti)个不重复的元组,加入Si中。
- 根据权利要求1所述的方法,其特征在于,根据查询结果O和O’计算Ri中每个元组t的信息增益(|Si|-|Et|)和查询Q的价格进行交易,包括:若元组t在查询Q下的结果为vt且vt非空,t的可能取值集合Et包含Si中查询结果为vt的元素集合,即Et={v|v∈Siand Q(v)=vt},可通过遍历O’统计vt的出现频率得到|Et|和信息增益(|Si|-|Et|);若元组t在查询Q下的结果为空,t的可能取值集合Et包含Si中不满足查询条件的元素集合,即则有|Et|=|Si|-|O|和信息增益|Si|-|Et|=|O|;遍历O’统计每个元素o的出现频率ho,则Ri中所有元组t的总体信息增益可计算为将该总体信息增益代入数据卖家选择的信息增益-价格函数中,得到查询Q的价格,并按照此价格进行交易。
- 根据权利要求1所述的方法,其特征在于,所述多表上R1,R2,…,Rk上的查询改写和辅助查询生成方式如下:针对查询Q涉及的所有表R1,R2,…,Rk,在查询Q的Selection子句中添加所有表R1,R2,…,Rk上的主键属性,从而将查询Q改写为查询Q’;在Q’的基础上,对于查询Q涉及的每个表Ri,将Q’中的表名Ri替换成Si,得到辅助查询Qi,i=1,2,…,k。
- 根据权利要求1所述的方法,其特征在于,所述的查询结果抽取过程如下:由于查询Q’或Qi指定了查询筛选条件和需要输出的列,查询结果W或Wi包括多行多列数据,依次检查W或Wi中的每一列,若该列属于关系表Ri,则保 留该列,否则去除该列,得到W或Wi在Ri上的结果W’或W′i。
- 根据权利要求1所述的方法,其特征在于,所述的查询结果去重过程包括:由于查询Q’或Qi是多表查询,抽取的查询结果W’或W′i可能包含重复数据,依次检查W’或W′i中的每一行,去除重复的查询结果,并删除在查询改写过程中添加的主键列,得到Oi或O′i。
- 根据权利要求1所述的方法,其特征在于,还包括:遍历O′i统计每个元素o的出现频率ho,Ri中所有元组t的总体信息增益为将Ri上的总体信息增益代入数据卖家选择的信息增益-价格函数中,得到查询Q在Ri上的价格,累加所有关系表R1,R2,…,Rk上的价格,得到查询Q的最终价格并交易。
- 一种基于元组信息增益的数据查询服务交易处理装置,其特征在于,包括:支撑集构建模块,用于根据数据卖家指定的支撑集大小|S|,为数据库D中每个关系表Ri构建一个支撑集Si,每个支撑集Si包含对应关系表Ri中元组的可能取值集合,将每个支撑集Si存储到D所在的数据库服务器中;单表查询处理模块,用于将数据消费者输入的单表查询Q中的表名Ri替换成Si,得到支撑集Si上的辅助查询Q’,在数据库服务器中执行查询Q和Q’,得到查询结果O和O’;单表查询交易模块,用于根据查询结果O和O’计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数设置查询Q的价格进行交易,其中,Et表示每个元组t的可能取值集合,(|Si|-|Et|)表示t在Q下消除的不确定性,即元组t的信息增益;多表查询处理模块,用于将数据消费者输入的多表R1,R2,…,Rk上的查询Q,改写为Q’,并根据Q’构建支撑集S1,S2,…,Sk上的辅助查询Q1,Q2,…,Qk,在数据库服务器中执行查询Q’,Q1,Q2,…,Qk,得到查询结果W,W1,W2,…,Wk,对于 每个关系表Ri,抽取查询结果W和Wi在Ri上的数据W’和W′i,并对结果进行去重,得到Oi和O′i,i=1,…,k;多表查询交易模块,用于根据每组结果Oi和O′i计算Ri中每个元组t在Q下的信息增益(|Si|-|Et|),累加Ri中所有元组的信息增益,根据数据卖家选择的信息增益-价格函数得到查询Q在Ri上的价格,累加所有关系表Ri(i=1,…,k)上的价格得到查询Q的价格进行交易。
- 一种电子设备,其特征在于,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-7中任一项所述的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US19/090,451 US20250335432A1 (en) | 2024-04-30 | 2025-03-26 | Data query service transaction processing method and device based on tuple information gain |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410535931.5A CN118467810A (zh) | 2024-04-30 | 2024-04-30 | 基于元组信息增益的数据查询服务交易处理方法及装置 |
| CN202410535931.5 | 2024-04-30 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/090,451 Continuation US20250335432A1 (en) | 2024-04-30 | 2025-03-26 | Data query service transaction processing method and device based on tuple information gain |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025227641A1 true WO2025227641A1 (zh) | 2025-11-06 |
Family
ID=92162850
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/129247 Pending WO2025227641A1 (zh) | 2024-04-30 | 2024-11-01 | 基于元组信息增益的数据查询服务交易处理方法及装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20250335432A1 (zh) |
| CN (1) | CN118467810A (zh) |
| WO (1) | WO2025227641A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118467810A (zh) * | 2024-04-30 | 2024-08-09 | 浙江大学 | 基于元组信息增益的数据查询服务交易处理方法及装置 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100324972A1 (en) * | 2009-06-19 | 2010-12-23 | Whoop, Inc. | Real-time, demand-based dynamic pricing system and method |
| CN104657878A (zh) * | 2013-11-21 | 2015-05-27 | 国际商业机器公司 | 用于对数据集进行推荐和定价的方法和系统 |
| CN117076732A (zh) * | 2023-08-28 | 2023-11-17 | 浙江大学 | 一种面向查询的时间折现数据交易处理方法及装置 |
| CN118467810A (zh) * | 2024-04-30 | 2024-08-09 | 浙江大学 | 基于元组信息增益的数据查询服务交易处理方法及装置 |
-
2024
- 2024-04-30 CN CN202410535931.5A patent/CN118467810A/zh active Pending
- 2024-11-01 WO PCT/CN2024/129247 patent/WO2025227641A1/zh active Pending
-
2025
- 2025-03-26 US US19/090,451 patent/US20250335432A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100324972A1 (en) * | 2009-06-19 | 2010-12-23 | Whoop, Inc. | Real-time, demand-based dynamic pricing system and method |
| CN104657878A (zh) * | 2013-11-21 | 2015-05-27 | 国际商业机器公司 | 用于对数据集进行推荐和定价的方法和系统 |
| CN117076732A (zh) * | 2023-08-28 | 2023-11-17 | 浙江大学 | 一种面向查询的时间折现数据交易处理方法及装置 |
| CN118467810A (zh) * | 2024-04-30 | 2024-08-09 | 浙江大学 | 基于元组信息增益的数据查询服务交易处理方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118467810A (zh) | 2024-08-09 |
| US20250335432A1 (en) | 2025-10-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20250077533A1 (en) | Parallel data stream processing system | |
| US11036735B2 (en) | Dimension context propagation techniques for optimizing SQL query plans | |
| US9928537B2 (en) | Management and storage of distributed bookmarks | |
| US9208437B2 (en) | Personalized information pushing method and device | |
| CN104699725B (zh) | 数据搜索处理方法及系统 | |
| US9747349B2 (en) | System and method for distributing queries to a group of databases and expediting data access | |
| CN102419755B (zh) | 一种搜索结果的排序方法和装置 | |
| CN103106585B (zh) | 产品信息的实时去重方法和装置 | |
| CN112559895B (zh) | 一种数据处理方法、装置、电子设备及存储介质 | |
| US11157930B1 (en) | Systems and methods for defining candidate and target locations based on items and user attributes | |
| US20180308152A1 (en) | Data Processing Method and Apparatus | |
| US9098550B2 (en) | Systems and methods for performing data analysis for model proposals | |
| CN116737753A (zh) | 业务数据处理方法、装置、计算机设备和存储介质 | |
| CN112036631A (zh) | 采购量确定方法、装置、设备及存储介质 | |
| CN115905577A (zh) | 知识图谱的构建方法及装置、法规检索方法和装置 | |
| US20250335432A1 (en) | Data query service transaction processing method and device based on tuple information gain | |
| WO2016112502A1 (zh) | 存储查询结果的方法和装置、计算设备 | |
| US12008539B2 (en) | Sorted parallel processing of a large dataset | |
| Peng et al. | On scalable query pricing in data marketplaces | |
| US20120109783A1 (en) | Product information search | |
| Shah et al. | A systematic review of in-memory database over multi-tenancy | |
| CN111737537B (zh) | 基于图数据库的poi推荐方法、设备及介质 | |
| CN114385921A (zh) | 一种标书推荐方法、系统、设备及存储介质 | |
| CN115422198B (zh) | 大数据拉链表处理方法、装置、设备及存储介质 | |
| Anzum et al. | Graphwrangler: An interactive graph view on relational data |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24937671 Country of ref document: EP Kind code of ref document: A1 |