CN115964384A - Data query method and device, electronic equipment and computer readable medium - Google Patents

Data query method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN115964384A
CN115964384A CN202310033975.3A CN202310033975A CN115964384A CN 115964384 A CN115964384 A CN 115964384A CN 202310033975 A CN202310033975 A CN 202310033975A CN 115964384 A CN115964384 A CN 115964384A
Authority
CN
China
Prior art keywords
preset
keywords
query
determining
knowledge base
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
CN202310033975.3A
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202310033975.3A priority Critical patent/CN115964384A/en
Publication of CN115964384A publication Critical patent/CN115964384A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data query method, a data query device, electronic equipment and a computer readable medium, which relate to the technical field of artificial intelligence, wherein a specific implementation mode comprises the steps of receiving a data query request, obtaining corresponding query sentences and identifying key words in the query sentences; determining a corresponding preset keyword knowledge base according to the keywords; calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number; and determining the type of the query result based on the matched preset keywords and the matching number, and further generating and outputting corresponding query result information. Therefore, the data query efficiency and accuracy can be improved, and the service processing efficiency of workers can be improved.

Description

Data query method and device, electronic equipment and computer readable medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a data query method and apparatus, an electronic device, and a computer-readable medium.
Background
In the query process of numerous reports and indexes of the parallel table system, the query is tedious and the result is slow due to reasons such as poor coupling between the systems, and business personnel still need to wait for loading of all reports to display under the condition of only one index, so that the data query efficiency is low and the accuracy is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a data query method, an apparatus, an electronic device, and a computer-readable medium, which can solve the problem of low data query efficiency and accuracy in the existing table merging system.
To achieve the above object, according to an aspect of an embodiment of the present application, there is provided a data query method including:
receiving a data query request, acquiring a corresponding query statement, and identifying a keyword in the query statement;
determining a corresponding preset keyword knowledge base according to the keywords;
calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number;
and determining the type of the query result based on the matched preset keywords and the matched number, and further generating and outputting corresponding query result information.
Optionally, identifying keywords in the query statement comprises:
calling a natural language processing program to perform word segmentation on the query statement so as to generate each word segmentation statement;
determining the occurrence rate of each word segmentation sentence in a preset knowledge base, and further determining a target word segmentation sentence according to the occurrence rate;
and determining key words in the query sentence according to the target word segmentation sentence.
Optionally, determining a corresponding preset keyword knowledge base includes:
determining a service type corresponding to the keyword;
and determining a corresponding preset keyword knowledge base according to the service type.
Optionally, matching the keyword with each preset keyword in a preset keyword knowledge base includes:
calculating cosine similarity between the keywords and each preset keyword in a preset keyword knowledge base;
and matching the keywords with all preset keywords in a preset keyword knowledge base according to the cosine similarity.
Optionally, determining the matched preset keywords and the matching number includes:
determining preset keywords with cosine similarity exceeding a preset threshold in a preset keyword knowledge base as target preset keywords;
determining a target preset keyword as a preset keyword matched with the keyword;
and acquiring the number of the target preset keywords, and determining the number as the matching number.
Optionally, generating and outputting corresponding query result information, including:
in response to that the matched preset keywords correspond to the query indexes or the report and the matching number is greater than 1, sequencing the matched preset keywords and sequentially outputting the corresponding matched preset keywords and the corresponding query values;
and generating and outputting a link pointing to the corresponding query interface based on the query value.
Optionally, generating and outputting corresponding query result information, including:
and responding to the matched preset keywords corresponding to the operation on the process, and outputting a corresponding link of the system operation interface.
In addition, the present application also provides a data query apparatus, including:
the receiving unit is configured to receive a data query request, acquire a corresponding query statement and identify a keyword in the query statement;
a knowledge base determination unit configured to determine a corresponding preset keyword knowledge base according to the keywords;
the matching unit is configured to call a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determine the matched preset keywords and the matching number;
and the data query unit is configured to determine a query result type based on the matched preset keywords and the matched number, and further generate and output corresponding query result information.
Optionally, the receiving unit is further configured to:
calling a natural language processing program to perform word segmentation on the query statement so as to generate each word segmentation statement;
determining the occurrence rate of each word segmentation sentence in a preset knowledge base, and further determining a target word segmentation sentence according to the occurrence rate;
and determining key words in the query sentence according to the target word segmentation sentence.
Optionally, the knowledge base determination unit is further configured to:
determining a service type corresponding to the keyword;
and determining a corresponding preset keyword knowledge base according to the service type.
Optionally, the matching unit is further configured to:
calculating cosine similarity between the keywords and each preset keyword in a preset keyword knowledge base;
and matching the keywords with all preset keywords in a preset keyword knowledge base according to the cosine similarity.
Optionally, the matching unit is further configured to:
determining preset keywords with cosine similarity exceeding a preset threshold in a preset keyword knowledge base as target preset keywords;
determining a target preset keyword as a preset keyword matched with the keyword;
and acquiring the number of the target preset keywords, and determining the number as the matching number.
Optionally, the data querying unit is further configured to:
in response to that the matched preset keywords correspond to the query index or the report and the matching number is greater than 1, sequencing the matched preset keywords and sequentially outputting the corresponding matched preset keywords and the corresponding query values;
and generating and outputting a link pointing to the corresponding query interface based on the query value.
Optionally, the data querying unit is further configured to:
and responding to the matched preset keywords corresponding to the operation on the process, and outputting a corresponding link of the system operation interface.
In addition, the present application also provides a data query electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the data query method as described above.
In addition, the present application also provides a computer readable medium, on which a computer program is stored, which when executed by a processor implements the data query method as described above.
To achieve the above object, according to still another aspect of embodiments of the present application, there is provided a computer program product.
A computer program product according to an embodiment of the present application includes a computer program, and when the computer program is executed by a processor, the computer program implements the data query method according to an embodiment of the present application.
One embodiment of the above invention has the following advantages or benefits: the method comprises the steps of obtaining a corresponding query statement and identifying a keyword in the query statement by receiving a data query request; determining a corresponding preset keyword knowledge base according to the keywords; calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number; and determining the type of the query result based on the matched preset keywords and the matched number, and further generating and outputting corresponding query result information. Therefore, the data query efficiency and accuracy can be improved, and the service processing efficiency of workers is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a further understanding of the application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a schematic diagram of a main flow of a data query method according to one embodiment of the present application;
FIG. 2 is a schematic diagram of a main flow of a data query method according to one embodiment of the present application;
FIG. 3 is a schematic flow chart diagram of a data query method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of the main elements of a data query device according to an embodiment of the present application;
FIG. 5 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
fig. 6 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application to assist in understanding, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that, in the technical solution of the present application, the aspects of collecting, analyzing, using, transmitting, storing, etc. of the related user personal information all conform to the regulations of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside the aspects of legal use, etc., and are under the supervision and management of the supervision department. Necessary measures should be taken for the personal information of the user to prevent illegal access to such personal information data, ensure that personnel who have access to the personal information data comply with the regulations of relevant laws and regulations, and ensure the security of the personal information of the user. Once these user personal information data are no longer needed, the risk should be minimized by limiting or even prohibiting data collection and/or deleting data.
User privacy is protected by de-identifying data when used, including in certain related applications, such as by removing specific identifiers, controlling the amount or specificity of stored data, controlling how data is stored, and/or other methods of de-identifying when used.
Fig. 1 is a schematic diagram of a main flow of a data query method according to an embodiment of the present application, and as shown in fig. 1, the data query method includes:
step S101, receiving a data query request, acquiring a corresponding query statement, and identifying a keyword in the query statement.
In this embodiment, an execution subject (for example, a server) of the data query method may receive the data query request through a wired connection or a wireless connection. The data query request may be triggered by a query statement input by a user, for example. The query statement input by the user may be, for example, a name, an attribute, and the like of a query item, and the query statement is not specifically limited in this embodiment of the application. After receiving the data query request, the execution body may obtain a corresponding query statement, and analyze the query statement to extract a keyword in the query statement. The keywords in the query statement may be, for example, the subject and the shape in the query statement. The query statement may contain proper noun terms and their common abbreviations. The keywords in the query statement may be proper noun terms in the query statement, such as "income", which in banking refers to intermediate business income.
And S102, determining a corresponding preset keyword knowledge base according to the keywords.
Specifically, determining a corresponding preset keyword knowledge base includes: determining a service type corresponding to the keyword; and determining a corresponding preset keyword knowledge base according to the service type.
The executive body needs to determine the type of the service related to the keyword, such as banking service, after-sales service, questionnaire survey service, and the like.
After the service type related to the keyword is determined, a corresponding preset keyword knowledge base can be determined according to the service type. For example, when the type of the service related to the keyword is banking, the executing entity may determine the corresponding preset keyword knowledge base according to the banking. The predetermined keyword knowledge base corresponding to the banking business may be, for example, a bank proper noun term and a proper noun term abbreviated as a knowledge base.
Step S103, calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number.
Specifically, matching the keywords with each preset keyword in a preset keyword knowledge base includes: calculating cosine similarity between the keywords and each preset keyword in a preset keyword knowledge base; and matching the keywords with all preset keywords in a preset keyword knowledge base according to the cosine similarity.
The execution subject may map the keywords in the query sentence to first vectors in a real number domain by using a word embedding method, and map each preset keyword in the preset keyword knowledge base to each second vector in the real number domain by using the word embedding method, respectively. Then, the execution subject may calculate cosine similarities between the first vector and the respective second vectors, respectively. And sequencing the cosine similarity, and determining each preset keyword matched with the keyword in the query sentence according to the sequenced cosine similarity. For example, the preset keywords corresponding to the cosine similarity of the ranked top n (for example, top 2, top 3, and top 4, etc., and the value of n is not specifically limited in this embodiment of the present application) are determined as the preset keywords matching the keywords in the query statement.
Specifically, determining the matched preset keywords and the matching number comprises the following steps: determining preset keywords of which the cosine similarity exceeds a preset threshold (for example, 0.8 or 0.95, which is not specifically limited in the embodiment of the present application) in a preset keyword knowledge base as target preset keywords; determining a target preset keyword as a preset keyword matched with the keyword; and acquiring the number of the target preset keywords, and determining the number as the matching number.
Illustratively, the cosine similarity degree is sorted in a descending order of 0.95, 0.90, 0.85, 0.80, and 0.60, and the corresponding preset keywords are preset keyword 1, preset keyword 2, preset keyword 3, preset keyword 4, and preset keyword 5, respectively. The execution subject may determine, as the target preset keyword, the preset keyword 1, the preset keyword 2, and the preset keyword 3 corresponding to the cosine similarity exceeding 0.8, and determine that the number of the target preset keyword is 4, that is, the matching number is 4.
And step S104, determining the type of the query result based on the matched preset keywords and the matching number, and further generating and outputting corresponding query result information.
Specifically, generating and outputting corresponding query result information includes:
in response to that the matched preset keywords correspond to the query indexes or the report and the matching number is greater than 1, sequencing the matched preset keywords and sequentially outputting the corresponding matched preset keywords and the corresponding query values; and generating and outputting a link pointing to the corresponding query interface based on the query value.
For example, when the execution subject determines that the query required by the user is an index or a report based on the matched preset keyword, the corresponding preset keyword knowledge base may be a preset index vocabulary or a preset report vocabulary, specifically, the cosine similarity may be used to match the keyword corresponding to the query sentence input by the user in the corresponding preset index vocabulary or preset report vocabulary, and when the matching degree exceeds 0.8, it is determined that the index vocabulary or the report vocabulary is successfully matched with the keyword in the preset index vocabulary or preset report vocabulary.
If one successfully matched index vocabulary or report vocabulary exists, returning the index or report corresponding to the successfully matched index vocabulary or report vocabulary (namely the matched preset keyword) (namely the query value corresponding to the matched preset keyword). If a plurality of successfully matched index vocabularies or report vocabularies exist (that is, if the matching number is greater than 1), the successfully matched index vocabularies or report vocabularies (namely, the matched preset keywords) and the corresponding index or report (namely, the corresponding query value) are returned from high to low (the number is not specifically limited in the embodiment of the application) according to the sequence of the matching degrees (for example, the cosine similarity), and the interface link of the query interface corresponding to the index or report obtained when the matching is successful (namely, the query value obtained when the matching is successful) can also be returned. If the corresponding index vocabulary or report vocabulary cannot be matched, firstly returning the vocabulary with the highest matching degree, and prompting the user to clearly inquire the content again and entering the next input process.
In the embodiment, a corresponding query statement is obtained by receiving a data query request, and a keyword in the query statement is identified; determining a corresponding preset keyword knowledge base according to the keywords; calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number; and determining the type of the query result based on the matched preset keywords and the matching number, and further generating and outputting corresponding query result information. Therefore, the data query efficiency and accuracy can be improved, and the service processing efficiency of workers is improved.
Fig. 2 is a schematic main flow diagram of a data query method according to an embodiment of the present application, and as shown in fig. 2, the data query method includes:
step S201, receiving a data query request, and acquiring a corresponding query statement.
The data query request may be triggered by a query statement input by a user, for example. The query statement input by the user may be, for example, a name, an attribute, and the like of a query item, and the query statement is not specifically limited in this embodiment of the application. After receiving the data query request, the execution body may obtain a corresponding query statement, and analyze the query statement to extract a keyword in the query statement. The keywords in the query statement may be, for example, the subject and the shape in the query statement. The query statement may include proper noun terms and common acronyms for proper noun terms. The keywords in the query statement may be proper noun terms in the query statement, such as "income", which in banking refers to intermediate business income.
Step S202, a natural language processing program is called to perform word segmentation on the query sentence so as to generate each word segmentation sentence.
The execution main body may call a Natural Language Processing (NLP) to extract information of the query statement, so as to implement word segmentation processing on the query statement, and specifically, may identify a named entity in the query statement to obtain each word segmentation statement. By way of example, the query statement is: 2480 Yuan white mobile phone information, white earphone, white tablet computer, each word segmentation sentence obtained after word segmentation can be: 2480 yuan, white, mobile phone, earphone, tablet computer, information, and condition.
Step S203, determining the occurrence rate of each participle sentence in a preset knowledge base, and further determining a target participle sentence according to the occurrence rate.
The preset knowledge base can be a knowledge base formed by all participle sentences or a knowledge base containing historical participle sentences, and the preset knowledge base is not specifically limited in the embodiment of the application. The word segmentation sentences with the occurrence rate higher than the preset number, for example, higher than 20 times are ignored, and the word segmentation sentences such as "information", "situation", and the like lack distinction and practical meaning. After ignoring the word segmentation sentences which lack distinctiveness and practical meaning, the rest word segmentation sentences, such as 2480 yuan, white, mobile phone, earphone and tablet computer, are determined as target word segmentation sentences.
Step S204, determining keywords in the query sentence according to the target word segmentation sentence.
The keyword in the query sentence may be a target participle sentence, or one or more vocabularies in the target participle sentence. For example, the dependency relationship between the words in the target participle sentence can be analyzed, and the keywords in the words in the target participle sentence can be determined according to the dependency relationship. For example, the similarity between each vocabulary in the target participle sentence and the preset vocabulary may be calculated, and the corresponding dependency relationship may be determined according to the calculated similarity, that is, the greater the similarity, the stronger the dependency relationship, and accordingly, the execution subject may determine the vocabulary in the target participle sentence corresponding to the maximum similarity as the keyword. The preset vocabulary can be determined according to actual conditions, and the embodiment of the application is not particularly limited to the preset vocabulary.
Step S205, according to the keywords, determining a corresponding preset keyword knowledge base.
Specifically, the type of the vocabulary corresponding to the keyword may be determined, for example, whether the vocabulary corresponds to a full-name vocabulary or a short-name vocabulary, and if the keyword corresponds to a short-name vocabulary, the predetermined keyword knowledge base corresponding to the service type corresponding to the keyword is determined from the predetermined keyword knowledge base formed by the short-name vocabulary.
Step S206, calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number.
The execution body may determine the type of keywords in the query statement, which may be business complements, for example. When the keyword type in the query sentence is the service addition word, similarity matching can be performed with the preset keyword which is the service addition word in the preset keyword knowledge base, so that matching workload is reduced, matching rate is improved, and matching quantity is determined according to the preset keyword obtained through matching. For example, the service supplementary word may be a keyword preset by a service person or a keyword which is abbreviated as the service supplementary word, and the service supplementary word is marked in a preset keyword knowledge base, so as to accelerate the matching rate in the subsequent use.
And step S207, determining the type of the query result based on the matched preset keywords and the matching number, and further generating and outputting corresponding query result information.
Specifically, generating and outputting corresponding query result information, including: and responding to the matched preset keywords corresponding to the operation on the process, and outputting a corresponding link of the system operation interface.
For example, when the user needs to operate the process and the execution subject accurately determines the user requirement, the corresponding link of the system operation interface may be returned. The user can enter the interface by clicking the link, and the problem that the system coupling is weak and the task can be completed by repeated operation is solved.
Fig. 3 is a schematic view of an application scenario of the data query method according to an embodiment of the present application. The data query method of the embodiment of the application can be applied to a scene of data query in a table combining system. As shown in fig. 3, a server (i.e., an execution subject of the embodiment of the present application) receives a data query request, obtains a corresponding query statement, and identifies a keyword in the query statement; the server determines a corresponding preset keyword knowledge base according to the keywords; the server calls a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determines the matched preset keywords and the matching number; and the server determines the type of the query result based on the matched preset keywords and the matched number, and further generates and outputs corresponding query result information.
In some embodiments of the present application, an execution subject (e.g., a server) may recognize semantics of a user input using a Convolutional Neural Network (CNN) method commonly used in Natural Language Processing (NLP), for example. The recognition output set is set to be four types of 'query indexes, query reports, entry modules and common question answers', and corresponds to four different business conditions respectively. In order to ensure the timeliness of the online language processing of the system, the embodiment of the application adopts the modes of offline training and online application. Before online, 2000 simulation input sentences are used for simulating possible input conditions of a user, and the model is pre-trained in advance online and returns to the user requirement categories (namely the four categories). When a user inputs a statement after the system is on line, the statement is directly judged to obtain the user requirement category, and the next step of processing is carried out according to the judgment result.
According to the embodiment of the application, the preset keyword knowledge base can be established before the data query request is received, wherein the establishment of the preset keyword knowledge base can have two ways, and the two methods can be combined for use. Firstly, batch import, namely, firstly, arranging and listing the names of all vocabularies in an index vocabulary, a report vocabulary and a function vocabulary in the existing system, and segmenting all the vocabularies. Taking the example of constructing the index vocabulary, neglecting vocabularies with the occurrence rate higher than 20 times, such as vocabularies with lack of distinction and actual semantics, such as 'situation', 'information', 'table', and the like. And (4) carrying out duplicate removal on the rest vocabularies, directly adding the index vocabularies, and marking the index vocabularies as system processing vocabularies. And secondly, adding service personnel, presetting keywords or short words by the service personnel, and checking whether the keywords are repeated with system processing vocabularies or not. If the repeated words are repeated, the repeated words are marked as service anaplerotic words. And adding the supplementary vocabularies of the rest service personnel into the vocabulary table of the corresponding type, and marking the supplementary vocabularies as service supplementary vocabularies. Accordingly, an index vocabulary, a report vocabulary and a function vocabulary are respectively constructed. If the same vocabulary appears in different vocabularies, the duplication elimination process is not needed. And integrating and de-duplicating the index vocabulary, the report vocabulary and the function vocabulary to form the vocabulary with weak pertinence and strong universality for common problems. Thus, a specialized vocabulary is established for keyword recognition.
When the keyword is identified, the content input by the user is identified, and the problem of the user is accurately positioned. First, natural Language Processing (NLP) classification is performed on a user input sentence, and the user's requirement and a created vocabulary are located. If one or more vocabularies reach the matching threshold (for example, the initial setting is 0.75) when matching, the best matching vocabulary is taken as the target vocabulary, and the steps of 'query index class', 'query report class' or 'query system operation class' are correspondingly carried out. If the user requirements cannot be matched, the method is processed according to the following steps, namely a common problem class.
Specifically, the embodiment of the present application uses cosine similarity to perform matching between the keyword and each vocabulary in the vocabulary table. And adjusting the modular length of the vector marked as the corresponding service supplement word to be 5, and fixing the modular lengths of other vectors to be 1. So that the service supplement words are easier to capture when being matched, and the matching rate is improved.
For example, when the keyword corresponds to the query index class and the query report class: when the execution main body identifies that the user needs to inquire the index and the report, the cosine similarity is used for matching the phrases input by the user in a preset index or report vocabulary. And the phrase with the matching degree exceeding 0.8 is regarded as successful matching. If a matching phrase is successful, the index or report form represented by the phrase is returned. If a plurality of matching phrases are successfully matched, returning the first five matching phrases from high to low according to the matching degree sequence. If the corresponding phrase can not be matched, firstly returning the word with the highest matching degree, prompting the user to clearly inquire the content again, and entering the next input process.
For example, when the keyword corresponds to the query system operation class: and recognizing that the user needs to enter the system function quickly, and matching the phrases input by the user in a preset function keyword library by using cosine similarity. And the phrase with the matching degree exceeding 0.8 is regarded as successful matching. And returning all the interface links successfully matched, and if a plurality of interface links are successfully matched, returning from high to low according to the matching degree. If the matching is not successful, prompting the user to clearly operate the content again and entering the next input process.
For example, when the keyword corresponds to a common question class: and if the input content of the user is identified to be a common problem or the user requirement cannot be matched, matching is carried out from the keyword library of the common problem. The thesaurus of common questions is a simple summary of the knowledge bases, with a lower threshold than the previous one (initially set to 0.6). If the matching is successful, returning a matching result and returning a corresponding index, report or system operation link. If the matching cannot be successfully carried out, the top five most frequently asked questions are selected from the previously built-in common questions as the return content.
By way of example, the returned results (i.e., query result information) may be classified into three types, as follows:
returning an index query value: and if the indexes queried by the user are successfully matched in the last step, returning index names and query values in each period of the last year. If a plurality of indexes are successfully matched at the same time, the index names and query values in each period are sequentially returned from high to low according to the matching degree. And finally returning a link of the query interface with each index. The requirement of one-step query and jump of the user is met.
Returning a report form and an index query interface: when a user queries the report or queries the index but needs to jump, the system returns the link corresponding to the report and the index. If the matching of a plurality of contents is successful at the same time, the contents are returned in sequence from high matching degree to low matching degree. The requirement that the user enters the query interface for detailed viewing in one step is met.
Returning to a system interface: when the user needs to operate the process and the intelligent query robot accurately judges the requirement, the corresponding link of the system operation interface can be returned. The user can enter the interface by clicking the link, and the problem that the system coupling is weak and the task can be completed by repeated operation is solved.
Fig. 4 is a schematic diagram of main units of a data query apparatus according to an embodiment of the present application. As shown in fig. 4, the data query apparatus 400 includes a receiving unit 401, a knowledge base determining unit 402, a matching unit 403, and a data query unit 404.
The receiving unit 401 is configured to receive a data query request, obtain a corresponding query statement, and identify a keyword in the query statement.
A knowledge base determining unit 402 configured to determine a corresponding preset keyword knowledge base according to the keywords.
A matching unit 403 configured to call the preset keyword knowledge base to match the keywords with respective preset keywords in the preset keyword knowledge base, thereby determining the matched preset keywords and the matching number.
And a data query unit 404 configured to determine a query result type based on the matched preset keywords and the matching number, and further generate and output corresponding query result information.
In some embodiments, the receiving unit 401 is further configured to: calling a natural language processing program to perform word segmentation on the query statement so as to generate each word segmentation statement; determining the occurrence rate of each word segmentation sentence in a preset knowledge base, and further determining a target word segmentation sentence according to the occurrence rate; and determining key words in the query sentence according to the target word segmentation sentence.
In some embodiments, the knowledge base determination unit 402 is further configured to: determining a service type corresponding to the keyword; and determining a corresponding preset keyword knowledge base according to the service type.
In some embodiments, the matching unit 403 is further configured to: calculating cosine similarity between the keywords and each preset keyword in a preset keyword knowledge base; and matching the keywords with all preset keywords in a preset keyword knowledge base according to the cosine similarity.
In some embodiments, the matching unit 403 is further configured to: determining preset keywords with cosine similarity exceeding a preset threshold in a preset keyword knowledge base as target preset keywords; determining a target preset keyword as a preset keyword matched with the keyword; and acquiring the number of the target preset keywords, and determining the number as the matching number.
In some embodiments, the data querying unit 404 is further configured to: in response to that the matched preset keywords correspond to the query index or the report and the matching number is greater than 1, sequencing the matched preset keywords and sequentially outputting the corresponding matched preset keywords and the corresponding query values; and generating and outputting a link pointing to the corresponding query interface based on the query value.
In some embodiments, the data querying unit 404 is further configured to: and responding to the matched preset keywords corresponding to the operation on the process, and outputting a corresponding link of the system operation interface.
It should be noted that the data query method and the data query apparatus of the present application have corresponding relationships in the specific implementation contents, and therefore, the repeated contents are not described again.
Fig. 5 shows an exemplary system architecture 500 to which the data query method or the data query apparatus according to the embodiment of the present application may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is the medium used to provide communication links between terminal devices 501, 502, 503 and the server 505. Network 504 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having data query processing screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for data query requests submitted by users using the terminal devices 501, 502, 503. The background management server can receive the data query request, acquire a corresponding query statement and identify a keyword in the query statement; determining a corresponding preset keyword knowledge base according to the keywords; calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number; and determining the type of the query result based on the matched preset keywords and the matched number, and further generating and outputting corresponding query result information. Therefore, the data query efficiency and accuracy can be improved, and the service processing efficiency of workers can be improved.
It should be noted that the data query method provided in the embodiment of the present application is generally executed by the server 505, and accordingly, the data query apparatus is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a terminal device of an embodiment of the present application. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the computer system 600 are also stored. The CPU601, ROM602, and RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output section 607 including a signal processing section such as a Cathode Ray Tube (CRT), a liquid crystal credit authorization inquiry processor (LCD), and the like, and a speaker and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to embodiments disclosed herein, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments disclosed herein include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a knowledge base determining unit, a matching unit, and a data querying unit. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs, and when the one or more programs are executed by the device, the device receives a data query request, acquires a corresponding query statement, and identifies a keyword in the query statement; determining a corresponding preset keyword knowledge base according to the keywords; calling a preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number; and determining the type of the query result based on the matched preset keywords and the matched number, and further generating and outputting corresponding query result information. Therefore, the data query efficiency and accuracy can be improved, and the service processing efficiency of workers is improved.
The computer program product of the present application includes a computer program, and the computer program realizes the data query method in the embodiment of the present application when being executed by a processor.
According to the technical scheme of the embodiment of the application, the data query efficiency and the data query accuracy can be improved, and the business processing efficiency of workers is improved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A method of querying data, comprising:
receiving a data query request, acquiring a corresponding query statement, and identifying a keyword in the query statement;
determining a corresponding preset keyword knowledge base according to the keywords;
calling the preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, and further determining the matched preset keywords and the matching number;
and determining the type of the query result based on the matched preset keywords and the matching number, and further generating and outputting corresponding query result information.
2. The method of claim 1, wherein the identifying keywords in the query statement comprises:
calling a natural language processing program to perform word segmentation on the query statement so as to generate each word segmentation statement;
determining the occurrence rate of each word segmentation sentence in a preset knowledge base, and further determining a target word segmentation sentence according to the occurrence rate;
and determining the key words in the query sentence according to the target word segmentation sentence.
3. The method of claim 1, wherein determining the corresponding knowledge base of predetermined keywords comprises:
determining a service type corresponding to the keyword;
and determining a corresponding preset keyword knowledge base according to the service type.
4. The method of claim 1, wherein matching the keyword with each of the predetermined keywords in the predetermined keyword knowledge base comprises:
calculating cosine similarity between the keywords and each preset keyword in the preset keyword knowledge base;
and matching the keywords with all preset keywords in a preset keyword knowledge base according to the cosine similarity.
5. The method of claim 1, wherein the determining the matched preset keywords and the matching number comprises:
determining the preset keywords with cosine similarity exceeding a preset threshold in the preset keyword knowledge base as target preset keywords;
determining the target preset keyword as a preset keyword matched with the keyword;
and acquiring the number of the target preset keywords, and determining the number as the matching number.
6. The method of claim 1, wherein generating and outputting the corresponding query result information comprises:
in response to that the matched preset keywords correspond to query indexes or reports and the matching number is greater than 1, sequencing the matched preset keywords and sequentially outputting the corresponding matched preset keywords and corresponding query values;
and generating and outputting a link pointing to the corresponding query interface based on the query value.
7. The method of claim 1, wherein generating and outputting corresponding query result information comprises:
and responding to the matched preset keywords corresponding to the operation on the process, and outputting corresponding links of the system operation interface.
8. A data query apparatus, comprising:
the device comprises a receiving unit, a query unit and a query unit, wherein the receiving unit is configured to receive a data query request, acquire a corresponding query statement and identify a keyword in the query statement;
a knowledge base determining unit configured to determine a corresponding preset keyword knowledge base according to the keywords;
a matching unit configured to call the preset keyword knowledge base to match the keywords with each preset keyword in the preset keyword knowledge base, thereby determining the matched preset keywords and the matching number;
and the data query unit is configured to determine a query result type based on the matched preset keywords and the matching number, and then generate and output corresponding query result information.
9. The apparatus of claim 8, wherein the receiving unit is further configured to:
calling a natural language processing program to perform word segmentation on the query statement so as to generate each word segmentation statement;
determining the occurrence rate of each word segmentation sentence in a preset knowledge base, and further determining a target word segmentation sentence according to the occurrence rate;
and determining key words in the query sentence according to the target word segmentation sentence.
10. The apparatus of claim 8, wherein the knowledge base determination unit is further configured to:
determining a service type corresponding to the keyword;
and determining a corresponding preset keyword knowledge base according to the service type.
11. The apparatus of claim 8, wherein the matching unit is further configured to:
calculating cosine similarity between the keywords and each preset keyword in the preset keyword knowledge base;
and matching the keywords with all preset keywords in a preset keyword knowledge base according to the cosine similarity.
12. The apparatus of claim 8, wherein the matching unit is further configured to:
determining the preset keywords with cosine similarity exceeding a preset threshold in the preset keyword knowledge base as target preset keywords;
determining the target preset keyword as a preset keyword matched with the keyword;
and acquiring the number of the target preset keywords, and determining the number as the matching number.
13. The apparatus of claim 8, wherein the data query unit is further configured to:
in response to that the matched preset keywords correspond to query indexes or reports and the matching number is greater than 1, sequencing the matched preset keywords and sequentially outputting the corresponding matched preset keywords and corresponding query values;
and generating and outputting a link pointing to the corresponding query interface based on the query value.
14. A data query electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
15. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1-7.
16. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any one of claims 1-7.
CN202310033975.3A 2023-01-10 2023-01-10 Data query method and device, electronic equipment and computer readable medium Pending CN115964384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310033975.3A CN115964384A (en) 2023-01-10 2023-01-10 Data query method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310033975.3A CN115964384A (en) 2023-01-10 2023-01-10 Data query method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN115964384A true CN115964384A (en) 2023-04-14

