CN108614842A - The method and apparatus for inquiring data - Google Patents

The method and apparatus for inquiring data Download PDF

Info

Publication number
CN108614842A
CN108614842A CN201611148714.2A CN201611148714A CN108614842A CN 108614842 A CN108614842 A CN 108614842A CN 201611148714 A CN201611148714 A CN 201611148714A CN 108614842 A CN108614842 A CN 108614842A
Authority
CN
China
Prior art keywords
node
label
condition
query set
keyword
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.)
Granted
Application number
CN201611148714.2A
Other languages
Chinese (zh)
Other versions
CN108614842B (en
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201611148714.2A priority Critical patent/CN108614842B/en
Publication of CN108614842A publication Critical patent/CN108614842A/en
Application granted granted Critical
Publication of CN108614842B publication Critical patent/CN108614842B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a kind of method and apparatus of inquiry data.Wherein, this method includes:Query set in presetting database is matched with the logical condition in interface requests to be checked, obtains the correspondence between query set and logical condition;According to preset format transfer algorithm, correspondence is converted to the querying condition of corresponding interface requests to be checked;It is inquired according to querying condition, obtains the data of corresponding querying condition.The present invention is solved since the number of query word in the related technology is limited, the low technical problem of caused query result accuracy rate.

Description

The method and apparatus for inquiring data
Technical field
The present invention relates to Internet technology application fields, in particular to a kind of method and apparatus of inquiry data.
Background technology
At present for the accuracy problem of data query, it always is that one is centered around the important of data query direction and asks Topic, related content as will be seen below are the same.
For microblog data inquiry, existing business is according to a large and complete querying condition set (following abbreviations Query collection) in condition, the data of match query condition from own database, and this set of circumstances configuration it is more multiple It is miscellaneous, if a condition for meeting certain inquiry content will be newly added in new demand, need again to this large and complete condition set New querying condition is added in conjunction.Currently in order to improving the data accuracy for specifying data source (microblog data source), therefore think directly The interface provided from microblogging side, directly inquires the content of microblog list for meeting existing business Query collection.
And existing Query set is directly used on the required parameter for calling microblogging interface, then it can not be accurate Return data to be obtained accuracy.
Wherein, when asking certain specified query interface, incoming required parameter is needed, passes through the logical combination to parameter, It can just inquire wanting to inquire as a result, and the parameter of query logic must be within the limitation of the query word number of restriction, otherwise The result inquired is not accurate enough.
For above-mentioned since the number of query word in the related technology is limited, the low problem of caused query result accuracy rate, Currently no effective solution has been proposed.
Invention content
An embodiment of the present invention provides a kind of method and apparatus of inquiry data, at least to solve due to looking into the related technology The number for asking word is limited, the low technical problem of caused query result accuracy rate.
One side according to the ... of the embodiment of the present invention provides a kind of method of inquiry data, including:By presetting database In query set matched with the logical condition in interface requests to be checked, obtain corresponding between query set and logical condition Relationship;According to preset format transfer algorithm, correspondence is converted to the querying condition of corresponding interface requests to be checked;Foundation is looked into Inquiry condition is inquired, and the data of corresponding querying condition are obtained.
Optionally, the query set in presetting database is matched with the logical condition in interface requests to be checked, is obtained Include to the correspondence between query set and logical condition:Extract the node of each type in query set;In query set The corresponding node of node with each type is to label;The logical condition of label and interface requests to be checked is carried out according to node Matching, obtains correspondence of the node between label and the logical condition of interface requests to be checked.
Further, optionally, node includes at least label:Root node label, with node label or node label and Non- node label;Logical condition includes at least:With or with non-.
Optionally, according to preset format transfer algorithm, correspondence is converted to the inquiry of corresponding interface requests to be checked Condition includes:Judge whether the keyword number in query set is more than predetermined threshold value;In the case where the judgment result is yes, respectively It extracts in query set or node label, or, the first element in non-node label, and according to the first Element generation inquiry extracted Condition;It, will be with node label or node label, or, non-node label according to correspondence in the case where judging result is no In keyword carry out traversal splicing, obtain querying condition.
Further, optionally, respectively extract query set in or node label or non-node label in the first element, and according to Include according to the first Element generation querying condition extracted:In the case where the first element is keyword, traversal or node label In keyword and non-node label in keyword;Point extraction query set in or node label, or, the pass in non-node label Keyword;Pair or node label and non-node label in keyword by combination splice, obtain at least one querying condition.
Optionally, before whether the keyword number in judging query set is more than predetermined threshold value, this method further includes:According to The keyword number concentrated according to default counter statistical query;Create list collection and with node label object, wherein list collection It closes, for storing in correspondence that traversal obtains and the keyword storage form in node label;With node label object, use According to list collection and corresponding character string formation dictionary.
Another aspect according to the ... of the embodiment of the present invention additionally provides a kind of device of inquiry data, including:Matching module, For matching the query set in presetting database with the logical condition in interface requests to be checked, obtains query set and patrol Correspondence between the condition of collecting;Conversion module, for according to preset format transfer algorithm, correspondence being converted to correspondence and is waited for The querying condition of query interface request;Enquiry module obtains the number of corresponding querying condition for being inquired according to querying condition According to.
Optionally, matching module includes:Extraction unit, the node for extracting each type in query set;First matching Unit, the corresponding node of node for matching each type in query set is to label;Second matching unit, for according to knot Point matches label with the logical condition of interface requests to be checked, obtains node and patrols label and interface requests to be checked Correspondence between the condition of collecting.
Further, optionally, node includes at least label:Root node label, with node label or node label and Non- node label;Logical condition includes at least:With or with non-.
Optionally, conversion module includes:Judging unit, for judging it is default whether the keyword number in query set is more than Threshold value;First converting unit is extracted in query set or node label respectively in the case where the judgment result is yes, or, non- First element in node label, and according to the first Element generation querying condition extracted;Second converting unit, for judging It as a result, will be with node label or node label, or, the keyword in non-node label according to correspondence in the case of being no Traversal splicing is carried out, querying condition is obtained.
In embodiments of the present invention, by by the logic item in query set and the interface requests to be checked in presetting database Part is matched, and the correspondence between query set and logical condition is obtained;According to preset format transfer algorithm, by correspondence Be converted to the querying condition of corresponding interface requests to be checked;It is inquired according to querying condition, obtains the number of corresponding querying condition According to having achieved the purpose that promote inquiry accuracy rate, to realize even if the limited technology for remaining to accurately inquire of query word number Effect, and then solve since the number of query word in the related technology is limited, the low technology of caused query result accuracy rate is asked Topic.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and is constituted part of this application, this hair Bright illustrative embodiments and their description are not constituted improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the flow diagram of the method for inquiry data according to the ... of the embodiment of the present invention;
Fig. 2 is the flow diagram of the device of inquiry data according to the ... of the embodiment of the present invention.
Specific implementation mode
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, " Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.It should be appreciated that using in this way Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover It includes to be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment to cover non-exclusive Those of clearly list step or unit, but may include not listing clearly or for these processes, method, product Or the other steps or unit that equipment is intrinsic.
Embodiment one
According to embodiments of the present invention, a kind of embodiment of the method for inquiry data is provided, it should be noted that in attached drawing The step of flow illustrates can execute in the computer system of such as a group of computer-executable instructions, although also, Logical order is shown in flow chart, but in some cases, it can be to execute shown different from sequence herein or retouch The step of stating.
Fig. 1 is the flow diagram of the method for inquiry data according to the ... of the embodiment of the present invention, as shown in Figure 1, this method packet Include following steps:
Step S102 matches the query set in presetting database with the logical condition in interface requests to be checked, Obtain the correspondence between query set and logical condition;
Correspondence is converted to looking into for corresponding interface requests to be checked by step S104 according to preset format transfer algorithm Inquiry condition;
Step S106 is inquired according to querying condition, obtains the data of corresponding querying condition.
From the foregoing, it will be observed that the query set in the method for inquiry data provided by the embodiments of the present application in presetting database can be Querying condition set, that is, Query collection, the method for inquiry data provided by the embodiments of the present application is by putting down Query collection with media Logical condition in the request of platform query interface is matched (that is, patrolling in interface requests to be checked provided by the embodiments of the present application The condition of collecting), after obtaining one-to-one relationship, by format conversion algorithms, which is converted into corresponding this and is waited for The querying condition of query interface request, and then inquired according to the querying condition, the corresponding data of the querying condition are obtained, this In it should be noted that it is provided by the embodiments of the present application inquiry data method by optimize Query collection, passing through format conversion After algorithm, obtained querying condition is stored in the parameter list being generated in advance to presetting database, the querying condition will be stored Parameter list execute inquiry operation as new " Query collection " so that new " the Query collection " after format conversion meet it is to be checked Interface requests are ask, evades and is intended to obtain since inquiry caused by the direct use of Query collection can not be returned accurately in the prior art Access evidence, to which the method for inquiry data provided by the embodiments of the present application improves inquiry precision.
It is provided in an embodiment of the present invention inquiry data method in, by by presetting database query set with it is to be checked The logical condition ask in interface requests is matched, and the correspondence between query set and logical condition is obtained;According to default lattice Correspondence is converted to the querying condition of corresponding interface requests to be checked by formula transfer algorithm;It is inquired according to querying condition, Obtain the data of corresponding querying condition, achieved the purpose that promote inquiry accuracy rate, to realize even if query word number by Limit remains to the technique effect accurately inquired, and then solves since the number of query word in the related technology is limited, caused inquiry As a result the low technical problem of accuracy rate.
Optionally, in step S102 by the logical condition in query set and the interface requests to be checked in presetting database into Row matching, the correspondence obtained between query set and logical condition include:
Step1 extracts the node of each type in query set;
Step2 matches the corresponding node of node of each type to label in query set;
Step3 matches label with the logical condition of interface requests to be checked according to node, obtains node to label Correspondence between the logical condition of interface requests to be checked.
Further, optionally, node includes at least label:Root node label, with node label or node label and Non- node label;Logical condition includes at least:With or with non-.
Optionally, according to preset format transfer algorithm in step S104, correspondence is converted into corresponding interface to be checked The querying condition of request includes:
Step1, judges whether the keyword number in query set is more than predetermined threshold value;
Step2, in the case where the judgment result is yes, respectively extract query set in or node label, or, non-node label In the first element, and according to the first Element generation querying condition for extracting;
Step3, judging result be it is no in the case of, according to correspondence will with node label or node label, or, Keyword in non-node label carries out traversal splicing, obtains querying condition.
Further, optionally, it is extracted respectively in query set in the Step2 in step S104 or node label or non-node First element in label, and include according to the first Element generation querying condition extracted:
Step A, in the case where the first element is keyword, the keyword in traversal or node label and non-node label In keyword;
Step A, point extraction query set in or node label, or, the keyword in non-node label;
Step C, pair or node label and non-node label in keyword by combination splice, obtain at least one look into Inquiry condition.
Optionally, judge whether the keyword number in query set is more than predetermined threshold value in the Step1 in step S104 Before, the method for inquiry data provided by the embodiments of the present application further includes:
Step1 ', according to the keyword number for presetting counter statistical query concentration;
Step2 ', create list collection and with node label object, wherein list collection, for storing in correspondence Traverse obtain with the keyword storage form in node label;With node label object, for according to list collection and right The character string answered forms dictionary.
Optionally, it is inquired in step s 106 according to querying condition, before obtaining the data of corresponding querying condition, this Apply for that the method for the inquiry data that embodiment provides further includes:
Querying condition is stored the parameter list being generated in advance into presetting database by step S105.
Further, optionally, it is inquired according to querying condition in step S106, obtains the data of corresponding querying condition Including:
Step1 is inquired according to the querying condition in parameter list, obtains the data of corresponding querying condition.
To sum up, the method for inquiry data provided by the embodiments of the present application is specific as follows:
Step1 creates the parameter list needed for storage inquiry microblogging interface, standard is done for the New Terms set after format conversion It is standby.
Step2 arranges the one-to-one relationship of Query collection and interface requests logical condition.
Step3, by format conversion algorithm, many condition Boolean query in Query collection is closed on the basis of Step2 System, which is converted into, meets request interface querying condition.
Step3 has been converted successful condition and stored to Step1 by Step4 by having developed the automated procedures of completion In in the parameter list that newly creates.
Wherein, in conjunction with above-mentioned Step1 to Step4, the method for inquiry data provided by the embodiments of the present application is specific as follows:
First, in Step1, the parameter list needed for storage inquiry microblogging interface is created, is the New Terms after format conversion Set is prepared.
According to increasing for service logic, the number of parameter equally can also increase, in order to meet the increase of greater demand condition, It is a necessary memory module to create a new parameter list individually stored.The type selecting of storage infrastructure is at present MySQL database can create entitled ConditionsQueryData tables under specified data library name.
Secondly, in Step2, the one-to-one relationship of Query collection and interface requests logical condition is arranged.
Current Query collection uses XML (Extensible Markup Language extensible markup languages) lattice Formula, because language thus have it is structural well, being capable of user-defined dada type structural junction.
The stored node concentrated to query is respectively root node, and node or node and non-node, and corresponding The corresponding node format of XML language be complete node to label, respectively<Root></Root>,<AndOperator></ AndOperator>,<OrOperater></OrOperater>,<NotOrOperater></NotOrOperater>Four knots Point is to label.Match query mainly carried out in microblogging blog article for request microblogging keyword interface, therefore above-mentioned node class Type just disclosure satisfy that the range of inquiry.
Interface requests logical expressions correspondence is as follows:
With:Space, such as A B.
Or:~indicate, such as A~B~C.
It is non-:Space-, such as A-B, there is shown B does not occur in existing A.
Mixed situation:(A B)~(C D) indicates occur A, B simultaneously or occur C, D simultaneously, A B-C expression and meanwhile occur A, B but there is not C.
Above-mentioned condition one-to-one relationship is as shown in table 1-1, due to being using Root labels as root node in Query concentrations It creates the condition of entire XML format, therefore there is no a correspondence.
Table 1-1
Again, in Step3, on the basis of second step, by format conversion algorithm, by many condition in Query collection Boolean query transformation is to meet request interface querying condition.
Keyword is the major part for forming querying condition, in the request condition of XML format is matched in each label The CDATA values set are then keyword associated between defined querying condition in the interface of request.As shown in table 1-2.
Table 1-2
In the more complicated of Query Integrated query logical conditions configuration, main complicated statement is the number in keyword In logical relation between keyword.The number of keyword is configured according to specific service inquiry logic on Query collection , and this number is also unascertainable.Interface requests parameter keyword configuration in, it is desirable that keyword number 5 keywords must be no more than, because being more than 5 keywords, when asking official's query interface of media platform, are returned Relevant microblog blog article data will be inaccurate.It is just necessary therefore in order to ensure the data accuracy of the microblogging blog article reacquired Ensure that the number of the condition conversion keyword of request interface is not more than 5.
In Qurey collection side, when conversion, first determines whether the sum of the number of all inter-node keywords, if the number of keyword No more than 5, then directly being converted correspondingly according to normal logical relation.If the number of keyword is more than 5 It is a, then needing to be converted according to following converting algorithm.
It is as follows to main modular involved in conversion process in program.
A count counter is defined first, for counting the keyword number in a querying condition.It creates The basic splicing construction that StringBuiler splices as condition.
Create a List set and an AndOperator object.List set is used for storing traversing from XML file The keyword storage form of AndOperator inter-nodes out.AndOperator object definitions are Dictionary< string,List<string>>, wherein dictionary key indicate AndOperator inter-nodes OrOperator or NotOrOperator nodes, and the value in dictionary is then the keyword under the node that is stored.As following listed XML tables Show form.
When count is less than or equal to 5, the data in AndOperator objects are obtained according to XML nodes and are converted, root According to the key of dictionary, traversal splices the keyword under OrOperator and NotOrOperator nodes, passes through StringBuiler bases Plinth structure, according to the correspondence of table 1-1, keyword is converted respectively splicing.
When count is more than 5, first member in dictionary OrOperator or NotOrOperator value is taken respectively Element is spliced, after splicing a condition, respectively by the element just used from List<string>Middle deletion, is equivalent in this way The number for reducing keyword, has achieved the effect that rapid conversion.Specifically it can understand this partial content according to following Examples.
The structure of Qurey collection is as follows, illustrates the representation of existing Query collection XML:
Then the corresponding querying condition for being converted into interface is as follows
Keyword A- keywords C
Keyword A- keywords D
Keyword A- keywords E
Keyword A- keywords F
Keyword B- keywords C
Keyword B- keywords D
Keyword B- keywords E
Keyword B- keywords F
Finally, in Step4, by having developed the automated procedures of completion, third step successful condition has been converted into and has been deposited It stores up in the parameter list newly created into the first step.
Set of circumstances after conversion is stored to the storage condition table created into Step1, and recycles this step, Until all conditions all convert storage and complete.
It is different from the application, when asking certain specified query interface in the related technology, incoming required parameter is needed, by right The logical combination of parameter, could just inquire want inquiry as a result, and the parameter of query logic must be in the query word of restriction Within number limitation, the result otherwise inquired is not accurate enough.
But it is current can not solve above-mentioned described situation in the related technology, therefore inquiry provided by the embodiments of the present application Existing query logic can be transformed into the item of direct query interface by new algorithm by the method for data out of Query collection In part set.
The method that data are inquired in the embodiment of the present application is completed big collection and more by using new converting algorithm Logical condition is converted to the condition met needed for interface requests, and then reaches the requirement for obtaining data accuracy.
Wherein, by using new converting algorithm, reach requesting query data-interface, reach the accurate of business datum Property.
The method of inquiry data provided by the embodiments of the present application is only illustrated for being applied to microblogging, to realize this Shen Please embodiment provide inquiry data method subject to, do not limit specifically.
Embodiment two
Fig. 2 is the flow diagram of the device of inquiry data according to the ... of the embodiment of the present invention, as shown in Fig. 2, the device packet It includes:
Matching module 22, for carrying out the query set in presetting database with the logical condition in interface requests to be checked Matching, obtains the correspondence between query set and logical condition;Conversion module 24 is used for according to preset format transfer algorithm, Correspondence is converted to the querying condition of corresponding interface requests to be checked;Enquiry module 26, for being carried out according to querying condition Inquiry obtains the data of corresponding querying condition.
It is provided in an embodiment of the present invention inquiry data device in, by by presetting database query set with it is to be checked The logical condition ask in interface requests is matched, and the correspondence between query set and logical condition is obtained;According to default lattice Correspondence is converted to the querying condition of corresponding interface requests to be checked by formula transfer algorithm;It is inquired according to querying condition, Obtain the data of corresponding querying condition, achieved the purpose that promote inquiry accuracy rate, to realize even if query word number by Limit remains to the technique effect accurately inquired, and then solves since the number of query word in the related technology is limited, caused inquiry As a result the low technical problem of accuracy rate.
Optionally, matching module 22 includes:Extraction unit, the node for extracting each type in query set;First With unit, the corresponding node of node for matching each type in query set is to label;Second matching unit is used for foundation Node matches label with the logical condition of interface requests to be checked, obtains node to label and interface requests to be checked Correspondence between logical condition.
Further, optionally, node includes at least label:Root node label, with node label or node label and Non- node label;Logical condition includes at least:With or with non-.
Optionally, conversion module 24 includes:Judging unit, for judging it is pre- whether the keyword number in query set is more than If threshold value;First converting unit is extracted in query set or node label respectively in the case where the judgment result is yes, or, First element in non-node label, and according to the first Element generation querying condition extracted;Second converting unit, for sentencing It, will be with node label or node label, or, the key in non-node label according to correspondence in the case that disconnected result is no Word carries out traversal splicing, obtains querying condition.
Further, optionally, the first converting unit includes:Subelement is inquired, for being keyword in the first element In the case of, the keyword in traversal or node label and the keyword in non-node label;Subelement is extracted, is looked into for a point extraction Ask the keyword in concentration or node label or non-node label;Conversion subunit, for pair or node label and non-node mark Keyword is spliced by combination in label, obtains at least one querying condition.
Optionally, the device of inquiry data provided in an embodiment of the present invention further includes:Statistic unit, for judging to inquire Whether the keyword number of concentration is more than before predetermined threshold value, according to the keyword number for presetting counter statistical query concentration; Creating unit, for create list collection and with node label object, wherein list collection, for storing in correspondence time Go through with the keyword storage form in node label;With node label object, it is used for according to list collection and correspondence Character string formed dictionary.
Optionally, the device of inquiry data provided by the embodiments of the present application further includes:Memory module, for according to inquiry Condition is inquired, and before obtaining the data of corresponding querying condition, querying condition is stored to the query set into presetting database.
Further, optionally, enquiry module 26 includes:Query unit, for according to the querying condition in parameter list into Row inquiry obtains the data of corresponding querying condition.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
In the above embodiment of the present invention, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment The part of detailed description may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, for example, the unit division, Ke Yiwei A kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module It connects, can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple On unit.Some or all of unit therein can be selected according to the actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes:USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various can to store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of method of inquiry data, which is characterized in that including:
Query set in presetting database is matched with the logical condition in interface requests to be checked, obtains the query set With the correspondence between the logical condition;
According to the preset format transfer algorithm, the correspondence is converted to the inquiry of the corresponding interface requests to be checked Condition;
It is inquired according to the querying condition, obtains the data for corresponding to the querying condition.
2. according to the method described in claim 1, it is characterized in that, the query set by presetting database connects with to be checked Logical condition in mouth request is matched, and the correspondence obtained between the query set and the logical condition includes:
Extract the node of each type in the query set;
The corresponding node of node of each type is matched in the query set to label;
Label is matched with the logical condition of the interface requests to be checked according to the node, obtains the node to mark The correspondence between label and the logical condition of the interface requests to be checked.
3. according to the method described in claim 2, it is characterized in that, the node includes at least label:Root node label, with Node label or node label and non-node label;The logical condition includes at least:With or with non-.
4., will be described according to the method described in claim 3, it is characterized in that, described according to the preset format transfer algorithm The querying condition that correspondence is converted to the corresponding interface requests to be checked includes:
Judge whether the keyword number in the query set is more than predetermined threshold value;
In the case where the judgment result is yes, it extracts respectively described in the query set or node label, or, the non-node mark First element in label, and according to querying condition described in first Element generation extracted;
In the case where judging result is no, described and node label, described or node label are incited somebody to action according to the correspondence, Or, the keyword in the non-node label carries out traversal splicing, the querying condition is obtained.
5. according to the method described in claim 4, it is characterized in that, described extract described in the query set or node mark respectively First element in label or non-node label, and include according to querying condition described in first Element generation extracted:
In the case where first element is keyword, the keyword in described or node label and the non-node mark are traversed Keyword in label;
Described in point extraction query set or node label, or, the keyword in the non-node label;
Keyword in described or node label and the non-node label is spliced by combination, is obtained at least one described Querying condition.
6. according to the method described in claim 4, it is characterized in that, judging that the keyword number in the query set is described No to be more than before predetermined threshold value, the method further includes:
According to the keyword number preset in query set described in counters count;
Create list collection and described and node label object, wherein the list collection, for storing in the correspondence Traverse obtain with the keyword storage form in node label;Described and node label object, for according to the list collection It closes and corresponding character string forms dictionary.
7. a kind of device of inquiry data, which is characterized in that including:
Matching module, for the query set in presetting database to be matched with the logical condition in interface requests to be checked, Obtain the correspondence between the query set and the logical condition;
Conversion module, for according to the preset format transfer algorithm, it is described to be checked that the correspondence to be converted to correspondence The querying condition of interface requests;
Enquiry module obtains the data for corresponding to the querying condition for being inquired according to the querying condition.
8. device according to claim 7, which is characterized in that the matching module includes:
Extraction unit, the node for extracting each type in the query set;
First matching unit, for matching the corresponding node of node of each type in the query set to label;
Second matching unit, for the logical condition progress according to the node to label and the interface requests to be checked Match, obtains the correspondence of the node between label and the logical condition of the interface requests to be checked.
9. device according to claim 8, which is characterized in that the node includes at least label:Root node label, with Node label or node label and non-node label;The logical condition includes at least:With or with non-.
10. device according to claim 9, which is characterized in that the conversion module includes:
Judging unit, for judging whether the keyword number in the query set is more than predetermined threshold value;
First converting unit is extracted described in the query set or node mark respectively in the case where the judgment result is yes Label, or, the first element in the non-node label, and according to querying condition described in first Element generation extracted;
Second converting unit, in the case where judging result is no, according to the correspondence will it is described with node label, Described or node label obtains the querying condition or, the keyword in the non-node label carries out traversal splicing.
CN201611148714.2A 2016-12-13 2016-12-13 Method and device for querying data Active CN108614842B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611148714.2A CN108614842B (en) 2016-12-13 2016-12-13 Method and device for querying data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611148714.2A CN108614842B (en) 2016-12-13 2016-12-13 Method and device for querying data

Publications (2)

Publication Number Publication Date
CN108614842A true CN108614842A (en) 2018-10-02
CN108614842B CN108614842B (en) 2021-03-30

Family

ID=63658008

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611148714.2A Active CN108614842B (en) 2016-12-13 2016-12-13 Method and device for querying data

Country Status (1)

Country Link
CN (1) CN108614842B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117271562A (en) * 2023-11-21 2023-12-22 成都凌亚科技有限公司 Data acquisition processing method and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070150479A1 (en) * 2005-12-27 2007-06-28 Flashpoint Technology, Inc. System and method for accessing and managing mobile device metadata
CN101788994A (en) * 2009-08-14 2010-07-28 成都迪捷信息技术有限公司 Method for constructing data display model and method and device for displaying data
US20100217768A1 (en) * 2009-02-20 2010-08-26 Hong Yu Query System for Biomedical Literature Using Keyword Weighted Queries
CN101984434A (en) * 2010-11-16 2011-03-09 东北大学 Webpage data extracting method based on extensible language query
CN102360367A (en) * 2011-09-29 2012-02-22 广州中浩控制技术有限公司 XBRL (Extensible Business Reporting Language) data search method and search engine
CN103646032A (en) * 2013-11-11 2014-03-19 漆桂林 Database query method based on body and restricted natural language processing
US20150032748A1 (en) * 2013-07-23 2015-01-29 International Business Machines Corporation Group-based document retrieval
CN105930441A (en) * 2016-04-18 2016-09-07 华信咨询设计研究院有限公司 Query method of radio monitoring data
CN106033466A (en) * 2015-03-20 2016-10-19 华为技术有限公司 Database query method and device
CN106095825A (en) * 2016-05-31 2016-11-09 深圳市永兴元科技有限公司 Data creation method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070150479A1 (en) * 2005-12-27 2007-06-28 Flashpoint Technology, Inc. System and method for accessing and managing mobile device metadata
US20100217768A1 (en) * 2009-02-20 2010-08-26 Hong Yu Query System for Biomedical Literature Using Keyword Weighted Queries
CN101788994A (en) * 2009-08-14 2010-07-28 成都迪捷信息技术有限公司 Method for constructing data display model and method and device for displaying data
CN101984434A (en) * 2010-11-16 2011-03-09 东北大学 Webpage data extracting method based on extensible language query
CN102360367A (en) * 2011-09-29 2012-02-22 广州中浩控制技术有限公司 XBRL (Extensible Business Reporting Language) data search method and search engine
US20150032748A1 (en) * 2013-07-23 2015-01-29 International Business Machines Corporation Group-based document retrieval
CN103646032A (en) * 2013-11-11 2014-03-19 漆桂林 Database query method based on body and restricted natural language processing
CN106033466A (en) * 2015-03-20 2016-10-19 华为技术有限公司 Database query method and device
CN105930441A (en) * 2016-04-18 2016-09-07 华信咨询设计研究院有限公司 Query method of radio monitoring data
CN106095825A (en) * 2016-05-31 2016-11-09 深圳市永兴元科技有限公司 Data creation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIANGFU MENG 等: "Finding top-k semantically related terms from relational keyword search", 《2014 INTERNATIONAL CONFERENCE ON DATA SCIENCE AND ADVANCED ANALYTICS (DSAA)》 *
周翔 等: "用于关系数据库关键词查询的基于划分的候选网络生成算法", 《东南大学学报(自然科学版)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117271562A (en) * 2023-11-21 2023-12-22 成都凌亚科技有限公司 Data acquisition processing method and system
CN117271562B (en) * 2023-11-21 2024-01-19 成都凌亚科技有限公司 Data acquisition processing method and system

Also Published As

Publication number Publication date
CN108614842B (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN104580027B (en) A kind of OpenFlow message forwarding methods and equipment
CN105630938A (en) Intelligent question-answering system
CN108460136A (en) Electric power O&M information knowledge map construction method
CN107729251A (en) Testing case management and device
CN108733713A (en) Data query method and device in data warehouse
CN105045847B (en) A kind of method that Chinese institutional units title is extracted from text message
EP4053802A1 (en) Video classification method and apparatus, device and storage medium
US11250166B2 (en) Fingerprint-based configuration typing and classification
US20120254849A1 (en) Ontology updating apparatus, method and system
CN108959531A (en) Information search method, device, equipment and storage medium
CN105282123A (en) Network protocol identification method and device
CN112559704A (en) Knowledge graph generation tool configured by user-defined
CN104462429B (en) The generation method and device of query sentence of database
CN108038229A (en) Government affairs information search method, system and terminal device
CN110019754A (en) A kind of method for building up of knowledge base, device and equipment
CN103942274B (en) A kind of labeling system and method for the biologic medical image based on LDA
CN105989097A (en) Ontology-based knowledge base query method and system
CN113779051A (en) Word stock updating method and device, risk control method, device and system
CN106126634A (en) A kind of master data duplicate removal treatment method based on live industry and system
CN112307318A (en) Content publishing method, system and device
CN108614842A (en) The method and apparatus for inquiring data
CN105354264B (en) A kind of quick adding method of theme label based on local sensitivity Hash
CN110399360A (en) The setting method and device of dictionary table, storage medium, electronic device
CN107784588A (en) Insurance user information merging method and device
CN110472019A (en) Public sentiment searching method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant