CN108846103A - A kind of data query method and device - Google Patents

A kind of data query method and device Download PDF

Info

Publication number
CN108846103A
CN108846103A CN201810633278.0A CN201810633278A CN108846103A CN 108846103 A CN108846103 A CN 108846103A CN 201810633278 A CN201810633278 A CN 201810633278A CN 108846103 A CN108846103 A CN 108846103A
Authority
CN
China
Prior art keywords
inquiry
parameter
main body
string
principal name
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
CN201810633278.0A
Other languages
Chinese (zh)
Other versions
CN108846103B (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 Tiangong Matrix Information Technology Co Ltd
Original Assignee
Beijing Tiangong Matrix Information 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 Tiangong Matrix Information Technology Co Ltd filed Critical Beijing Tiangong Matrix Information Technology Co Ltd
Priority to CN201810633278.0A priority Critical patent/CN108846103B/en
Publication of CN108846103A publication Critical patent/CN108846103A/en
Application granted granted Critical
Publication of CN108846103B publication Critical patent/CN108846103B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The embodiment of the present invention provides a kind of data query method and device.The method includes:Receive the inquiry string that terminal is sent;Main body analysis, which is carried out, using main body library according to the inquiry string obtains corresponding principal name;Parameter analysis is carried out to the inquiry string using corresponding Parameter analysis model according to the principal name, obtains corresponding parameter information;The principal name and the parameter information are generated into inquiry instruction, inquired according to the inquiry instruction.Described device is for executing the above method.The embodiment of the present invention gets the principal name in inquiry string by main body library, then parameter information is obtained using corresponding Parameter analysis model according to principal name, finally inquired according to the inquiry instruction that principal name and parameter information are constituted, obtain query result, due to the inquiry instruction more standardized from inquiry string, accurate query result can be obtained.

Description

A kind of data query method and device
Technical field
The present invention relates to technical field of data processing, in particular to a kind of data query method and device.
Background technique
Development based on automatic technology, automation equipment or other intelligent apparatus for industrial automation production More and more, therefore, for the relevant parameter information for a certain product of user query, some companies provide online query clothes Business.
In the prior art, inquiry company stores more than 700,000,000 product specification records, accurate complete to be embodied as user's offer Face ground search service.In the database, every product specification includes:Brand, category, affiliated product line, name of product, ginseng The multiclass such as number, material number for retrieval information.Such as:IC65N-C16A/3P+VEA 30mA is an independent SKU.Its is right The information answered has:Name of product:iC65N-C16A/3P+VEA 30mA;Product category:Miniature circuit breaker;Brand:Schneider electricity Gas;Affiliated product line:IC65 series small breaker;Manufacturer's material number:1001;Characterisitic parameter:Breaking capacity type:[N Type];Number of poles:[3 pole];Tripping characteristic:[c-type];Rated current:[16 peace];... the characterisitic parameter of key, it all can be with code word The mode of symbol, combination are reflected in name of product.But there are also considerable parameter (at most up to 300), not in ProductName It is embodied in title.
Search system needs the character string comprising above-mentioned (part) information inputted according to user, searches and returns to related production The name of an article claims, material number and other peripheral informations.FAQs present in user query includes:
User may be nonstandard to the description of specific content.Such as:16 peaces, are written as 16A;Schneider is written as Shi Naide Or Schneider etc..
The information segment for including in user string is sequentially unfixed.Such as:Schneider 3P16A or iC65N 3P 16A Schneider Electric。
The item of information for including in user string is incomplete.Such as:" 3 pole 16A of Schneider " this character string includes Some segments of brand and product title.Wherein, " Schneider " is brand name;" 3 pole 16A " can preferentially be not understood as producing The name of an article claim in some characters, it is also possible to the value in product parameters.
Since the inquiry string of above-mentioned user input is not necessarily all specification, it is thus possible to which the result that can be inquired is not It is that user wants, it is relatively low so as to cause inquiry accuracy rate.
Summary of the invention
In view of this, the embodiment of the present invention is designed to provide a kind of data query method and device, it is above-mentioned to solve Technical problem.
In a first aspect, the embodiment of the invention provides a kind of data query methods, including:
Receive the inquiry string that terminal is sent;
Main body analysis, which is carried out, using main body library according to the inquiry string obtains corresponding principal name;
Parameter analysis is carried out to the inquiry string using corresponding Parameter analysis model according to the principal name, is obtained Obtain corresponding parameter information;
The principal name and the parameter information are generated into inquiry instruction, inquired according to the inquiry instruction.
Further, the method further includes:
Pretreatment operation is carried out to the inquiry string, wherein the pretreatment operation includes separator replacement, main body Title pre-identification and parameter information pre-identification.
Further, the method further includes:
The corresponding standard body title of all product specifications is obtained in advance and each standard body title is corresponding All doubtful principal names;
The set of the standard body title and the corresponding doubtful principal name is constituted into the main body library.
Further, the method further includes:
The corresponding parameter nomenclature rule of all product specifications is obtained in advance, according to the corresponding parameter nomenclature of each product specification Rule constructs corresponding parameter dictionary, wherein including in the parameter dictionary:The logarithm and code attribute of parameter codes, word frequency Number;
According to the corresponding Parameter analysis model of the parameter dictionary creation.
Further, the method further includes:
By inquiry obtain query result be ranked up according to preset rules, wherein the preset rules include similarity, Enquiry frequency, click feedback rates, in editing distance any one or combinations thereof.
Further, described that main body analysis is carried out using main body library according to the inquiry string, obtain the inquiry word The corresponding principal name of symbol string, including:
It will be in the inquiry string and the main body library using regular expression or Aho-Corasick automatic machine algorithm Principal name matched, obtain the corresponding principal name of the inquiry string.
Further, described that the inquiry string is joined using corresponding Parameter analysis model according to the main body Number analysis, obtains corresponding parameter information, including:
The inquiry string is subjected to body operation, obtains nonbody inquiry string;
The nonbody inquiry string is input in the Parameter analysis model, the Parameter analysis model is according to dynamic State planning algorithm is using parameter probability and maximum parameter group as the parameter information.
Further, described to be inquired according to the inquiry instruction, including:
The inquiry instruction is inquired using Elastic Search search engine, obtains query result.
Second aspect, the embodiment of the invention provides a kind of data query devices, including:
Receiving module, for receiving the inquiry string of terminal transmission;
Main body analysis module obtains corresponding master for carrying out main body analysis using main body library according to the inquiry string Body title;
Parameter analysis module, for utilizing corresponding Parameter analysis model to the polling character according to the principal name String carries out Parameter analysis, obtains corresponding parameter information;
Enquiry module refers to for the principal name and the parameter information to be generated inquiry instruction according to the inquiry Order is inquired.
Further, described device further includes:
Preprocessing module, for carrying out pretreatment operation to the inquiry string, wherein the pretreatment operation includes Separator replacement, principal name pre-identification and parameter information pre-identification.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, including:Processor, memory and bus, wherein
The processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to refer to Enable the method and step for being able to carry out first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, including:
The non-transient computer readable storage medium stores computer instruction, and the computer instruction makes the computer Execute the method and step of first aspect.
The embodiment of the present invention gets the principal name in inquiry string by main body library, then according to principal name benefit Parameter information is obtained with corresponding Parameter analysis model, is finally carried out according to the inquiry instruction that principal name and parameter information are constituted Inquiry, obtaining query result can be obtained more due to the inquiry instruction more standardized from inquiry string Accurate query result.
Other features and advantages of the present invention will be illustrated in subsequent specification, also, partly be become from specification It is clear that by implementing understanding of the embodiment of the present invention.The objectives and other advantages of the invention can be by written theory Specifically noted structure is achieved and obtained in bright book, claims and attached drawing.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is a kind of data query method flow schematic diagram provided in an embodiment of the present invention;
Fig. 2 is another data query method flow schematic diagram provided in an embodiment of the present invention;
Fig. 3 is a kind of data query device structural schematic diagram provided in an embodiment of the present invention;
Fig. 4 is the structural block diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Fig. 1 is a kind of data query method flow schematic diagram provided in an embodiment of the present invention, as shown in Figure 1, this method packet It includes:
Step 101:Receive the inquiry string that terminal is sent.
In the specific implementation process, user inputs in the search box of terminal needs the corresponding inquiry string of product, Inquiry unit receive terminal send the inquiry string, wherein in inquiry string include need product principal name and/ Or parameter information.It should be noted that user is in input inquiry character string, content be possible to be not device defined rule Model query statement.
Step 102:Main body analysis, which is carried out, using main body library according to the inquiry string obtains corresponding principal name.
In the specific implementation process, device obtains the main body library constructed in advance, and main body library is the master of all product specifications The set of body title.If the total amount of the product specification stored in inquiry unit is smaller, can by way of text file come It stores (principal name of behavior one);If the total amount of the product specification stored in inquiry unit is larger, structure can be passed through Even numbers group word lookup tree (double-array trie) is built to store principal name.It will be in inquiry string and main body library Each principal name compares, to obtain the principal name for including in inquiry string, it should be noted that inquiry string In principal name can be one or multiple, principal name pre-defines, for example, by a product specification In brand, category, affiliated product line, name of product etc. be used as principal name.
Step 103:The inquiry string is joined using corresponding Parameter analysis model according to the principal name Number analysis, obtains corresponding parameter information.
In the specific implementation process, because the parameter nomenclature rule of the different product of different vendor is different, it is each Each corresponding product of manufacturer has corresponding Parameter analysis model, therefore, available to corresponding by principal name Principal name in the inquiry string of user's input is removed, is then input in Parameter analysis model by Parameter analysis model Parameter analysis is carried out, Parameter analysis model can export its corresponding parameter information according to the content of input.It should be noted that Parameter analysis model constructs in advance.
Step 103:The principal name and the parameter information are generated into inquiry instruction, carried out according to the inquiry instruction Inquiry.
In the specific implementation process, after getting the corresponding principal name of inquiry string and parameter information, according to Principal name and parameter information generate corresponding inquiry instruction, and specific generating mode is:If finding to inquire according to principal name Include the principal name of two different series in character string, and each principal name corresponds to respective parameter information, then will at this time The two principal names and it is corresponding take union constitute inquiry instruction;If wanted according to principal name and parameter information discovery What is searched is then to take intersection to constitute inquiry instruction parameter information with a series of but different parameters;If according to principal name What is inquired with parameter information discovery is the same parameters but parameter value is different with a series of, then union is taken to constitute inquiry instruction.It will The inquiry instruction of generation goes in database to be inquired.It should be noted that being previously stored with the letter of product specification in database Breath.By taking the database of work of nature matrix as an example:The product data of work of nature matrix are made of a rule product specification data, i.e. product Specification is basic data cell.Product rule in contain specification full name, abbreviation, brand, type, price, several parameters and The information such as attachment.Based on this, we can design following general product record specification.
Field name Data type Connotation Remarks
id long Product IDs
vendor string Manufacturer
cat string Product type
series string Series name
shortSeries string Serial abbreviation
name string Product full name
price float Price
P1Value string 1 value of attribute
P2Code string 1 code of attribute
…..
PnValue string Attribute n value
PnCode string Attribute n code
accessory long Attachment ID
Because its attribute of different products is different, the name of attribute is used and is taken out as P1...Pn Unified index structure is constructed as naming method, specific Property Name then can store in another tables of data In.This tableau format can be defined as follows:
Field name Data type Explanation
SpecID Int Specification ID
PSeq Int Parameter serial number (since 1)
PDef String Parameter definition (title)
According to the said goods specification, business datum is combed, and constructs normalization procedure, original service data are turned Turn to the data of standardization.Normalization procedure generally relies on regular expression and handles initial data, and the result of processing is protected It deposits in the database.
The embodiment of the present invention gets the principal name in inquiry string by main body library, then according to principal name benefit Parameter information is obtained with corresponding Parameter analysis model, is finally carried out according to the inquiry instruction that principal name and parameter information are constituted Inquiry, obtaining query result can be obtained more due to the inquiry instruction more standardized from inquiry string Accurate query result.
On the basis of the above embodiments, the method further includes:
Pretreatment operation is carried out to the inquiry string, wherein the pretreatment operation includes separator replacement, main body Title pre-identification and parameter information pre-identification.
In the specific implementation process, inquiry unit is after the inquiry string for receiving user's transmission, in order to inquiry Character string carries out preliminary standardization, reduces interference, improves the accuracy for carrying out main body analysis and Parameter analysis, needs to inquiry Character string is pre-processed.Wherein, pretreated particular content includes:
The separators such as "-", "/" are uniformly replaced with into space, are convenient for subsequent analysis.
Identify special more word main bodys, for example " XX YY " is a main body, and is merged as " XX-YY ".This part needs Main body vocabulary to be identified is pre-established, is then identified using Aho-Corasick (AC) automatic machine.
It identifies special parameter, certain special parameters is identified and converted in advance.
The embodiment of the present invention carries out preliminary standardization to inquiry string by pre-processing to inquiry string, Interference is reduced, the accuracy for carrying out main body analysis and Parameter analysis is improved.
On the basis of the above embodiments, the method further includes:
The corresponding standard body title of all product specifications is obtained in advance and each standard body title is corresponding All doubtful principal names;
The set of the standard body title and the corresponding doubtful principal name is constituted into the main body library.
In the specific implementation process, all corresponding principal names of product specification are demarcated in advance, is marked Then quasi- principal name rule of thumb obtains the doubtful principal name that the corresponding user of each standard body title may input. Such as:The entitled Schneider of standard body, and user may can input Shi Naide or Schneider in inquiry, it therefore, will Shi Naide and Schneider is used as doubtful principal name, by a standard body title and its corresponding doubtful principal name It records, is put into main body library, thus the set structure of multiple standard body titles doubtful principal name corresponding with its as one At main body library.
The embodiment of the present invention identifies the principal name in inquiry string by building main body library, realizes needle Precision analysis to different vendor's different product, improves the accuracy of data query.
On the basis of the above embodiments, the method further includes:
The corresponding parameter nomenclature rule of all product specifications is obtained in advance, according to the corresponding parameter nomenclature of each product specification Rule constructs corresponding parameter dictionary, wherein including in the parameter dictionary:The logarithm and code attribute of parameter codes, word frequency Number;
According to the corresponding Parameter analysis model of the parameter dictionary creation.
In the specific implementation process, since the parameter nomenclature rule of the different product of different vendor is all different, so needing It to be that each product distinguishes constructing variable dictionary according to the corresponding parameter nomenclature rule of each product specification.Wherein, parameter dictionary In include:Parameter codes, the logarithm of word frequency and code attribute number, it should be noted that can also include in parameter dictionary Other parameters, the present invention is not especially limit this.It should be noted that if there are similar in user's input Synonymous expression as " 6A " and " 6 peace ", then be contemplated that and the form of synonymous expression be also added in training data.Because different Product specification by frequency of usage difference, input product specification record should weight (repetition) with its frequency of usage, with guarantor Card uses distribution consistent with true.
The mathematical form of Parameter analysis model is:
Wherein, O indicates the inquiry string of user's input, and (namely we think the parameter that W expression user is intended by Obtained parameter information) because our extraction does not change input, and be based on input, so P (O | W) it is considered that It is 1 and is ignored.We only need to find maximum P (W), and P (W) can find out optimal ginseng according to dynamic programming algorithm Then Number Sequence finds out corresponding parameter information from parameter dictionary.Herein, because sample size is less, we are used Mono- gram language model of uni-gram.In a gram language model, P (W)=P (w1)*P(w2)*....*P(wn).So parameter point Analysis algorithm need to do is to find the division of the maximum probability of the inquiry string (non-master body portion) to user's input.
The embodiment of the present invention, can by Parameter analysis model by constructing the corresponding Parameter analysis model of each product specification Accurately to obtain parameter information in inquiry string, and then it can accurately acquire query result.
On the basis of the above embodiments, the method further includes:
By inquiry obtain query result be ranked up according to preset rules, wherein the preset rules include similarity, Enquiry frequency, click feedback rates, in editing distance any one or combinations thereof.
In the specific implementation process, after acquiring query result by inquiry instruction, query result may be more than One, therefore, it is necessary to be determined to the sequencing that query result is shown, when to result ranking, it may be considered that phase Like degree, enquiry frequency, click feedback rates, in editing distance any one or combinations thereof, it is of course also possible to be based on machine learning Mode, establish order models, pass through order models export query result sequence.
The embodiment of the present invention is by the way that result ranking, the query result for making it possible to go for user is come most Front facilitates the browsing of user.
On the basis of the above embodiments, described that main body analysis is carried out using main body library according to the inquiry string, it obtains The corresponding principal name of the inquiry string is obtained, including:
It will be in the inquiry string and the main body library using regular expression or Aho-Corasick automatic machine algorithm Principal name matched, obtain the corresponding principal name of the inquiry string.
In the specific implementation process, the function of main body analysis is that crucial principal name is found from inquiry string. There are two types of its implementation:
First, main body negligible amounts (<1000) when, regular expression can be used and carry out matching search, used Regular expression be " A | B | C | D | ... ".Wherein title based on A, B, C etc..
Second, when principal name is a fairly large number of, then Aho-Corasick automatic machine algorithm can be used to carry out The matched and searched of efficient linear time complexity.It should be noted that Aho-Corasick automatic machine algorithm is the prior art, Details are not described herein again for its core concept.And it can also be realized by other algorithms to principal name in the embodiment of the present invention Matching, the present invention is not especially limit this.
The embodiment of the present invention carries out main body analysis to inquiry string by main body library, realizes for different vendor's difference The precision of product is analyzed, and the accuracy of data query is improved.
On the basis of the above embodiments, described to utilize corresponding Parameter analysis model to the inquiry according to the main body Character string carries out Parameter analysis, obtains corresponding parameter information, including:
The inquiry string is subjected to body operation, obtains nonbody inquiry string;
The nonbody inquiry string is input in the Parameter analysis model, the Parameter analysis model is according to dynamic State planning algorithm is using parameter probability and maximum parameter group as the parameter information.
In the specific implementation process, it after main body analysis obtains corresponding principal name, is incited somebody to action by inquiry string Principal name removal in inquiry string, obtains nonbody inquiry string, non-inquiry string is input to Parameter analysis Parameter analysis is carried out in model, using dynamic programming algorithm output parameter probability and maximum parameter group as parameter information.Example Such as, inquiry string IC65N3P16A carry out body operation acquisition nonbody inquiry string be:N3P16A, by N3P16A After being input to Parameter analysis model, a parameter matrix can be obtained by the parameter dictionary in Parameter analysis model:
0 1 2 3 4 5
0 P(N) P(N3) P(N3P) P(N3P1) P(N3P16) P(N3P16A)
1 P(3) P(3P) P(3P1) P(3P16) P(3P16A)
2 P(P) P(P1) P(P16) P(P16A)
3 P(1) P(16) P(16A)
4 P(6) P(6A)
5 P(A)
Parameter probability is found by dynamic programming algorithm and maximum parameter group is:N, 3P, 16A.
The embodiment of the present invention carries out Parameter analysis to nonbody inquiry string by Parameter analysis model, passes through parameter point Analysis model can accurately obtain parameter information in inquiry string, and then can accurately acquire query result.
It is described to be inquired according to the inquiry instruction on the basis of each above-described embodiment, including:
The inquiry instruction is inquired using Elastic Search search engine, obtains query result.
In the specific implementation process, inquiry unit has selected Elastic Search (ES) to draw as Back-end search at present It holds up.ES is open source, the distributed search engine based on Lucene, and there is feature-rich, search grammer to enrich, sort and match Set flexibly, distributed structure/architecture is reliable and the excellent characteristic such as high-performance, and there is sufficient open source community to support.
Index upgrade program reads the product specification record after standardization, and is written in ES index by ES HTTP API. Search engine provides the search service on basis by the HTTP API of ES.
Fig. 2 is another data query method flow schematic diagram provided in an embodiment of the present invention, as shown in Fig. 2, including:
Inquiry unit obtains the product business datum of all product specifications in advance, and standardizes to each product business datum Change processing;
On the one hand the product business datum for carrying out standardization processing is stored in ES index, the ES index, another party are updated Face is trained off-line model as training data, training after generate analysis model, wherein analysis model include main body library and Optimization model;
When user input query character string, inquiry string is analyzed by analysis model, obtains corresponding master Body title and parameter information, the inquiry instruction constituted according to principal name and parameter information by search engine from ES index into Row inquiry, query result is ranked up and is shown by order models.
The embodiment of the present invention gets the principal name in inquiry string by main body library, then according to principal name benefit Parameter information is obtained with corresponding Parameter analysis model, is finally carried out according to the inquiry instruction that principal name and parameter information are constituted Inquiry, obtaining query result can be obtained more due to the inquiry instruction more standardized from inquiry string Accurate query result.
Fig. 3 is a kind of data query device structural schematic diagram provided in an embodiment of the present invention, as shown in figure 3, the device packet It includes:Receiving module 301, main body analysis module 302, Parameter analysis module 303 and enquiry module 304, wherein
Receiving module 301 is used to receive the inquiry string of terminal transmission;Main body analysis module 302 according to for looking into It askes character string and carries out the corresponding principal name of main body analysis acquisition using main body library;Parameter analysis module 303 is used for according to Principal name carries out Parameter analysis to the inquiry string using corresponding Parameter analysis model, obtains corresponding parameter letter Breath;Enquiry module 304 is used to the principal name and the parameter information generating inquiry instruction, according to the inquiry instruction into Row inquiry.
On the basis of the above embodiments, described device further includes:
Preprocessing module, for carrying out pretreatment operation to the inquiry string, wherein the pretreatment operation includes Separator replacement, principal name pre-identification and parameter information pre-identification.
On the basis of the above embodiments, described device further includes:
Main body library constructs module, for obtaining the corresponding standard body title of all product specifications and each described in advance The corresponding all doubtful principal names of standard body title;
The set of the standard body title and the corresponding doubtful principal name is constituted into the main body library.
On the basis of the above embodiments, described device further includes:
Parameter analysis model construction module, for obtaining the corresponding parameter nomenclature rule of all product specifications in advance, according to The corresponding parameter nomenclature rule of each product specification constructs corresponding parameter dictionary, wherein including in the parameter dictionary:Parameter Code, the logarithm of word frequency and code attribute number;
According to the corresponding Parameter analysis model of the parameter dictionary creation.
On the basis of the above embodiments, described device further includes:
Sorting module, the query result for obtaining inquiry are ranked up according to preset rules, wherein the default rule Then include similarity, enquiry frequency, click feedback rates, in editing distance any one or combinations thereof.
On the basis of the above embodiments, the main body analysis module, is specifically used for:
It will be in the inquiry string and the main body library using regular expression or Aho-Corasick automatic machine algorithm Principal name matched, obtain the corresponding principal name of the inquiry string.
On the basis of the above embodiments, the Parameter analysis module, is specifically used for:
The inquiry string is subjected to body operation, obtains nonbody inquiry string;
The nonbody inquiry string is input in the Parameter analysis model, the Parameter analysis model is according to dynamic State planning algorithm is using parameter probability and maximum parameter group as the parameter information.
On the basis of the various embodiments described above, the enquiry module is specifically used for:
The inquiry instruction is inquired using Elastic Search search engine, obtains query result.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description Specific work process, no longer can excessively be repeated herein with reference to the corresponding process in preceding method.
In conclusion the embodiment of the present invention gets the principal name in inquiry string by main body library, then basis Principal name obtains parameter information using corresponding Parameter analysis model, is finally looked into according to what principal name and parameter information were constituted It askes instruction to be inquired, query result is obtained, due to the inquiry instruction more standardized from inquiry string, energy Enough obtain accurate query result.
Referring to figure 4., Fig. 4 is the structural block diagram of electronic equipment provided in an embodiment of the present invention.Electronic equipment may include Inquiry unit 401, memory 402, storage control 403, processor 404, Peripheral Interface 405, input-output unit 406, sound Frequency unit 407, display unit 408.
The memory 402, storage control 403, processor 404, Peripheral Interface 405, input-output unit 406, sound Frequency unit 407, each element of display unit 408 are directly or indirectly electrically connected between each other, to realize the transmission or friendship of data Mutually.It is electrically connected for example, these elements can be realized between each other by one or more communication bus or signal wire.The inquiry Device 401 includes that at least one can be stored in the memory 402 or solidify in the form of software or firmware (firmware) Software function module in the operating system (operating system, OS) of inquiry unit 401.The processor 404 is used In executing the executable module that stores in memory 402, such as the software function module that includes of inquiry unit 401 or computer journey Sequence.
Wherein, memory 402 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc.. Wherein, memory 402 is for storing program, and the processor 404 executes described program after receiving and executing instruction, aforementioned Method performed by the server that the stream process that any embodiment of the embodiment of the present invention discloses defines can be applied to processor 404 In, or realized by processor 404.
Processor 404 can be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 404 can To be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;Can also be digital signal processor (DSP), specific integrated circuit (ASIC), Ready-made programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hard Part component.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor It can be microprocessor or the processor 404 be also possible to any conventional processor etc..
Various input/output devices are couple processor 404 and memory 402 by the Peripheral Interface 405.Some In embodiment, Peripheral Interface 405, processor 404 and storage control 403 can be realized in one single chip.Other one In a little examples, they can be realized by independent chip respectively.
Input-output unit 406 realizes user and the server (or local terminal) for being supplied to user input data Interaction.The input-output unit 406 may be, but not limited to, mouse and keyboard etc..
Audio unit 407 provides a user audio interface, may include one or more microphones, one or more raises Sound device and voicefrequency circuit.
Display unit 408 provides an interactive interface (such as user interface) between the electronic equipment and user Or it is referred to for display image data to user.In the present embodiment, the display unit 408 can be liquid crystal display or touching Control display.It can be the touching of the capacitance type touch control screen or resistance-type of support single-point and multi-point touch operation if touch control display Control screen etc..Single-point and multi-point touch operation is supported to refer to that touch control display can sense on the touch control display one or more The touch control operation generated simultaneously at a position, and the touch control operation that this is sensed transfers to processor 404 to be calculated and handled.
Various input/output devices are couple processor 404 and memory 402 by the Peripheral Interface 405.Some In embodiment, Peripheral Interface 405, processor 404 and storage control 403 can be realized in one single chip.Other one In a little examples, they can be realized by independent chip respectively.
Input-output unit 406 is used to be supplied to the interaction that user input data realizes user and processing terminal.It is described defeated Entering output unit 406 may be, but not limited to, mouse and keyboard etc..
It is appreciated that structure shown in Fig. 4 is only to illustrate, the electronic equipment may also include it is more than shown in Fig. 4 or The less component of person, or with the configuration different from shown in Fig. 4.Each component shown in Fig. 4 can using hardware, software or A combination thereof is realized.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product, Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the present invention can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should be noted that:Similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.

Claims (10)

1. a kind of data query method, which is characterized in that including:
Receive the inquiry string that terminal is sent;
Main body analysis, which is carried out, using main body library according to the inquiry string obtains corresponding principal name;
Parameter analysis, acquisition pair are carried out to the inquiry string using corresponding Parameter analysis model according to the principal name The parameter information answered;
The principal name and the parameter information are generated into inquiry instruction, inquired according to the inquiry instruction.
2. the method according to claim 1, wherein the method, further includes:
Pretreatment operation is carried out to the inquiry string, wherein the pretreatment operation includes separator replacement, principal name Pre-identification and parameter information pre-identification.
3. the method according to claim 1, wherein the method, further includes:
The corresponding standard body title of all product specifications is obtained in advance and each standard body title is corresponding all Doubtful principal name;
The set of the standard body title and the corresponding doubtful principal name is constituted into the main body library.
4. the method according to claim 1, wherein the method, further includes:
The corresponding parameter nomenclature rule of all product specifications is obtained in advance, according to the corresponding parameter nomenclature rule of each product specification Corresponding parameter dictionary is constructed, wherein including in the parameter dictionary:Parameter codes, the logarithm of word frequency and code attribute are compiled Number;
According to the corresponding Parameter analysis model of the parameter dictionary creation.
5. the method according to claim 1, wherein the method, further includes:
The query result that inquiry obtains is ranked up according to preset rules, wherein the preset rules include similarity, inquiry Frequency, click feedback rates, in editing distance any one or combinations thereof.
6. the method according to claim 1, wherein described carried out according to the inquiry string using main body library Main body analysis, obtains the corresponding principal name of the inquiry string, including:
Using regular expression or Aho-Corasick automatic machine algorithm by the master in the inquiry string and the main body library Body title is matched, and the corresponding principal name of the inquiry string is obtained.
7. the method according to claim 1, wherein described utilize corresponding Parameter analysis mould according to the main body Type carries out Parameter analysis to the inquiry string, obtains corresponding parameter information, including:
The inquiry string is subjected to body operation, obtains nonbody inquiry string;
The nonbody inquiry string is input in the Parameter analysis model, the Parameter analysis model is advised according to dynamic Cost-effective method is using parameter probability and maximum parameter group as the parameter information.
8. method according to claim 1-7, which is characterized in that described to be looked into according to the inquiry instruction It askes, including:
The inquiry instruction is inquired using Elastic Search search engine, obtains query result.
9. a kind of data query device, which is characterized in that including:
Receiving module, for receiving the inquiry string of terminal transmission;
Main body analysis module obtains corresponding main body name for carrying out main body analysis using main body library according to the inquiry string Claim;
Parameter analysis module, for according to the principal name using corresponding Parameter analysis model to the inquiry string into Row Parameter analysis obtains corresponding parameter information;
Enquiry module, for the principal name and the parameter information to be generated inquiry instruction, according to the inquiry instruction into Row inquiry.
10. device according to claim 9, which is characterized in that described device further includes:
Preprocessing module, for carrying out pretreatment operation to the inquiry string, wherein the pretreatment operation includes separating Symbol replacement, principal name pre-identification and parameter information pre-identification.
CN201810633278.0A 2018-06-19 2018-06-19 Data query method and device Active CN108846103B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810633278.0A CN108846103B (en) 2018-06-19 2018-06-19 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810633278.0A CN108846103B (en) 2018-06-19 2018-06-19 Data query method and device

Publications (2)

Publication Number Publication Date
CN108846103A true CN108846103A (en) 2018-11-20
CN108846103B CN108846103B (en) 2021-01-15

Family

ID=64203036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810633278.0A Active CN108846103B (en) 2018-06-19 2018-06-19 Data query method and device

Country Status (1)

Country Link
CN (1) CN108846103B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287203A (en) * 2019-05-24 2019-09-27 北京百度网讯科技有限公司 For the update method of vending machine, updating device and vending machine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101131706A (en) * 2007-09-28 2008-02-27 北京金山软件有限公司 Query amending method and system thereof
CN101916263A (en) * 2010-07-27 2010-12-15 武汉大学 Fuzzy keyword query method and system based on weighing edit distance
CN102880614A (en) * 2011-07-15 2013-01-16 阿里巴巴集团控股有限公司 Data searching method and equipment
US20140330862A1 (en) * 2007-02-24 2014-11-06 Trend Micro Incorporated Fast identification of complex strings in a data stream
CN107977422A (en) * 2017-11-27 2018-05-01 中国电子科技集团公司第二十八研究所 A kind of Method of Fuzzy Matching for equipping model name

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140330862A1 (en) * 2007-02-24 2014-11-06 Trend Micro Incorporated Fast identification of complex strings in a data stream
CN101131706A (en) * 2007-09-28 2008-02-27 北京金山软件有限公司 Query amending method and system thereof
CN101916263A (en) * 2010-07-27 2010-12-15 武汉大学 Fuzzy keyword query method and system based on weighing edit distance
CN102880614A (en) * 2011-07-15 2013-01-16 阿里巴巴集团控股有限公司 Data searching method and equipment
CN107977422A (en) * 2017-11-27 2018-05-01 中国电子科技集团公司第二十八研究所 A kind of Method of Fuzzy Matching for equipping model name

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287203A (en) * 2019-05-24 2019-09-27 北京百度网讯科技有限公司 For the update method of vending machine, updating device and vending machine
CN110287203B (en) * 2019-05-24 2021-03-26 北京百度网讯科技有限公司 Updating method and updating device for vending machine and vending machine

Also Published As

Publication number Publication date
CN108846103B (en) 2021-01-15

Similar Documents

Publication Publication Date Title
CN107291783B (en) Semantic matching method and intelligent equipment
JP6894534B2 (en) Information processing method and terminal, computer storage medium
WO2018072071A1 (en) Knowledge map building system and method
CN101167075B (en) Characteristic expression extracting device, method, and program
CN112395506A (en) Information recommendation method and device, electronic equipment and storage medium
CN109284323B (en) Management method and device for detection data
CN108509569A (en) Generation method, device, electronic equipment and the storage medium of enterprise&#39;s portrait
CN109961077A (en) Gender prediction&#39;s method, apparatus, storage medium and electronic equipment
CN110515896B (en) Model resource management method, model file manufacturing method, device and system
CN109446328A (en) A kind of text recognition method, device and its storage medium
CN110502227A (en) The method and device of code completion, storage medium, electronic equipment
CN107679208A (en) A kind of searching method of picture, terminal device and storage medium
CN110188165A (en) Contract template acquisition methods, device, storage medium and computer equipment
CN109144964A (en) log analysis method and device based on machine learning
CN110019712A (en) More intent query method and apparatus, computer equipment and computer readable storage medium
US20180225305A1 (en) Method for displaying landmark data
CN107992523A (en) The function choosing-item lookup method and terminal device of mobile application
CN110019713A (en) Based on the data retrieval method and device, equipment and storage medium for being intended to understand
CN109508441A (en) Data analysing method, device and electronic equipment
CN109726295A (en) Brand knowledge map display methods, device, figure server and storage medium
CN109961075A (en) User gender prediction method, apparatus, medium and electronic equipment
CN101763211A (en) System for analyzing semanteme in real time and controlling related operation
CN114911915A (en) Knowledge graph-based question and answer searching method, system, equipment and medium
CN107291951B (en) Data processing method, device, storage medium and processor
CN103500222A (en) Method and device for searching for chat object through communication software

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
GR01 Patent grant
GR01 Patent grant