Family

ID=87360156

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310033975.3A Pending CN115964384A (en) 2023-01-10 2023-01-10 Data query method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN115964384A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116431930A (en) * 2023-06-13 2023-07-14 天津联创科技发展有限公司 Technological achievement conversion data query method, system, terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116431930A (en) * 2023-06-13 2023-07-14 天津联创科技发展有限公司 Technological achievement conversion data query method, system, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN108153901B (en) Knowledge graph-based information pushing method and device
CN107491534B (en) Information processing method and device
US11645517B2 (en) Information processing method and terminal, and computer storage medium
US10671684B2 (en) Method and apparatus for identifying demand
CN106960030B (en) Information pushing method and device based on artificial intelligence
CN112035599B (en) Query method and device based on vertical search, computer equipment and storage medium
CN110362601B (en) Metadata standard mapping method, device, equipment and storage medium
EP3579119A1 (en) Method and apparatus for recognizing event information in text
WO2020206910A1 (en) Product information pushing method, apparatus, computer device, and storage medium
CN116882372A (en) Text generation method, device, electronic equipment and storage medium
CN110362662A (en) Data processing method, device and computer readable storage medium
CN115964384A (en) Data query method and device, electronic equipment and computer readable medium
CN113590756A (en) Information sequence generation method and device, terminal equipment and computer readable medium
CN109918420B (en) Competitor recommendation method and server
CN110765357A (en) Method, device and equipment for searching online document and storage medium
CN114817346A (en) Service processing method and device, electronic equipment and computer readable medium
CN115905497A (en) Method, device, electronic equipment and storage medium for determining reply sentence
CN111368036B (en) Method and device for searching information
CN114020896A (en) Intelligent question and answer method, system, electronic equipment and storage medium
KR102308521B1 (en) Method and device for updating information
CN113095078A (en) Associated asset determination method and device and electronic equipment
CN112926295A (en) Model recommendation method and device
CN113761183A (en) Intention recognition method and intention recognition device
CN111782776A (en) Method and device for realizing intention identification through slot filling
CN116561288B (en) Event query method, device, computer equipment, storage medium and program product

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