WO2017107457A1 - 查询推荐方法及装置 - Google Patents
查询推荐方法及装置 Download PDFInfo
- Publication number
- WO2017107457A1 WO2017107457A1 PCT/CN2016/089280 CN2016089280W WO2017107457A1 WO 2017107457 A1 WO2017107457 A1 WO 2017107457A1 CN 2016089280 W CN2016089280 W CN 2016089280W WO 2017107457 A1 WO2017107457 A1 WO 2017107457A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- statement
- query
- label
- historical
- information
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- 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/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
- G06F16/285—Clustering or classification
-
- 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/242—Query formulation
- G06F16/2428—Query predicate definition using graphical user interfaces, including menus and forms
Definitions
- the present disclosure relates to the field of data processing technologies, and in particular, to a query recommendation method and apparatus.
- SQL Structured Query Language
- the technician needs to input a query statement every time the data table is queried.
- Each time the query statement is input each character needs to be knocked out, which is very inconvenient for the user to operate.
- the present disclosure provides a query recommendation method and apparatus.
- a query recommendation method including:
- a recommendation query statement corresponding to the recommended query object is generated.
- the obtaining the historical query statement input by the preset user includes:
- the input query statement is used as the historical query statement.
- performing the statement analysis on the historical query statement to obtain the statement information of the historical query statement including:
- the grammar library uses the grammar library to perform parsing on all the obtained words and symbols to obtain a syntax tree corresponding to the historical query statement; the syntax tree includes a plurality of nodes;
- the syntax tree and the voice information of each node in the syntax tree are used as the statement information.
- the determining, according to the cluster label corresponding to the plurality of historical query statements, the recommended query object corresponding to the preset user including:
- a preset number of cluster tags are selected as the recommended query object in order of frequency from high to low.
- the determining, according to the cluster label corresponding to the plurality of historical query statements, the recommended query object corresponding to the preset user including:
- each cluster label Obtaining an attribute of each cluster label, and dividing the cluster label of the same attribute into a label group according to an attribute of each cluster label, where each cluster group includes at least one cluster label;
- a preset number of cluster labels are selected as the recommended query objects according to the order of priority from high to low.
- the method further includes:
- the recommended query statement is displayed in a query sentence input box or in a pop-up window.
- a query recommendation apparatus including:
- a statement obtaining module configured to obtain a historical query statement input by a preset user
- a statement analysis module configured to perform statement analysis on the historical query statement to obtain statement information of the historical query statement
- An information determining module configured to determine, according to the statement information, data item information queried by the historical query statement, where the data item information includes: a query object, an identifier of a data table where the query object is located, and the query The object is located in the attribute information of the data table;
- a label determining module configured to determine, according to the data table item information, a cluster label corresponding to the preset user
- An object determining module configured to determine, according to the cluster label corresponding to the plurality of historical query statements, a recommended query object corresponding to the preset user
- a statement generation module configured to generate a recommended query statement corresponding to the recommended query object.
- the statement obtaining module includes:
- a statement search submodule configured to search, from the historical query record, all historical query statements corresponding to the preset user
- the statement determining submodule is configured to use the input query statement as the historical query statement after the user inputs the query statement.
- the statement analysis module includes:
- a format determining submodule configured to determine a statement format of the historical query statement
- a library obtaining submodule configured to obtain a lexical library, a grammar library, and a semantic library corresponding to the statement format
- a lexical analysis sub-module configured to perform lexical analysis on the historical query statement by using the lexical library to obtain all words and symbols included in the historical query statement;
- a syntax analysis sub-module configured to perform syntax analysis on all the obtained words and symbols by using the grammar library, to obtain a syntax tree corresponding to the historical query statement; the syntax tree includes a plurality of nodes;
- a semantic analysis sub-module configured to perform semantic analysis by using each node on the syntax tree to obtain semantic information of each node in the syntax tree
- the statement information determining submodule is configured to use the syntax tree and voice information of each node in the syntax tree as the statement information.
- the object determining module includes:
- a frequency acquisition submodule configured to acquire a frequency of a cluster label corresponding to multiple historical query statements
- the first object determining submodule is configured to select, according to a frequency from high to low, a preset number of cluster labels as the recommended query object.
- the object determining module includes:
- a label group sub-module configured to divide the cluster label of the same attribute into a label group according to an attribute of each cluster label, where each cluster group includes at least one cluster label;
- An association obtaining sub-module configured to acquire an association relationship between multiple label groups
- a weight coefficient obtaining sub-module configured to acquire, according to the association relationship, a weight coefficient of a cluster label in a plurality of associated label groups
- a priority determining module configured to determine a priority of a clustering label in the plurality of associated label groups according to a frequency and a weighting coefficient of each clustering label
- the second object determining submodule is configured to select a preset number of cluster labels as the recommended query object according to the order of priority from high to low.
- the device further includes:
- An operation detecting module configured to detect whether a query operation of the preset user input is received
- the statement display module is configured to display the recommended query statement in a query statement input box or a pop-up window when detecting the query operation of the preset user input.
- a query recommendation apparatus including:
- a memory for storing processor executable instructions
- processor is configured to:
- a recommendation query statement corresponding to the recommended query object is generated.
- a computer storage medium may store a program, and when the program is executed, the implementation manner of the query recommendation method provided by the first aspect of the present invention may be implemented. Part or all of the steps.
- the method provided by the embodiment of the present invention can obtain a historical query statement input by the user, and can perform statement analysis on the historical query statement, find the statement information corresponding to the query statement, and further obtain the historical query statement according to the found statement information.
- the data item information of the query through which the data item information can determine a clustering label belonging to the user, and define the user once, when the query language
- the clustering label corresponding to the plurality of historical query statements may finally determine one or more recommended query objects corresponding to the user, and then generate a recommended query statement corresponding to the recommended query object.
- the inference analysis can be performed according to the historical query statement of the user, the query object most interested by the user is found, and the query statement corresponding to the recommended query object is generated.
- the query statement can be displayed by pop-up window or drop-down menu. Accordingly, the user can complete the sentence input by simply clicking, so that there is no need to tap each on the keyboard. Characters improve the input efficiency of the query and correspondingly improve the efficiency of the data query.
- FIG. 1 is a flowchart of a query recommendation method according to an exemplary embodiment
- FIG. 2 is a schematic flow chart of step S102 in FIG. 1;
- FIG. 3 is a schematic structural diagram of a first syntax tree according to an embodiment of the present invention.
- step S105 in FIG. 1 is a schematic flow chart of step S105 in FIG. 1;
- FIG. 5 is another schematic flowchart of step S105 in FIG. 1;
- FIG. 6 is a flowchart of another query recommendation method according to an exemplary embodiment
- FIG. 7 is a schematic structural diagram of a query recommendation apparatus according to an exemplary embodiment
- FIG. 8 is a schematic structural diagram of a sentence analysis module in FIG. 7;
- FIG. 9 is a schematic structural view of the object determining module of FIG. 7;
- FIG. 10 is another schematic structural diagram of the object determining module of FIG. 7.
- FIG. 1 is a flowchart of a query recommendation method according to an exemplary embodiment. As shown in FIG. 1, the query recommendation method may include the following steps:
- Step S101 Acquire a historical query statement input by a preset user.
- the user has input a lot of historical statements.
- the step may include:
- the step can include:
- the input query statement is used as the historical query statement.
- the format of the historical query statement obtained needs to be consistent with the format of the database being queried, so that the historical query statement can be used to find the corresponding data from the database.
- Step S102 Perform statement analysis on the historical query statement to obtain statement information of the historical query statement.
- the format of the historical query statement needs to be the same as the format of the database being queried.
- the historical query statement can be analyzed according to the corresponding format, regardless of the format of the database, the query statement
- the rules are specific, that is, the content contained in the query statement is specific.
- the query statement is: select deptNo, deptName, sales, score from dept;
- select is the query action, indicating that you want to select
- the following "deptNo, deptName, sales, score” indicates the content to be queried
- "from dept” indicates the location of the query.
- the statement information of the query statement is: select "deptNo, deptName, sales, score” parameters from "dept”.
- Step S103 Determine, according to the statement information, data item information queried by the historical query statement.
- the data item information includes: a query object, an identifier of a data table where the query object is located, and attribute information of the query object located in the data table.
- the query object refers to the data that is queried, for example: the age of Zhang San, the unit of Li Si, or the items purchased by Zhao Wu in a certain mall.
- the data queried by the user is in the data table. Therefore, when querying the data, it is also necessary to obtain the identifier of the data table in which the data is located, and the location of the data in the data table.
- the attribute information refers to a location where the data is located in the table, for example, a row, a field, and the like.
- the query is the score of the human resources
- the query object is "0.9”
- the identifier of the data table is "Table 1”
- the attribute information of "0.9” in the data table is: the second row and the fourth column.
- Step S104 Determine a cluster label corresponding to the preset user according to the data item information.
- the query object can be determined according to the association Bit, for example: the query object is: LeTV Technology Co., Ltd., and the query content corresponding to LeTV Technology Co., Ltd. is an Internet company located in Beijing, then it can be determined that the content of the default user is: "Address is located in Beijing" Internet companies, therefore, according to this query, the user's label is determined to be “Beijing Internet Enterprise”, which is used to define the user, so that a large number of query statements can finally define a lot of labels for the user, and then these labels can be used. Precise positioning of users.
- Step S105 Determine a recommended query object corresponding to the preset user according to the cluster label corresponding to the plurality of historical query statements.
- the user's recommended query object When determining the user's recommended query object, it can be judged simply according to the frequency of the tag. For example, if the user queries the "Beijing Internet Enterprise" with the most tags, then all Beijing Internet companies can be used as the user's recommended query object, that is, the user next time. When inquiring, the probability of querying Beijing Internet companies is the greatest.
- the frequency of the label may be combined with the association relationship between the labels to perform more complicated calculations, so that the accuracy of the recommended query object is higher.
- Step S106 Generate a recommendation query statement corresponding to the recommended query object.
- the recommendation query statement can be directly generated according to the lexical, grammatical and semantic rules of the query statement, so that the user can directly recommend to the user when the next query is made, and then the user can directly select the recommended query.
- the statement instead of word-by-word, utters the query on the keyboard, improving the efficiency of the query.
- the method provided by the embodiment of the present invention can obtain a historical query statement input by the user, and can perform statement analysis on the historical query statement, find the statement information corresponding to the query statement, and further obtain the historical query statement according to the found statement information.
- the data item information of the query can be used to determine a clustering label belonging to the user through the data item information, and define the user once. When the number of the query statements is large, the cluster corresponding to the plurality of historical query statements is used.
- the tag can finally determine one or more recommended query objects corresponding to the user, and then generate a recommended query statement corresponding to the recommended query object.
- the inference analysis can be performed according to the historical query statement of the user, the query object most interested by the user is found, and the query statement corresponding to the recommended query object is generated.
- the query statement can be displayed by pop-up window or drop-down menu. Accordingly, the user can complete the sentence input by simply clicking, so that there is no need to tap each on the keyboard. Characters improve the input efficiency of the query and correspondingly improve the efficiency of the data query.
- step S102 in the embodiment shown in FIG. 1 may include the following steps.
- Step S201 Determine a statement format of the historical query statement.
- the statement format of the query statement is different for different databases.
- Step S202 Acquire a lexical library, a grammar library, and a semantic library corresponding to the statement format.
- a lexical library, a grammar library, and a semantic library corresponding to the statement format may be preset, so that the query statement can be analyzed after the query statement is obtained.
- Step S203 Perform lexical analysis on the historical query statement by using the lexical library to obtain all words and symbols included in the historical query statement.
- SQL Structured Query Language
- Table 1 above is a data table in the data, the name of the table is "Dept".
- the table contains sales data and scores for different departments. DeptNo, deptName, sales, score are the different columns in the table, deptNo is the department number, deptName is the department name, sales is the sales volume, and score is the score.
- the resulting phrase includes: [select, deptNo, deptName, sales, score, from, dept] and the like.
- Step S204 Perform syntax analysis on all the obtained words and symbols by using the grammar library to obtain a syntax tree corresponding to the historical query statement.
- a plurality of nodes are included on the syntax tree.
- FIG. 3 it is a schematic structural diagram of a syntax tree obtained by analyzing the above query statement.
- Step S205 Perform semantic analysis using each node on the syntax tree to obtain semantic information of each node in the syntax tree.
- Root is the root node, under the root node is the query instruction word, and then points to the object.
- the meaning expressed by the historical query statement that is, the statement information, can be obtained.
- Step S206 using the syntax tree and the voice information of each node in the syntax tree as the statement information.
- the character strings in FIG. 3 are all the strings in some encoded codes.
- the examples are not English characters.
- the code person in the field can fully understand the meaning by reading the context, so There is no need to explain them one by one.
- step S105 in the embodiment shown in FIG. 1 may include the following steps.
- Step S1051 Acquire frequency of cluster labels corresponding to the plurality of historical query statements.
- the frequency refers to the number of occurrences of the clustering label.
- the frequency may be represented by an Arabic numeral, for example, 101 or 202, and the number of occurrences of each label may also be used.
- the ratio of the number of occurrences to the total number of tags is taken as the frequency, for example: 20% or 5%.
- Step S1052 Select a preset number of cluster labels as the recommended query object according to the order of frequency from high to low.
- the preset number of numbers may be preset, and the user may also according to his own preferences. Feel free to set.
- step S105 in the embodiment shown in FIG. 1 may include the following steps.
- Step S1053 Acquire an attribute of each cluster tag.
- the attributes of the tag can be the name of the tag, such as: "Beijing”, “Internet Enterprise”, “pregnancy products”, “diaper”, “electronic products”, “mouse”, “laptop”, and the like.
- Step S1054 The cluster label of the same attribute is divided into one label group according to the attribute of each cluster label.
- the cluster tags of the same attribute may be divided into one tag group.
- “electronic products”, “mouse”, “laptop”, “headphones”, etc. are all electronic products, so they can be divided into the same label group, correspondingly, “baby cars”, “children's educational toys”, “Children’s books”, “milk powder” and “diapers” can all be classified into the “pregnancy and baby products” label group.
- At least one cluster tag is included in each cluster group.
- Step S1055 Acquire an association relationship between a plurality of tag groups.
- the association relationship refers to whether the query is simultaneously performed in the same query statement. For example, the user queries both the “mouse” and the “milk powder” in a query statement, therefore, the "electronic product” and There will be a relationship between “pregnancy products”.
- association relationship between the label groups may also be determined according to the number of times the same query statement appears. For example, the user queries the "mouse” in one piece. Also queryed “milk powder”, in the other query statement query “headset” and “diaper”, in the third query statement query “washing machine” "children's educational toys” and so on, through these statements, The number of times the labels in the two label groups appear in the same query statement can be counted, and the relationship between the two label groups exceeding the preset number of times is determined.
- Step S1056 Acquire, according to the association relationship, a weight coefficient of a cluster label in a plurality of associated label groups.
- weight coefficients of different cluster tags may be preset, and the weight coefficients indicate the importance of the cluster tag within the tag group segment.
- the weight coefficient of “milk powder” can be set higher, but if the user searches for “baby emollients” Oil”, then it may be used by adults themselves, then the weight coefficient of "baby emollient oil” in pregnant and baby products can be set lower.
- Step S1057 Determine the priority of the clustering tags in the plurality of associated tag groups according to the frequency and weight coefficient of each clustering tag.
- the frequency of each cluster tag may be multiplied by a weight coefficient in each tag group to obtain a product, and then the product is prioritized to prioritize the cluster tags.
- Step S1058 Select a preset number of cluster labels as the recommended query object according to the order of priority from high to low.
- a preset number of cluster labels are selected as the recommended query objects in the order of priority from the two label groups, so that two data can be recommended at the same time when recommending.
- the content in the table item improves the accuracy of the recommendation.
- the method may further include:
- Step S107 Detect whether a query operation of the preset user input is received.
- step S108 is performed; otherwise, the flow is ended.
- Step S108 Display the recommended query statement in the query statement input box or in the popup window.
- the query statement before the user inputs the query statement next time, the query statement can be displayed by pop-up window or drop-down menu. Accordingly, the user can complete the sentence input by simply clicking, so that there is no need to tap each on the keyboard. Characters improve the input efficiency of the query and correspondingly improve the efficiency of the data query.
- FIG. 7 is a schematic structural diagram of a query recommendation apparatus according to an exemplary embodiment.
- the query recommendation device may include:
- the statement obtaining module 11 is configured to obtain a historical query statement input by a preset user
- the statement analysis module 12 is configured to perform statement analysis on the historical query statement to obtain statement information of the historical query statement;
- the information determining module 13 is configured to determine, according to the statement information, data item information that is queried by the historical query statement, where the data item information includes: a query object, an identifier of a data table where the query object is located, and the The query object is located in the attribute information of the data table;
- the label determining module 14 is configured to determine, according to the data item information, a cluster label corresponding to the preset user;
- the object determining module 15 is configured to determine, according to the cluster label corresponding to the plurality of historical query statements, a recommended query object corresponding to the preset user;
- the statement generating module 16 is configured to generate a recommended query statement corresponding to the recommended query object.
- the foregoing statement obtaining module 11 may include:
- a statement search submodule for searching all the calendars corresponding to the preset user from the historical query record History query statement.
- the foregoing statement obtaining module 11 may include:
- the statement determining submodule is configured to use the input query statement as the historical query statement after the user inputs the query statement.
- the foregoing statement analysis module 12 may include:
- a format determining submodule 121 configured to determine a statement format of the historical query statement
- the library obtaining sub-module 122 is configured to obtain a lexical library, a grammar library, and a semantic library corresponding to the statement format;
- a lexical analysis sub-module 123 configured to perform lexical analysis on the historical query statement by using the lexical library to obtain all words and symbols included in the historical query statement;
- the syntax analysis sub-module 124 is configured to perform syntax analysis on all the obtained words and symbols by using the grammar library to obtain a syntax tree corresponding to the historical query statement; the syntax tree includes a plurality of nodes;
- a semantic analysis sub-module 125 configured to perform semantic analysis by using each node on the syntax tree to obtain semantic information of each node in the syntax tree;
- the statement information determining sub-module 126 is configured to use the syntax tree and voice information of each node in the syntax tree as the statement information.
- the foregoing object determining module 15 may include:
- the frequency acquisition sub-module 151 is configured to acquire the frequency of the cluster label corresponding to the plurality of historical query statements
- the first object determining sub-module 152 is configured to select a preset number of cluster tags as the recommended query object according to a frequency from high to low.
- the foregoing object determining module 15 may include:
- An attribute obtaining submodule 153 configured to acquire an attribute of each cluster label
- a label group sub-module 154 configured to divide the cluster label of the same attribute into a label group according to an attribute of each cluster label, and each cluster group includes at least one cluster label;
- the association relationship obtaining sub-module 155 is configured to acquire an association relationship between the plurality of label groups
- the weighting factor obtaining sub-module 156 is configured to obtain, according to the association relationship, a weighting coefficient of the clustering label in the plurality of associated label groups;
- a priority determining module 157 configured to determine, according to a frequency and a weight coefficient of each clustering label, a priority of a clustering label in a plurality of associated label groups;
- the second object determining sub-module 158 is configured to select a preset number of cluster labels as the recommended query object according to the order of priority from high to low.
- the apparatus shown in FIG. 7 further includes:
- An operation detecting module configured to detect whether a query operation of the preset user input is received
- the statement display module is configured to display the recommended query statement in a query statement input box or a pop-up window when detecting the query operation of the preset user input.
- the embodiment of the present disclosure further provides a query recommendation device, including:
- a memory for storing processor executable instructions
- processor is configured to:
- the embodiment of the present disclosure further provides a computer storage medium, wherein the computer storage medium can store a program, and the program can be implemented in each implementation manner of the query recommendation method provided by the embodiment shown in FIG. Some or all of the steps.
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)
- Human Computer Interaction (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种查询推荐方法及装置,该方法包括:获取预设用户输入的历史查询语句(S101);对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息(S102);根据所述语句信息确定所述历史查询语句所查询的数据表项信息(S103),根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签(S104);根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象(S105);生成与所述推荐查询对象相对应的推荐查询语句(S106)。在实际应用时,在用户下一次输入查询语句前,可以通过弹窗或下拉菜单的方式显示该查询语句,相应地,用户只需点击即可完成语句输入,从而无需在键盘上敲打出来每个字符,提高了查询语句的输入效率,相应地也提高了数据查询的效率。
Description
本申请要求于2015年12月25日提交中国专利局、申请号为201510994506.3、发明名称为“查询推荐方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本公开涉及数据处理技术领域,尤其涉及一种查询推荐方法及装置。
在对关系数据库进行数据查询时,需要利用数据库查询语句,例如结构化查询语句(Structured Query Language,简称为SQL),展开相应的数据查询。
目前,利用数据库查询语句进行数据查询时,技术人员每查询一次数据表就需要输入一次查询语句,在每次输入查询语句时,都需要挨个敲出每个字符,操作非常不方便,使得用户的查询时,消耗的时间非常长,进而导致效率较低。
虽然,有一些数据库在查询时,在用户点击查询数据框时,将用户最近的历史查询语句以菜单的形式展示出来,以便于用户可以选择历史查询语句,然后在历史查询语句中进行一些修改,这样虽然可以提高查询时的字符输入速度,但是由于都是历史查询语句,用户每次查询新的内容时,仍然需要对历史指令进行编辑、调整,效率仍然较低。
发明内容
为克服相关技术中存在的问题,本公开提供一种查询推荐方法及装置。
根据本公开实施例的第一方面,提供一种查询推荐方法,包括:
获取预设用户输入的历史查询语句;
对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;
根据所述语句信息确定所述历史查询语句所查询的数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;
根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;
根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;
生成与所述推荐查询对象相对应的推荐查询语句。
可选地,所述获取预设用户输入的历史查询语句,包括:
从历史查询记录中查找与所述预设用户对应的所有历史查询语句;
或者,
当所述用户输入查询语句后,将所述输入的查询语句作为所述历史查询语句。
可选地,所述对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息,包括:
确定所述历史查询语句的语句格式;
获取与所述语句格式对应的词法库、语法库和语义库;
利用所述词法库对所述历史查询语句进行词法分析,得到所述历史查询语句中包含的所有词语及符号;
利用所述语法库对得到的所有词语和符号进行语法分析,得到与所述历史查询语句对应的语法树;所述语法树包含多个节点;
利用所述语法树上每个节点进行语义分析,得到所述语法树中每个节点的语义信息;
将所述语法树以及所述语法树中每个节点的语音信息作为所述语句信息。
可选地,所述根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象,包括:
获取多个历史查询语句对应的聚类标签的频度;
按照频度由高到低的顺序选取预设数量个聚类标签作为所述推荐查询对象。
可选地,所述根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象,包括:
获取每个聚类标签的属性,并根据每个聚类标签的属性将相同属性的所述聚类标签划分为一个标签组,每个聚类组内包括至少一个聚类标签;
获取多个标签组之间的关联关系;
根据所述关联关系,获取多个相关联的标签组内聚类标签的权重系数;
根据每个聚类标签的频度和权重系数确定多个相关联的标签组内聚类标签的优先级;
按照所述优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象。
可选地,所述方法还包括:
检测是否接收到所述预设用户输入的查询操作;
当检测所述预设用户输入的查询操作时,在查询语句输入框内或弹窗内显示所述推荐查询语句。
根据本公开实施例的第二方面,提供一种查询推荐装置,包括:
语句获取模块,用于获取预设用户输入的历史查询语句;
语句分析模块,用于对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;
信息确定模块,用于根据所述语句信息确定所述历史查询语句所查询的数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;
标签确定模块,用于根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;
对象确定模块,用于根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;
语句生成模块,用于生成与所述推荐查询对象相对应的推荐查询语句。
可选地,所述语句获取模块,包括:
语句查找子模块,用于从历史查询记录中查找与所述预设用户对应的所有历史查询语句;
或者,
语句确定子模块,用于当所述用户输入查询语句后,将所述输入的查询语句作为所述历史查询语句。
可选地,所述语句分析模块,包括:
格式确定子模块,用于确定所述历史查询语句的语句格式;
库获取子模块,用于获取与所述语句格式对应的词法库、语法库和语义库;
词法分析子模块,用于利用所述词法库对所述历史查询语句进行词法分析,得到所述历史查询语句中包含的所有词语及符号;
语法分析子模块,用于利用所述语法库对得到的所有词语和符号进行语法分析,得到与所述历史查询语句对应的语法树;所述语法树包含多个节点;
语义分析子模块,用于利用所述语法树上每个节点进行语义分析,得到所述语法树中每个节点的语义信息;
语句信息确定子模块,用于将所述语法树以及所述语法树中每个节点的语音信息作为所述语句信息。
可选地,所述对象确定模块,包括:
频度获取子模块,用于获取多个历史查询语句对应的聚类标签的频度;
第一对象确定子模块,用于按照频度由高到低的顺序选取预设数量个聚类标签作为所述推荐查询对象。
可选地,所述对象确定模块,包括:
属性获取子模块,用于获取每个聚类标签的属性;
标签组划分子模块,用于根据每个聚类标签的属性将相同属性的所述聚类标签划分为一个标签组,每个聚类组内包括至少一个聚类标签;
关联关系获取子模块,用于获取多个标签组之间的关联关系;
权重系数获取子模块,用于根据所述关联关系,获取多个相关联的标签组内聚类标签的权重系数;
优先级确定模块,用于根据每个聚类标签的频度和权重系数确定多个相关联的标签组内聚类标签的优先级;
第二对象确定子模块,用于按照所述优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象。
可选地,所述装置还包括:
操作检测模块,用于检测是否接收到所述预设用户输入的查询操作;
语句显示模块,用于当检测所述预设用户输入的查询操作时,在查询语句输入框内或弹窗内显示所述推荐查询语句。
根据本公开实施例的第三方面,提供了一种查询推荐装置,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:
获取预设用户输入的历史查询语句;
对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;
根据所述语句信息确定所述历史查询语句所查询的数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;
根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;
根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;
生成与所述推荐查询对象相对应的推荐查询语句。
根据本公开实施例的第四方面,提供了一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可实现本发明第一方面提供的查询推荐方法的各实现方式中的部分或全部步骤。
本公开的实施例提供的技术方案可以包括以下有益效果:
本发明实施例提供的该方法,在获取到用户以往输入的历史查询语句,可以对历史查询语句进行语句分析,找到该查询语句对应的语句信息,然后根据找到的语句信息进一步得到该历史查询语句所查询的数据表项信息,通过这些数据表项信息就可以确定属于该用户的一个聚类标签,对用户进行一次定义,当查询语
句的数量较大时,通过大量历史查询语句对应的聚类标签,最终可以确定得到该用户对应的一个或多个推荐查询对象,然后生成与该推荐查询对象相对应的推荐查询语句即可。
通过上述方法,可以根据用户的历史查询语句进行推理分析,找到用户最感兴趣的查询对象,并且生成与该推荐查询对象相对应的查询语句。在实际应用时,在用户下一次输入查询语句前,可以通过弹窗或下拉菜单的方式显示该查询语句,相应地,用户只需点击即可完成语句输入,从而无需在键盘上敲打出来每个字符,提高了查询语句的输入效率,相应地也提高了数据查询的效率。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是根据一示例性实施例示出的一种查询推荐方法的流程图;
图2是图1中步骤S102的流程示意图;
图3是本发明实施例提供第一种语法树的结构示意图;
图4为图1中步骤S105的一种流程示意图;
图5为图1中步骤S105的另一种流程示意图;
图6是根据一示例性实施例示出的另一种查询推荐方法的流程图;
图7是根据一示例性实施例示出的一种查询推荐装置的结构示意图;
图8为图7中的语句分析模块的结构示意图;
图9为图7中对象确定模块的一种结构示意图;
图10为图7中对象确定模块的另一种结构示意图。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本发明相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本发明的一些方面相一致的装置和方法的例子。
图1是根据一示例性实施例示出的一种查询推荐方法的流程图。如图1所示,该查询推荐方法可以包括以下步骤:
步骤S101:获取预设用户输入的历史查询语句。
在本发明实施例中,获取历史查询语句的方式有很多,在一种情况下,用户已经输入很多历史语句,此时,该步骤可以包括:
从历史查询记录中查找与所述预设用户对应的所有历史查询语句。
具体应用时,可以先查找预设历史记录的路径,查找到所有历史查询语句,然后根据该用户的用户名或其它标识,在历史查询记录中筛选出与该用户对应的历史查询语句。
在另一情况下,每当用于输入一个查询语句,直接将该查询语句作为历史查询语句,相比前一种方式,这种方式更加实时快速。此时,该步骤可以包括:
当所述用户输入查询语句后,将所述输入的查询语句作为所述历史查询语句。
对于不同的结构的数据库,用户在输入查询语句时,所获取的历史查询语句的格式需要与所查询数据库的格式相一致,这样才可以保证利用历史查询语句从数据库中查找相应的数据。
步骤S102:对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息。
参见上述关于步骤S101的描述,历史查询语句的格式需要与所查询的数据库的格式相同,在该步骤中,可以按照对应的格式对历史查询语句进行分析,无论哪种格式的数据库,查询语句的规则都是特定的,即查询语句中包含的内容是特定的。例如:
查询语句为:select deptNo,deptName,sales,score from dept;
其中“select”是查询动作,表示要选择,后面的“deptNo,deptName,sales,score”表示要查询的内容,“from dept”表示查询的位置。
可见,通过分析该查询语句,可以得知该查询语句的语句信息为:从“dept”选择“deptNo,deptName,sales,score”几项参数。
步骤S103:根据所述语句信息确定所述历史查询语句所查询的数据表项信息。
在本发明实施例中,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息。
其中,查询对象是指所查询的数据,例如:张三的年龄,李四的单位,或者,赵五在某商城购买的物品等。通常用户查询的数据都是在数据表内,因此,在查询数据时,还需要获取到该数据所在的数据表的标识,以及,该数据位于数据表内的位置。在本发明实施例中,属性信息是指数据位于表内的位置,例如:行列、字段等等。
以下表为例:
表1:
| deptNo | deptName | sales | score |
| d001 | 销售部 | 10000 | 1.2 |
| d002 | 人力资源 | 5000 | 0.9 |
| d003 | 采购部 | 8000 | 1.1 |
| d004 | 信息部 | 7000 | 1.0 |
其中,如果查询的是人力资源的得分情况,那么查询对象为“0.9”,数据表的标识为“表1”,“0.9”在数据表中的属性信息为:第2行第4列。
步骤S104:根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签。
当确定出查询对象的数据表项信息时,可以根据这些关联对查询对象进行定
位,例如:查询对象为:乐视网科技公司,与乐视网科技公司对应的查询内容为,位于北京的互联网企业,那么就可以确定该预设用户所关心的内容为:“地址位于北京”“互联网企业”,因此,可以根据本次查询确定用户的标签为“北京互联网企业”,用于对用户进行定义,这样通过大量的查询语句,最终可以给用户定义很多标签,那么通过这些标签就可以对用户进行精确定位。
步骤S105:根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象。
在确定用户的推荐查询对象时,可以简单根据标签的频度来判断,例如:用户查询“北京互联网企业”的标签最多,那么可以将所有北京互联网企业作为用户的推荐查询对象,即用户下一次查询时,查询北京互联网企业的概率最大。
当然,在其它实施例中,还可以将标签的频度结合标签之间的关联关系,进行更复杂的计算,以使得到的推荐查询对象的准确度更高。
步骤S106:生成与所述推荐查询对象相对应的推荐查询语句。
当确定出推荐查询对象后,可以根据查询语句的词法、语法和语义等规则,直接生成推荐查询语句,这样可以在用户下一次查询时,直接向用户进行推荐,然后用户可以直接选择该推荐查询语句,而不用一字一句的将查询语句在键盘上敲打出来,提高了查询的效率。
本发明实施例提供的该方法,在获取到用户以往输入的历史查询语句,可以对历史查询语句进行语句分析,找到该查询语句对应的语句信息,然后根据找到的语句信息进一步得到该历史查询语句所查询的数据表项信息,通过这些数据表项信息就可以确定属于该用户的一个聚类标签,对用户进行一次定义,当查询语句的数量较大时,通过大量历史查询语句对应的聚类标签,最终可以确定得到该用户对应的一个或多个推荐查询对象,然后生成与该推荐查询对象相对应的推荐查询语句即可。
通过上述方法,可以根据用户的历史查询语句进行推理分析,找到用户最感兴趣的查询对象,并且生成与该推荐查询对象相对应的查询语句。在实际应用时,在用户下一次输入查询语句前,可以通过弹窗或下拉菜单的方式显示该查询语句,相应地,用户只需点击即可完成语句输入,从而无需在键盘上敲打出来每个字符,提高了查询语句的输入效率,相应地也提高了数据查询的效率。
在本发明另一实施例中,如图2所示,图1所示实施例中的步骤S102可以包括以下步骤。
步骤S201:确定所述历史查询语句的语句格式。
针对不同的数据库,查询语句的语句格式均不相同。
步骤S202:获取与所述语句格式对应的词法库、语法库和语义库。
针对不同的数据库都可以预先设置有与语句格式对应的词法库、语法库和语义库,以便在得到查询语句后,可以对查询语句进行分析。
步骤S203:利用所述词法库对所述历史查询语句进行词法分析,得到所述历史查询语句中包含的所有词语及符号。
在本发明实施例中,以SQL(Structured Query Language,结构化查询语言)数据库为例,下面结合一个具体的案例进行说明:
上表1为数据中的一张数据表,该表的名称为“Dept”。在该表中包含有不同部门的销售数据以及得分情况,其中,deptNo,deptName,sales,score分别为表中的不同列,deptNo为部门编号,deptName为部门名称,sales为销量,score为得分。
在该步骤中,经过词法分析,也即对历史查询语句中的所有字符进行分词,最终得到的词组包括:[select,deptNo,deptName,sales,score,from,dept]等。
步骤S204:利用所述语法库对得到的所有词语和符号进行语法分析,得到与所述历史查询语句对应的语法树。
在本发明实施例中,在所述语法树上包含多个节点。
参见图3所述,为对上述查询语句进行分析后得到的语法树的结构示意图。
步骤S205:利用所述语法树上每个节点进行语义分析,得到所述语法树中每个节点的语义信息。
从图中3可以看到,Root为根节点,在根节点之下分别为查询指令词,然后是指向对象。通过对语法树中的语义分析,可以得到该历史查询语句所表达的意思,也即语句信息。
步骤S206:将所述语法树以及所述语法树中每个节点的语音信息作为所述语句信息。
在本发明实施例中,图3中的字符串均为一些的编码代码中的字符串,这里仅是实例,并非是英文字符,本领域编码人员通过阅读上下文,完全可以理解其中的意思,所以无需单独一一解释。
在本发明另一实施例中,如图4所示,图1所示实施例中的步骤S105可以包括以下步骤。
步骤S1051:获取多个历史查询语句对应的聚类标签的频度。
在本发明实施例中,频度是指聚类标签的出现次数,在具体应用中,可以利用阿拉伯数字来表示频度,例如:101或202等,另外,还可以将每个标签的出现次数和总标签的出现次数的比值作为频度,例如:20%或5%。
步骤S1052:按照频度由高到低的顺序选取预设数量个聚类标签作为所述推荐查询对象。
在本发明实施例中,将频度排序靠前的几个聚类标签作为推荐查询对象,在具体应用中,预设数量的个数,可以预先设置好,另外,用户还可以根据自己的喜好随意设定。
在本发明另一实施例中,如图5所示,图1所示实施例中的步骤S105可以包括以下步骤。
步骤S1053:获取每个聚类标签的属性。
标签的属性可以为标签的名称,例如:“北京”、“互联网企业”、“孕婴产品”、“尿不湿”、“电子产品”、“鼠标”、“笔记本电脑”等。
步骤S1054:根据每个聚类标签的属性将相同属性的所述聚类标签划分为一个标签组。
在本发明实施例中,可以预先根据常识设定好哪些标签属于同一类,进而在该步骤中,可以将相同属性的聚类标签划分到一个标签组中。例如:“电子产品”、“鼠标”、“笔记本电脑”、“耳机”等都属于电子产品,因此,可以划分到同一标签组内,相应地,“婴儿车”、“儿童益智玩具”、“儿童书籍”、“奶粉”、“尿布”均可以划分到“孕婴产品”这一标签组内。
在每个聚类组内中包括至少一个聚类标签。
步骤S1055:获取多个标签组之间的关联关系。
在本发明实施例中,关联关系是指是否在同一查询语句内被同时查询,例如:用户在一条查询语句内既查询了“鼠标”,也查询了“奶粉”,因此,“电子产品”和“孕婴产品”之间将存在关联关系。
前述距离,仅仅是单一的关联关系,此外,在其它实施例中,还可以根据出现在同一查询语句的次数来确定标签组之间的关联关系,例如:用户在一条内既查询了“鼠标”,也查询了“奶粉”,在另一查询语句内查询“耳机”和“尿布”,在第三个查询语句内查询了“洗衣机”“儿童益智玩具”等等,通过这些语句来看,可以统计两个标签组内的标签出现在同一查询语句中的次数,进而将超过预设次数的两个标签组之间确定关联关系。
步骤S1056:根据所述关联关系,获取多个相关联的标签组内聚类标签的权重系数。
在每个标签组内,可以预先设定不同聚类标签的权重系数,权重系数表示,该聚类标签在该标签组段内的重要性。
例如:以“孕婴产品”为例,如果用户搜索奶粉,那么将说明此用户一定关心“孕婴产品”,相应,“奶粉”的权重系数可以设置较高,但如果用户搜索“婴儿润肤油”,那么有可能是成年人自己使用,那么“婴儿润肤油”在孕婴产品内的权重系数就可以设置较低。
同理,以“计算机产品”为例,如果用户搜索鼠标,那么该用于关心“计算机产品”较多,所以鼠标在计算机产品中的权重系数就比较高,而如果用户搜索耳机,那么此用户不一定完全关注计算机产品,很有可能是关注手机耳机等等,所以耳机在计算产品中的权重系数就比较低。
步骤S1057:根据每个聚类标签的频度和权重系数确定多个相关联的标签组内聚类标签的优先级。
在具体应用中,可以在每个标签组内,将每个聚类标签的频度乘以权重系数得到乘积,然后将该乘积作为优先级,对聚类标签的优先级进行排序。
步骤S1058:按照所述优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象。
在具体应用中,是在相关联的两个标签组内分别按照优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象,这样在推荐时,就可以同时推荐两个数据表项中的内容,提高了推荐的准确度。
在本发明另一实施例中,如图6所示,该方法还可以包括:
步骤S107:检测是否接收到所述预设用户输入的查询操作。
当检测所述预设用户输入的查询操作时,执行步骤S108;否则,结束流程。
步骤S108:在查询语句输入框内或弹窗内显示所述推荐查询语句。
在实际应用时,在用户下一次输入查询语句前,可以通过弹窗或下拉菜单的方式显示该查询语句,相应地,用户只需点击即可完成语句输入,从而无需在键盘上敲打出来每个字符,提高了查询语句的输入效率,相应地也提高了数据查询的效率。
图7是根据一示例性实施例示出的一种查询推荐装置的结构示意图。如图7所示,该查询推荐装置可以包括:
语句获取模块11,用于获取预设用户输入的历史查询语句;
语句分析模块12,用于对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;
信息确定模块13,用于根据所述语句信息确定所述历史查询语句所查询的数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;
标签确定模块14,用于根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;
对象确定模块15,用于根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;
语句生成模块16,用于生成与所述推荐查询对象相对应的推荐查询语句。
在本发明另一实施例中,前述语句获取模块11可以包括:
语句查找子模块,用于从历史查询记录中查找与所述预设用户对应的所有历
史查询语句。
在本发明另一实施例中,前述语句获取模块11可以包括:
语句确定子模块,用于当所述用户输入查询语句后,将所述输入的查询语句作为所述历史查询语句。
在本发明另一实施例中,如图8所示,前述语句分析模块12,可以包括:
格式确定子模块121,用于确定所述历史查询语句的语句格式;
库获取子模块122,用于获取与所述语句格式对应的词法库、语法库和语义库;
词法分析子模块123,用于利用所述词法库对所述历史查询语句进行词法分析,得到所述历史查询语句中包含的所有词语及符号;
语法分析子模块124,用于利用所述语法库对得到的所有词语和符号进行语法分析,得到与所述历史查询语句对应的语法树;所述语法树包含多个节点;
语义分析子模块125,用于利用所述语法树上每个节点进行语义分析,得到所述语法树中每个节点的语义信息;
语句信息确定子模块126,用于将所述语法树以及所述语法树中每个节点的语音信息作为所述语句信息。
在本发明另一实施例中,如图9所示,前述对象确定模块15,可以包括:
频度获取子模块151,用于获取多个历史查询语句对应的聚类标签的频度;
第一对象确定子模块152,用于按照频度由高到低的顺序选取预设数量个聚类标签作为所述推荐查询对象。
在本发明另一实施例中,如图10所示,前述对象确定模块15,可以包括:
属性获取子模块153,用于获取每个聚类标签的属性;
标签组划分子模块154,用于根据每个聚类标签的属性将相同属性的所述聚类标签划分为一个标签组,每个聚类组内包括至少一个聚类标签;
关联关系获取子模块155,用于获取多个标签组之间的关联关系;
权重系数获取子模块156,用于根据所述关联关系,获取多个相关联的标签组内聚类标签的权重系数;
优先级确定模块157,用于根据每个聚类标签的频度和权重系数确定多个相关联的标签组内聚类标签的优先级;
第二对象确定子模块158,用于按照所述优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象。
在本发明另一实施例中,图7所示的装置还包括:
操作检测模块,用于检测是否接收到所述预设用户输入的查询操作;
语句显示模块,用于当检测所述预设用户输入的查询操作时,在查询语句输入框内或弹窗内显示所述推荐查询语句。
本公开实施例还提供了一种查询推荐装置,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:
获取预设用户输入的历史查询语句;
对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;
根据所述语句信息确定所述历史查询语句所查询的数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;
根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;
根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;生成与所述推荐查询对象相对应的推荐查询语句。
本公开实施例还提供了一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可实现图1-图6所示实施例提供的查询推荐方法的各实现方式中的部分或全部步骤。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。
Claims (12)
- 一种查询推荐方法,其特征在于,包括:获取预设用户输入的历史查询语句;对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;根据所述语句信息确定所述历史查询语句所查询的数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;生成与所述推荐查询对象相对应的推荐查询语句。
- 根据权利要求1所述的方法,其特征在于,所述获取预设用户输入的历史查询语句,包括:从历史查询记录中查找与所述预设用户对应的所有历史查询语句;或者,当所述用户输入查询语句后,将所述输入的查询语句作为所述历史查询语句。
- 根据权利要求1所述的方法,其特征在于,所述对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息,包括:确定所述历史查询语句的语句格式;获取与所述语句格式对应的词法库、语法库和语义库;利用所述词法库对所述历史查询语句进行词法分析,得到所述历史查询语句中包含的所有词语及符号;利用所述语法库对得到的所有词语和符号进行语法分析,得到与所述历史查询语句对应的语法树;所述语法树包含多个节点;利用所述语法树上每个节点进行语义分析,得到所述语法树中每个节点 的语义信息;将所述语法树以及所述语法树中每个节点的语音信息作为所述语句信息。
- 根据权利要求1所述的方法,其特征在于,所述根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象,包括:获取多个历史查询语句对应的聚类标签的频度;按照频度由高到低的顺序选取预设数量个聚类标签作为所述推荐查询对象。
- 根据权利要求4所述的方法,其特征在于,所述根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象,包括:获取每个聚类标签的属性,并根据每个聚类标签的属性将相同属性的所述聚类标签划分为一个标签组,每个聚类组内包括至少一个聚类标签;获取多个标签组之间的关联关系;根据所述关联关系,获取多个相关联的标签组内聚类标签的权重系数;根据每个聚类标签的频度和权重系数确定多个相关联的标签组内聚类标签的优先级;按照所述优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:检测是否接收到所述预设用户输入的查询操作;当检测所述预设用户输入的查询操作时,在查询语句输入框内或弹窗内显示所述推荐查询语句。
- 一种查询推荐装置,其特征在于,包括:语句获取模块,用于获取预设用户输入的历史查询语句;语句分析模块,用于对所述历史查询语句进行语句分析,得到所述历史查询语句的语句信息;信息确定模块,用于根据所述语句信息确定所述历史查询语句所查询的 数据表项信息,所述数据表项信息包括:查询对象、所述查询对象所在数据表的标识、以及所述查询对象位于所述数据表的属性信息;标签确定模块,用于根据所述数据表项信息确定与所述预设用户相对应的一个聚类标签;对象确定模块,用于根据多个历史查询语句对应的聚类标签确定与所述预设用户相对应的推荐查询对象;语句生成模块,用于生成与所述推荐查询对象相对应的推荐查询语句。
- 根据权利要求7所述的装置,其特征在于,所述语句获取模块,包括:语句查找子模块,用于从历史查询记录中查找与所述预设用户对应的所有历史查询语句;或者,语句确定子模块,用于当所述用户输入查询语句后,将所述输入的查询语句作为所述历史查询语句。
- 根据权利要求7所述的装置,其特征在于,所述语句分析模块,包括:格式确定子模块,用于确定所述历史查询语句的语句格式;库获取子模块,用于获取与所述语句格式对应的词法库、语法库和语义库;词法分析子模块,用于利用所述词法库对所述历史查询语句进行词法分析,得到所述历史查询语句中包含的所有词语及符号;语法分析子模块,用于利用所述语法库对得到的所有词语和符号进行语法分析,得到与所述历史查询语句对应的语法树;所述语法树包含多个节点;语义分析子模块,用于利用所述语法树上每个节点进行语义分析,得到所述语法树中每个节点的语义信息;语句信息确定子模块,用于将所述语法树以及所述语法树中每个节点的语音信息作为所述语句信息。
- 根据权利要求7所述的装置,其特征在于,所述对象确定模块,包 括:频度获取子模块,用于获取多个历史查询语句对应的聚类标签的频度;第一对象确定子模块,用于按照频度由高到低的顺序选取预设数量个聚类标签作为所述推荐查询对象。
- 根据权利要求10所述的装置,其特征在于,所述对象确定模块,包括:属性获取子模块,用于获取每个聚类标签的属性;标签组划分子模块,用于根据每个聚类标签的属性将相同属性的所述聚类标签划分为一个标签组,每个聚类组内包括至少一个聚类标签;关联关系获取子模块,用于获取多个标签组之间的关联关系;权重系数获取子模块,用于根据所述关联关系,获取多个相关联的标签组内聚类标签的权重系数;优先级确定模块,用于根据每个聚类标签的频度和权重系数确定多个相关联的标签组内聚类标签的优先级;第二对象确定子模块,用于按照所述优先级由高到低的顺序选取预设数量个聚类标签作为推荐查询对象。
- 根据权利要求7所述的装置,其特征在于,所述装置还包括:操作检测模块,用于检测是否接收到所述预设用户输入的查询操作;语句显示模块,用于当检测所述预设用户输入的查询操作时,在查询语句输入框内或弹窗内显示所述推荐查询语句。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US15/242,057 US20170185673A1 (en) | 2015-12-25 | 2016-08-19 | Method and Electronic Device for QUERY RECOMMENDATION |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510994506.3 | 2015-12-25 | ||
| CN201510994506.3A CN105868255A (zh) | 2015-12-25 | 2015-12-25 | 查询推荐方法及装置 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US15/242,057 Continuation US20170185673A1 (en) | 2015-12-25 | 2016-08-19 | Method and Electronic Device for QUERY RECOMMENDATION |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017107457A1 true WO2017107457A1 (zh) | 2017-06-29 |
Family
ID=56624392
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/089280 Ceased WO2017107457A1 (zh) | 2015-12-25 | 2016-07-07 | 查询推荐方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105868255A (zh) |
| WO (1) | WO2017107457A1 (zh) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109471890A (zh) * | 2018-10-16 | 2019-03-15 | 深圳壹账通智能科技有限公司 | 报表文件的生成方法、终端设备及介质 |
| CN111522840A (zh) * | 2020-04-27 | 2020-08-11 | 平安科技(深圳)有限公司 | 标签的配置方法、装置、设备及计算机可读存储介质 |
| CN112132628A (zh) * | 2020-09-28 | 2020-12-25 | 科大讯飞股份有限公司 | 一种用户意图预测方法、信息推荐方法及相关设备 |
| CN113672457A (zh) * | 2021-08-09 | 2021-11-19 | 支付宝(杭州)信息技术有限公司 | 识别数据库中的异常操作的方法和装置 |
| CN114397967A (zh) * | 2022-01-07 | 2022-04-26 | 山东浪潮科学研究院有限公司 | 一种数据库的辅助输入关键字自动联想方法 |
| CN114969450A (zh) * | 2022-04-19 | 2022-08-30 | 北京优特捷信息技术有限公司 | 一种用户行为分析方法、装置、设备及存储介质 |
| CN115186169A (zh) * | 2022-05-10 | 2022-10-14 | 兴业银行股份有限公司 | 数据及数据协作者推荐方法与系统 |
| CN117668373A (zh) * | 2024-02-02 | 2024-03-08 | 北京翼鸥教育科技有限公司 | 一种级联标签推荐方法、装置、电子设备及存储介质 |
| CN118643217A (zh) * | 2024-06-28 | 2024-09-13 | 北京海新睿人工智能科技有限公司 | 一种增量式内容推荐方法、装置、介质和设备 |
| CN120216678A (zh) * | 2025-05-28 | 2025-06-27 | 杭州威灿科技有限公司 | 一种智能类案推荐方法及系统 |
Families Citing this family (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106648612A (zh) * | 2016-10-26 | 2017-05-10 | 乐视控股(北京)有限公司 | 弹窗配置方法及装置 |
| CN106557563B (zh) * | 2016-11-15 | 2020-09-25 | 北京百度网讯科技有限公司 | 基于人工智能的查询语句推荐方法及装置 |
| CN106649768B (zh) * | 2016-12-27 | 2021-03-16 | 北京百度网讯科技有限公司 | 基于深度问答的问答澄清方法和装置 |
| CN109032683B (zh) * | 2017-05-31 | 2021-03-26 | 腾讯科技(深圳)有限公司 | 配置数据处理方法及装置 |
| CN109213413A (zh) * | 2017-07-07 | 2019-01-15 | 阿里巴巴集团控股有限公司 | 一种推荐方法、装置、设备和存储介质 |
| CN108255920A (zh) * | 2017-09-22 | 2018-07-06 | 平安科技(深圳)有限公司 | 机构名称检索式的显示方法、装置、设备及存储介质 |
| CN108846066B (zh) * | 2018-06-06 | 2020-01-24 | 上海计算机软件技术开发中心 | 一种可视化的数据分析方法及系统 |
| CN109299384B (zh) * | 2018-11-02 | 2021-05-04 | 北京小米智能科技有限公司 | 场景推荐方法、装置及系统、存储介质 |
| CN110570837B (zh) * | 2019-08-28 | 2022-03-11 | 卓尔智联(武汉)研究院有限公司 | 一种语音交互方法、装置及存储介质 |
| CN110767224B (zh) * | 2019-10-15 | 2020-08-07 | 上海云从企业发展有限公司 | 一种基于特征权级的业务管理方法、系统、设备和介质 |
| CN111125344B (zh) * | 2019-12-23 | 2023-09-05 | 新方正控股发展有限责任公司 | 相关词推荐方法和装置 |
| CN111460268B (zh) * | 2020-04-01 | 2023-04-07 | 杭州指令集智能科技有限公司 | 数据库查询请求的确定方法、装置和计算机设备 |
| CN114328572A (zh) * | 2020-09-28 | 2022-04-12 | 北京鸿享技术服务有限公司 | 基于sql解析器的数据查询方法、装置、系统及介质 |
| CN116257543A (zh) * | 2021-12-10 | 2023-06-13 | 顺丰科技有限公司 | 数据表查询方法、装置、设备及计算机可读存储介质 |
| CN115759847A (zh) * | 2022-11-23 | 2023-03-07 | 中国电信股份有限公司 | 双随机抽取方法、装置、电子设备及存储介质 |
| CN116361361A (zh) * | 2023-04-17 | 2023-06-30 | 中国建设银行股份有限公司 | 数据处理方法、装置、设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103544266A (zh) * | 2013-10-16 | 2014-01-29 | 北京奇虎科技有限公司 | 一种搜索建议词生成的方法以及装置 |
| CN103593410A (zh) * | 2013-10-22 | 2014-02-19 | 上海交通大学 | 通过替换概念性词语进行搜索推荐系统 |
| CN103885966A (zh) * | 2012-12-20 | 2014-06-25 | 北京京东尚科信息技术有限公司 | 电子商务交易平台中的问答交互方法和系统 |
| CN104933100A (zh) * | 2015-05-28 | 2015-09-23 | 北京奇艺世纪科技有限公司 | 关键词推荐方法和装置 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002288201A (ja) * | 2001-03-23 | 2002-10-04 | Fujitsu Ltd | 質問応答処理方法,質問応答処理プログラム,質問応答処理プログラム記録媒体および質問応答処理装置 |
| CN104503978B (zh) * | 2014-11-26 | 2018-02-13 | 百度在线网络技术(北京)有限公司 | 一种相关实体推荐方法和系统 |
| CN104462429B (zh) * | 2014-12-12 | 2017-12-22 | 北京国双科技有限公司 | 数据库查询语句的生成方法及装置 |
| CN104657440B (zh) * | 2015-01-30 | 2020-05-15 | 欧阳江 | 结构化查询语句生成系统及方法 |
| CN104657439B (zh) * | 2015-01-30 | 2019-12-13 | 欧阳江 | 用于自然语言精准检索的结构化查询语句生成系统及方法 |
-
2015
- 2015-12-25 CN CN201510994506.3A patent/CN105868255A/zh active Pending
-
2016
- 2016-07-07 WO PCT/CN2016/089280 patent/WO2017107457A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103885966A (zh) * | 2012-12-20 | 2014-06-25 | 北京京东尚科信息技术有限公司 | 电子商务交易平台中的问答交互方法和系统 |
| CN103544266A (zh) * | 2013-10-16 | 2014-01-29 | 北京奇虎科技有限公司 | 一种搜索建议词生成的方法以及装置 |
| CN103593410A (zh) * | 2013-10-22 | 2014-02-19 | 上海交通大学 | 通过替换概念性词语进行搜索推荐系统 |
| CN104933100A (zh) * | 2015-05-28 | 2015-09-23 | 北京奇艺世纪科技有限公司 | 关键词推荐方法和装置 |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109471890A (zh) * | 2018-10-16 | 2019-03-15 | 深圳壹账通智能科技有限公司 | 报表文件的生成方法、终端设备及介质 |
| CN111522840B (zh) * | 2020-04-27 | 2023-08-11 | 平安科技(深圳)有限公司 | 标签的配置方法、装置、设备及计算机可读存储介质 |
| CN111522840A (zh) * | 2020-04-27 | 2020-08-11 | 平安科技(深圳)有限公司 | 标签的配置方法、装置、设备及计算机可读存储介质 |
| CN112132628A (zh) * | 2020-09-28 | 2020-12-25 | 科大讯飞股份有限公司 | 一种用户意图预测方法、信息推荐方法及相关设备 |
| CN113672457A (zh) * | 2021-08-09 | 2021-11-19 | 支付宝(杭州)信息技术有限公司 | 识别数据库中的异常操作的方法和装置 |
| CN114397967A (zh) * | 2022-01-07 | 2022-04-26 | 山东浪潮科学研究院有限公司 | 一种数据库的辅助输入关键字自动联想方法 |
| CN114969450A (zh) * | 2022-04-19 | 2022-08-30 | 北京优特捷信息技术有限公司 | 一种用户行为分析方法、装置、设备及存储介质 |
| CN114969450B (zh) * | 2022-04-19 | 2023-06-27 | 北京优特捷信息技术有限公司 | 一种用户行为分析方法、装置、设备及存储介质 |
| CN115186169A (zh) * | 2022-05-10 | 2022-10-14 | 兴业银行股份有限公司 | 数据及数据协作者推荐方法与系统 |
| CN117668373A (zh) * | 2024-02-02 | 2024-03-08 | 北京翼鸥教育科技有限公司 | 一种级联标签推荐方法、装置、电子设备及存储介质 |
| CN117668373B (zh) * | 2024-02-02 | 2024-05-17 | 北京翼鸥教育科技有限公司 | 一种级联标签推荐方法、装置、电子设备及存储介质 |
| CN118643217A (zh) * | 2024-06-28 | 2024-09-13 | 北京海新睿人工智能科技有限公司 | 一种增量式内容推荐方法、装置、介质和设备 |
| CN120216678A (zh) * | 2025-05-28 | 2025-06-27 | 杭州威灿科技有限公司 | 一种智能类案推荐方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105868255A (zh) | 2016-08-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2017107457A1 (zh) | 查询推荐方法及装置 | |
| JP7186871B2 (ja) | 自然言語構造を使用したデータ視覚化の詳細レベルの判定 | |
| CN107257970B (zh) | 从结构化和非结构化数据源进行的问题回答 | |
| US20170185673A1 (en) | Method and Electronic Device for QUERY RECOMMENDATION | |
| US10025819B2 (en) | Generating a query statement based on unstructured input | |
| US9652799B2 (en) | Product recommendation with product review analysis | |
| US9846901B2 (en) | Product recommendation with ontology-linked product review | |
| US10042896B2 (en) | Providing search recommendation | |
| KR101793222B1 (ko) | 어플리케이션 검색들을 가능하게 하기 위해 사용되는 검색 인덱스의 업데이트 | |
| CN104252533B (zh) | 搜索方法和搜索装置 | |
| US9672251B1 (en) | Extracting facts from documents | |
| US20160180217A1 (en) | Question answering with entailment analysis | |
| US10152478B2 (en) | Apparatus, system and method for string disambiguation and entity ranking | |
| US9311372B2 (en) | Product record normalization system with efficient and scalable methods for discovering, validating, and using schema mappings | |
| WO2019114430A1 (zh) | 自然语言提问的理解方法、装置及电子设备 | |
| KR20180126577A (ko) | 관련 엔티티 탐색 | |
| US20180246880A1 (en) | System for generating synthetic sentiment using multiple points of reference within a hierarchical head noun structure | |
| US20220365956A1 (en) | Method and apparatus for generating patent summary information, and electronic device and medium | |
| US20130110594A1 (en) | Ad copy determination | |
| WO2014114175A1 (zh) | 一种提供搜索引擎标签的方法和装置 | |
| US10037379B2 (en) | Voice input and output database search method and device | |
| JP2020144846A (ja) | ウェブページサーチ方法及びコンピュータ可読記憶媒体 | |
| CN102982072A (zh) | 一种可视化概念检测器及构造语义场的方法 | |
| JPWO2016189594A1 (ja) | 不満情報処理装置及びシステム | |
| Quarteroni et al. | Evaluating Multi-focus Natural Language Queries over Data Services. |
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: 16877269 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16877269 Country of ref document: EP Kind code of ref document: A1 |