CN106611031A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN106611031A
CN106611031A CN201510710825.7A CN201510710825A CN106611031A CN 106611031 A CN106611031 A CN 106611031A CN 201510710825 A CN201510710825 A CN 201510710825A CN 106611031 A CN106611031 A CN 106611031A
Authority
CN
China
Prior art keywords
data query
filter condition
condition
combination
single filter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510710825.7A
Other languages
Chinese (zh)
Inventor
蔡波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201510710825.7A priority Critical patent/CN106611031A/en
Publication of CN106611031A publication Critical patent/CN106611031A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation

Abstract

The invention discloses a data query method and a data query device. The method comprises the steps of acquiring a data query command used for indicating a data query mode; detecting whether a combined filtering condition is included in the acquired data query command used for indicating the data query mode; and querying data according to the data query mode based on the combined filtering condition indicated by the data query command under the condition that a detection result indicates that the combined filtering condition is included in the acquired data query command used for indicating the data query mode. According to the method and the device provided by the invention, the technical problem that in related techniques, filtering conditions are limited and query efficiency is low due to the fact that only the data query with no filtering condition or a single filtering condition can be performed is solved.

Description

Data query method and device
Technical field
The present invention relates to internet arena, in particular to a kind of data query method and device.
Background technology
Software information system all be unable to do without data query (i.e. data retrieval).General data query does not need any mistake Filter condition, simply simple data query, but if the data query of complexity, it is necessary to filter condition.Such as, There is the tables of data in terms of an occurrences in human life, as shown in table 1:
Table 1
Name Native place Sex Age Height
Zhang San Hunan Man 34 170
Li Si Beijing Female 27 179
King five Shanghai Man 23 168
Zhao six Heilungkiang Female 28 175
In this tables of data, store the employee information of certain associate, including name, native place, sex, the age, The information such as height.For the tables of data, general data query is all to check out the data in this table; Somewhat more complex data query can then add a filter condition, such as " " sex is man ", wherein, " sex is man " turns It is exactly " sex=man " to change expression formula into.And single condition is made up of Property Name+operator+filter value, therefore Sex (Property Name)=(operator) man (filter value) is a simple single filter condition.Complexity point Conditional expression is such as " (condition 1) and (condition 2) ", specific such as " (sex=man) and (age<25) ", It is the combination condition being made up of specific single filter condition, the operation relation containing combination condition " and ";It is more complicated A little conditional expressions is the unconfined Nested conditions expression formula of level, such as " ((condition 1) or (condition 2)) and (condition 3).
In the related, during actual queries tables of data, system can only be processed without filter condition and single filter condition Data query, such as " age>23 ", it is impossible to process the data query of complicated filter condition.
For above-mentioned problem, effective solution is not yet proposed at present.
The content of the invention
A kind of data query method and device is embodiments provided, at least to solve in correlation technique due to can only The filter condition for processing the data query without filter condition and single filter condition and causing is limited and search efficiency is low Technical problem.
A kind of one side according to embodiments of the present invention, there is provided data query method, including:Obtain for indicating The data query instruction of data query mode;During the data query for indicating data query mode that detection is obtained is instructed Whether comprising combination filter condition;It is that the data query for indicating data query mode for obtaining is instructed in testing result In comprising in the case of combinations thereof filter condition, according to the instruction of above-mentioned data query it is indicated based on combinations thereof mistake The data query mode of filter condition carries out data query.
Further, whether the data query for indicating data query mode that detection is obtained includes in instructing was combined Filter condition includes:Whether the data query for indicating data query mode that detection is obtained includes filter condition in instructing; In the case of being to include filter condition during the data query for indicating data query mode for obtaining is instructed in testing result, The filter condition is extracted in instructing from the data query for indicating data query mode for obtaining;Detect the filter condition Whether there is combination condition operator in corresponding conditional expression;It is the corresponding condition of the filter condition in testing result In the case of there is combinations thereof conditional operator in expression formula, it is determined that the number for indicating data query mode for obtaining According in query statement include combinations thereof filter condition.
Further, the foundation step of combinations thereof filter condition includes:Generate multiple different single filter conditions; Determine the combinational logic relation between above-mentioned multiple different single filter conditions;Select above-mentioned multiple different from what is determined The corresponding combination condition operator of combinations thereof logical relation between single filter condition;According to generate it is above-mentioned multiple not With single filter condition, and select between above-mentioned multiple different single filter conditions combinations thereof logic close It is corresponding combinations thereof conditional operator, creates combinations thereof filter condition.
Further, the foundation step of combinations thereof filter condition also includes:In selection and above-mentioned multiple different lists In the case that the corresponding combinations thereof conditional operator of combinations thereof logical relation between one filter condition is multiple, according to Default nesting logic, first creates the built-in part of combinations thereof filter condition, then creates the outer of combinations thereof filter condition Set part.
Further, the step of generating arbitrary single filter condition in above-mentioned multiple different single filter conditions includes: Create the object towards any of the above-described single filter condition;In the object towards any of the above-described single filter condition for creating Middle addition object information, above-mentioned object information includes:The Property Name of single filter condition, action type operator, Filter value;Any of the above-described single filter condition is generated according to the object information of addition.
Another aspect according to embodiments of the present invention, additionally provides a kind of data query arrangement, including:Acquiring unit, For obtaining the data query instruction for indicating data query mode;Detector unit, for detection obtain for referring to Whether show in the data query instruction of data query mode comprising combination filter condition;Query unit, in detection knot In the case that fruit includes combinations thereof filter condition in instructing for the data query for indicating data query mode of acquisition, Data query is carried out based on the data query mode of combinations thereof filter condition according to indicated by the instruction of above-mentioned data query.
Further, above-mentioned detector unit includes:First detection module, for detection obtain for indicated number it is investigated that Whether filter condition is included in the data query instruction of inquiry mode;Extraction module, in the use that testing result is acquisition In the case of including filter condition in the data query instruction for indicating data query mode, from acquisition for indicated number The filter condition is extracted in instructing according to the data query of inquiry mode;Second detection module, for detecting the filter condition Whether there is combination condition operator in corresponding conditional expression;First determining module, for testing result for should In the case of there is combinations thereof conditional operator in the corresponding conditional expression of filter condition, it is determined that obtain for referring to Show in the data query instruction of data query mode comprising combinations thereof filter condition.
Further, said apparatus also include:Creating unit, for creating combinations thereof filter condition, wherein, on Stating creating unit includes:Generation module, for generating multiple different single filter conditions;Second determining module, uses In it is determined that the combinational logic relation between above-mentioned multiple different single filter conditions;Selecting module, for selecting and determining Above-mentioned multiple different single filter conditions between the corresponding combination condition operator of combinations thereof logical relation;Create Module, for according to generate above-mentioned multiple different single filter conditions, and select it is multiple different from above-mentioned The corresponding combinations thereof conditional operator of combinations thereof logical relation between single filter condition, creates combinations thereof and filters Condition.
Further, above-mentioned creation module is additionally operable to upper between above-mentioned multiple different single filter conditions what is selected The corresponding combinations thereof conditional operator of combinational logic relation is stated in the case of multiple, according to default nested logic, first Create the built-in part of combinations thereof filter condition, then the coat part for creating combinations thereof filter condition.
Further, above-mentioned generation module arbitrary single filtering rod in above-mentioned multiple different single filter conditions are generated During part, including:Submodule is created, for creating the object towards any of the above-described single filter condition;Addition submodule, For adding object information in the object towards any of the above-described single filter condition for creating, above-mentioned object information includes: The Property Name of single filter condition, action type operator, filter value;Submodule is generated, for according to addition Object information generates any of the above-described single filter condition.
In embodiments of the present invention, using without filter condition combine single filter condition and combination filter condition by the way of, By obtaining the data query instruction for indicating data query mode;Detection obtain for indicating data query mode Data query instruction in whether comprising combination filter condition;It is to obtain for indicating data query side in testing result In the data query instruction of formula comprising combination filter condition in the case of, according to data query instruction it is indicated based on group Closing the data query mode of filter condition carries out data query, and having reached not only can be processed without filter condition and single The data query of filter condition, and the purpose of the data query of combination filter condition can be processed, overcome filtering rod The limited defect of part, it is achieved thereby that improve the technique effect of efficiency data query, and then solve in correlation technique by Effect is limited and inquires about in the filter condition that can only be processed the data query without filter condition and single filter condition and cause The low technical problem of rate.
Description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application, this Bright schematic description and description does not constitute inappropriate limitation of the present invention for explaining the present invention.In accompanying drawing In:
Fig. 1 is the flow chart of a kind of optional data query method according to embodiments of the present invention;
Fig. 2 is the schematic diagram of a kind of optional data query arrangement according to embodiments of the present invention.
Specific embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment The only embodiment of a present invention part, rather than the embodiment of whole.Based on the embodiment in the present invention, ability The every other embodiment that domain those of ordinary skill is obtained under the premise of creative work is not made, all should belong to The scope of protection of the invention.
It should be noted that description and claims of this specification and the term " first " in above-mentioned accompanying drawing, " Two " it is etc. the object for distinguishing similar, without for describing specific order or precedence.It should be appreciated that this The data that sample is used can be exchanged in the appropriate case, so as to embodiments of the invention described herein can with except Here the order beyond those for illustrating or describing is implemented.Additionally, term " comprising " and " having " and they Any deformation, it is intended that covering is non-exclusive to be included, and for example, contains process, the side of series of steps or unit Method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include unclear List or other steps intrinsic for these processes, method, product or equipment or unit.
Embodiment 1
According to embodiments of the present invention, there is provided a kind of embodiment of the method for data query method, it should be noted that The step of flow process of accompanying drawing is illustrated can perform in the such as computer system of one group of computer executable instructions, and And, although show logical order in flow charts, but in some cases, can be with different from order herein Perform shown or described step.
Fig. 1 is the flow chart of a kind of optional data query method according to embodiments of the present invention, as shown in figure 1, should Method comprises the steps:
Step S102, obtains the data query for indicating data query mode and instructs;
Step S104, whether the data query for indicating data query mode that detection is obtained includes in instructing was combined Filter condition;
Step S106, is comprising group during the data query for indicating data query mode for obtaining is instructed in testing result In the case of closing filter condition, according to the indicated data query mode based on combination filter condition of data query instruction Carry out data query.
Wherein, data query mode includes:Without filter condition inquiry mode and having filter condition inquiry mode, there is filtration Condition query mode includes again:Single filter condition inquiry mode and combination filter condition inquiry mode, and combine and filter Condition is made up of according to certain combinational logic multiple single filter conditions.When performing data query operation, need Data query is carried out according to the indicated data query mode of data query instruction.
During enforcement, system receiving user's input querying condition when in the querying condition comprising combination filter condition, is System will carry out conditional expression serializing process, generate a string complete characters as combination filter condition expression formula, The data query for indicating the data query mode based on the corresponding combination filter condition of the conditional expression is generated simultaneously Instruction.So, when data are inquired about, data query is carried out according to combinations thereof filter condition expression formula.
In addition, being not include group during the data query for indicating data query mode for obtaining is instructed in testing result In the case of closing filter condition, can further detect whether it includes single filter condition or just do not include at all Filter condition.Wherein, in the case where filter condition is not included, ergodic data table is needed, inquires about all of data; In the case of comprising single filter condition, need to carry out data query according to specific single filter condition.
By the embodiment of the present invention, by the way of without filter condition with reference to single filter condition and combination filter condition, Having reached not only can process the data query without filter condition and single filter condition, and can process and combined The purpose of the data query of filter condition, overcomes the limited defect of filter condition, it is achieved thereby that improving data query effect The technique effect of rate.
Alternatively, whether the data query for indicating data query mode that detection is obtained filters in instructing comprising combination Condition includes:
Whether S2, the data query for indicating data query mode that detection is obtained includes filter condition in instructing;
S4, is comprising filter condition during the data query for indicating data query mode for obtaining is instructed in testing result In the case of, extract the filter condition in instructing from the data query for indicating data query mode for obtaining;
S6, detects and whether there is in the corresponding conditional expression of the filter condition combination condition operator;
S8, in the case of there is combination condition operator in testing result is the corresponding conditional expression of the filter condition, It is determined that the data query for indicating data query mode for obtaining includes combination filter condition in instructing.
Due to combining filter condition it is made up of multiple single filter conditions and certain combination condition operator, therefore, It is determined that in data query instruction whether comprising combination filter condition during, can be in first detection data query statement Whether filter condition is included, in the case of comprising filter condition, from data query instruction the filter condition is extracted, And analyze in the filter condition whether comprising " and " and/or the combination condition operator such as "or", comprising these In the case of combination condition operator, determine in above-mentioned data query instruction comprising combination filter condition.
In addition, in the case of comprising filter condition, and do not include in the filter condition " and " and/or "or" Deng any one in combination condition operator when, determine in above-mentioned data query instruction comprising combination filter condition, And single filter condition is only included, at this point it is possible to being based on the single filter condition carries out data query.
By the embodiment of the present invention, in based on filter condition whether containing combination condition operator by the way of determining Whether comprising combination filter condition in data query instruction, the purpose for fast and accurately determining judged result has been reached.
Alternatively, combining filter condition can be created with reference to single filter condition and corresponding combinational logic relation. Specifically, the step of creating combination filter condition includes:
S10, generates multiple different single filter conditions (namely single filter condition expression formula);
S12, determines the combinational logic relation between multiple different single filter conditions;
S14, selects and the corresponding combination condition fortune of the combinational logic relation between the multiple different single filter condition for determining Operator (e.g., " and ", "or" etc.);
S16, according to generate multiple different single filter conditions, and select from multiple different single filtering rods The corresponding combination condition operator of combinational logic relation between part, creates combination filter condition.That is, using selecting Combination condition operator connects multiple different single filter conditions.
In order to be better described it is above-mentioned realize process, be described in detail by taking table 1 as an example below:
For example, the information that present user wants to inquire about needs to be filtered, and filter condition is:Age is more than 25 or height More than 170.The corresponding filter condition expression formula of the filter condition is:(age > 25) or (height>170), (A or B) is reduced to, wherein, A represents age > 25, and B represents height>170, create combination filter condition Step is as follows:First generate single filter condition A, B, reselection "or" combination condition operator, then use " or Person " connects A, B to create (A or B), wherein (A or B) is just intended to the combination filter condition for creating.
By the embodiment of the present invention, after combination filter condition is created, system not only can be performed based on without filtering rod The data query of part and single filter condition, but also the data query based on combination filter condition can be supported, enrich Data query mode, improves efficiency data query.
Still optionally further, because combination filter condition can include the combination filter condition of non-nesting logic and have nested The combination filter condition of logic.Wherein, the combination filter condition of non-nesting logic only has two single filter conditions and one Individual combination condition operator is constituted;The combination filter condition for having nested logic has plural single filter condition and two Individual and plural combination condition operator is constituted.Based on this, also include the step of above-mentioned establishment combination filter condition:
S18, is selecting and the corresponding combination condition computing of combinational logic relation between multiple different single filter conditions In the case of according with as multiple (i.e. two and two or more), according to default nested logic, combination filter condition is first created Built-in part, then create combination filter condition coat part.
Based on the example in above-mentioned embodiment, the information that present user wants to inquire about needs to be filtered, filter condition For:Age is more than 25 or height is more than 170, while sex is female.The corresponding filter condition expression formula of the filter condition For:((age > 25) or (height>170)) and (sex=female), (A or B) and C are reduced to, Wherein, A represents age > 25, and B represents height>170, C represent sex=female, create the step of combination filter condition It is rapid as follows:First generate single filter condition A, B, reselection "or" combination condition operator, then use " or Person " connects A, B to create (A or B), wherein (*) or (*) is exactly the embedded of whole combination filter condition Part, i.e. internal layer logic;Regenerate single filter condition C, and select " and " combination condition operator, and then Using " and " connection (A either B) and C create (A or B) and C, wherein (*) and (*) It is exactly the coat part for entirely combining filter condition, i.e. outer layer logic, (A or B) and C are exactly finally to need wound That what is built has the combination filter condition of nested logic.
By the embodiment of the present invention, after establishment has the combination filter condition of nested logic, system not only can be performed Based on the data query without filter condition and the combination filter condition of single filter condition and simple non-nesting logic, But also the data query of the combination filter condition that can support to be based on infinite Layer nesting logic, further enrich data Inquiry mode, improves efficiency data query.
Alternatively, the step of generating arbitrary single filter condition in multiple different single filter conditions includes:
S20, creates the object towards arbitrary single filter condition;
S22, in the object towards arbitrary single filter condition for creating object information is added, and object information includes:It is single The Property Name of one filter condition, action type operator, filter value, wherein, Property Name can be by tables of data Row name is served as, such as name, age, the sex in table 1, during action type operator is included but is not limited to below Any one:More than, less than, equal to, comprising, not comprising, start from, end at, filter value can be by tables of data Row in numerical value serve as, such as in table 1 in age column 23,28;
S24, according to the object information of addition arbitrary single filter condition is generated.
By the embodiment of the present invention, after single filter condition is created, establishment base can be provided to combine filter condition Plinth, improves the establishment efficiency of combination filter condition.
Embodiment 2
According to embodiments of the present invention, there is provided a kind of device embodiment of data query side's device.
Fig. 2 is the schematic diagram of a kind of optional data query arrangement according to embodiments of the present invention, as shown in Fig. 2 should Device:Acquiring unit 202, for obtaining the data query instruction for indicating data query mode;Detector unit 204, Whether comprising combination filter condition in instructing for the data query for indicating data query mode that detection is obtained;Look into Unit 206 is ask, for including in being the data query instruction for indicating data query mode for obtaining in testing result In the case of combination filter condition, according to the indicated data query side based on combination filter condition of data query instruction Formula carries out data query.
Wherein, data query mode includes:Without filter condition inquiry mode and having filter condition inquiry mode, there is filtration Condition query mode includes again:Single filter condition inquiry mode and combination filter condition inquiry mode, and combine and filter Condition is made up of according to certain combinational logic multiple single filter conditions.When performing data query operation, need Data query is carried out according to the indicated data query mode of data query instruction.
During enforcement, system receiving user's input querying condition when in the querying condition comprising combination filter condition, is System will carry out conditional expression serializing process, generate a string complete characters as combination filter condition expression formula, The data query for indicating the data query mode based on the corresponding combination filter condition of the conditional expression is generated simultaneously Instruction.So, when data are inquired about, data query is carried out according to combinations thereof filter condition expression formula.
In addition, being not include group during the data query for indicating data query mode for obtaining is instructed in testing result In the case of closing filter condition, can further detect whether it includes single filter condition or just do not include at all Filter condition.Wherein, in the case where filter condition is not included, ergodic data table is needed, inquires about all of data; In the case of comprising single filter condition, need to carry out data query according to specific single filter condition.
By the embodiment of the present invention, by the way of without filter condition with reference to single filter condition and combination filter condition, Having reached not only can process the data query without filter condition and single filter condition, and can process and combined The purpose of the data query of filter condition, overcomes the limited defect of filter condition, it is achieved thereby that improving data query effect The technique effect of rate.
Alternatively, above-mentioned detector unit includes:First detection module, for detection obtain for indicating data query Whether filter condition is included in the data query instruction of mode;Extraction module, for testing result be obtain be used for Indicate in the data query instruction of data query mode comprising in the case of filter condition, from obtaining for indicating data The filter condition is extracted in the data query instruction of inquiry mode;Second detection module, for detecting the filter condition pair Whether there is combination condition operator in the conditional expression answered;First determining module, for testing result be the mistake In the case of there is combination condition operator in the corresponding conditional expression of filter condition, it is determined that obtain for indicating data Comprising combination filter condition in the data query instruction of inquiry mode.
Due to combining filter condition it is made up of multiple single filter conditions and certain combination condition operator, therefore, It is determined that in data query instruction whether comprising combination filter condition during, can be in first detection data query statement Whether filter condition is included, in the case of comprising filter condition, from data query instruction the filter condition is extracted, And analyze in the filter condition whether comprising " and " and/or the combination condition operator such as "or", comprising these In the case of combination condition operator, determine in above-mentioned data query instruction comprising combination filter condition.
In addition, in the case of comprising filter condition, and do not include in the filter condition " and " and/or "or" Deng any one in combination condition operator when, determine in above-mentioned data query instruction comprising combination filter condition, And single filter condition is only included, at this point it is possible to being based on the single filter condition carries out data query.
By the embodiment of the present invention, in based on filter condition whether containing combination condition operator by the way of determining Whether comprising combination filter condition in data query instruction, the purpose for fast and accurately determining judged result has been reached.
Alternatively, combining filter condition can be created with reference to single filter condition and corresponding combinational logic relation. Specifically, said apparatus also include:Creating unit, for creating combination filter condition, wherein, creating unit includes: Generation module, for generating multiple different single filter conditions (namely single filter condition expression formula);Second determines Module, for determining the combinational logic relation between multiple different single filter conditions;Selecting module, for select with It is determined that multiple different single filter conditions between the corresponding combination condition operator of combinational logic relation (e.g., " and ", "or" etc.);Creation module, for according to generate multiple different single filter conditions, and select with it is many The corresponding combination condition operator of combinational logic relation between individual different single filter condition, creates combination filter condition. That is, connecting multiple different single filter conditions using the combination condition operator selected
In order to be better described it is above-mentioned realize process, be described in detail by taking table 1 as an example below:
For example, the information that present user wants to inquire about needs to be filtered, and filter condition is:Age is more than 25 or height More than 170.The corresponding filter condition expression formula of the filter condition is:(age > 25) or (height>170), (A or B) is reduced to, wherein, A represents age > 25, and B represents height>170, create combination filter condition Step is as follows:First generate single filter condition A, B, reselection "or" combination condition operator, then use " or Person " connects A, B to create (A or B), wherein (A or B) is just intended to the combination filter condition for creating.
By the embodiment of the present invention, after combination filter condition is created, system not only can be performed based on without filtering rod The data query of part and single filter condition, but also the data query based on combination filter condition can be supported, enrich Data query mode, improves efficiency data query.
Still optionally further, because combination filter condition can include the combination filter condition of non-nesting logic and have nested The combination filter condition of logic.Wherein, the combination filter condition of non-nesting logic only has two single filter conditions and one Individual combination condition operator is constituted;The combination filter condition for having nested logic has plural single filter condition and two Individual and plural combination condition operator is constituted.Based on this, above-mentioned creation module be additionally operable to select with it is multiple In the case that the corresponding combination condition operator of combinational logic relation between different single filter conditions is multiple, according to Default nesting logic, first creates the built-in part of combination filter condition, then the coat part for creating combination filter condition.
Based on the example in above-mentioned embodiment, the information that present user wants to inquire about needs to be filtered, filter condition For:Age is more than 25 or height is more than 170, while sex is female.The corresponding filter condition expression formula of the filter condition For:((age > 25) or (height>170)) and (sex=female), (A or B) and C are reduced to, Wherein, A represents age > 25, and B represents height>170, C represent sex=female, create the step of combination filter condition It is rapid as follows:First generate single filter condition A, B, reselection "or" combination condition operator, then use " or Person " connects A, B to create (A or B), wherein (*) or (*) is exactly the embedded of whole combination filter condition Part, i.e. internal layer logic;Regenerate single filter condition C, and select " and " combination condition operator, and then Using " and " connection (A either B) and C create (A or B) and C, wherein (*) and (*) It is exactly the coat part for entirely combining filter condition, i.e. outer layer logic, (A or B) and C are exactly finally to need wound That what is built has the combination filter condition of nested logic.
By the embodiment of the present invention, after establishment has the combination filter condition of nested logic, system not only can be performed Based on the data query without filter condition and the combination filter condition of single filter condition and simple non-nesting logic, But also the data query of the combination filter condition that can support to be based on infinite Layer nesting logic, further enrich data Inquiry mode, improves efficiency data query.
Alternatively, above-mentioned generation module is in arbitrary single filter condition in generating multiple different single filter conditions, Including:Submodule is created, for creating the object towards arbitrary single filter condition;Addition submodule, in wound Add object information in the object towards arbitrary single filter condition built, object information includes:Single filter condition Property Name, action type operator, filter value, wherein, Property Name can be served as by the row name of tables of data, such as Name, age, sex in table 1 etc., any one during action type operator is including but not limited to following:More than, Less than, equal to, comprising, not comprising, start from, end at, filter value can be filled by the numerical value in the row of tables of data When, such as in table 1 in age column 23,28;Submodule is generated, it is arbitrary for being generated according to the object information of addition Single filter condition.
By the embodiment of the present invention, after single filter condition is created, establishment base can be provided to combine filter condition Plinth, improves the establishment efficiency of combination filter condition.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain 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, other can be passed through Mode realize.Wherein, device embodiment described above is only schematic, such as division of described unit, Can be a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Can with reference to or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, institute The coupling each other for showing or discussing or direct-coupling or communication connection can be by some interfaces, unit or mould The INDIRECT COUPLING of block or communication connection, can be electrical or other forms.
The unit as separating component explanation can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to On multiple units.Some or all of unit therein can be according to the actual needs selected to realize this embodiment scheme Purpose.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, it is also possible to It is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.It is above-mentioned integrated Unit both can be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized and as independent production marketing or when using using in the form of SFU software functional unit, During a computer read/write memory medium can be stored in.Based on such understanding, technical scheme essence On all or part of prior art is contributed part in other words or the technical scheme can be with software product Form is embodied, and the computer software product is stored in a storage medium, including some instructions are used so that one Platform computer equipment (can be personal computer, server or network equipment etc.) performs each embodiment institute of the invention State all or part of step of method.And aforesaid storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD Etc. it is various can be with the medium of store program codes.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improve and moisten Decorations also should be regarded as protection scope of the present invention.

Claims (10)

1. a kind of data query method, it is characterised in that include:
Obtain the data query for indicating data query mode to instruct;
Whether the data query for indicating data query mode that detection is obtained includes combination filter condition in instructing;
It is comprising the combination during the data query for indicating data query mode for obtaining is instructed in testing result In the case of filter condition, according to the indicated number based on the combination filter condition of data query instruction Data query is carried out according to inquiry mode.
2. method according to claim 1, it is characterised in that detection obtain for indicating data query mode Whether include comprising combination filter condition in data query instruction:
Whether the data query for indicating data query mode that detection is obtained includes filter condition in instructing;
It is comprising filter condition during the data query for indicating data query mode for obtaining is instructed in testing result In the case of, extract the filter condition in instructing from the data query for indicating data query mode for obtaining;
Detect and whether there is in the corresponding conditional expression of the filter condition combination condition operator;
There are the feelings of the combination condition operator in testing result is the corresponding conditional expression of the filter condition Under condition, it is determined that comprising the combination filtering rod during the data query for indicating data query mode for obtaining is instructed Part.
3. method according to claim 1, it is characterised in that the foundation step of the combination filter condition includes:
Generate multiple different single filter conditions;
Determine the combinational logic relation between the plurality of different single filter condition;
Select and corresponding group of the combinational logic relation between the plurality of different single filter condition for determining Close conditional operator;
According to generate the plurality of different single filter conditions, and select from the plurality of different list The corresponding combination condition operator of the combinational logic relation between one filter condition, creates described combination Filter condition.
4. method according to claim 3, it is characterised in that the foundation step of the combination filter condition also includes:
It is corresponding from the combinational logic relation between the plurality of different single filter condition described what is selected In the case that combination condition operator is multiple, according to default nested logic, the combination filter condition is first created Built-in part, then create it is described combination filter condition coat part.
5. method according to claim 3, it is characterised in that in generating the plurality of different single filter condition The step of arbitrary single filter condition, includes:
Create the object towards arbitrary single filter condition;
Add object information, the object information in the object towards arbitrary single filter condition for creating Including:The Property Name of single filter condition, action type operator, filter value;
Arbitrary single filter condition is generated according to the object information of addition.
6. a kind of data query arrangement, it is characterised in that include:
Acquiring unit, for obtaining the data query instruction for indicating data query mode;
Whether detector unit, wrap in instructing for the data query for indicating data query mode that detection is obtained The filter condition containing combination;
Query unit, for instructing in the data query for indicating data query mode that testing result is acquisition In comprising the combination filter condition in the case of, according to data query instruction it is indicated based on described group Closing the data query mode of filter condition carries out data query.
7. device according to claim 6, it is characterised in that the detector unit includes:
First detection module, be in instructing for the data query for indicating data query mode that detection is obtained It is no comprising filter condition;
Extraction module, for instructing in the data query for indicating data query mode that testing result is acquisition In comprising in the case of filter condition, carry in instructing from the data query for indicating data query mode for obtaining Take the filter condition;
Second detection module, for detecting the corresponding conditional expression of the filter condition in whether there is combination condition Operator;
First determining module, it is described for existing in being the corresponding conditional expression of the filter condition in testing result In the case of combination condition operator, it is determined that during the data query for indicating data query mode for obtaining is instructed Comprising the combination filter condition.
8. device according to claim 6, it is characterised in that described device also includes:Creating unit, for creating The combination filter condition is built, wherein, the creating unit includes:
Generation module, for generating multiple different single filter conditions;
Second determining module, for determining the combinational logic relation between the plurality of different single filter condition;
Selecting module, for selecting to be patrolled from the combination between the plurality of different single filter condition for determining Collect the corresponding combination condition operator of relation;
Creation module, for according to generate the plurality of different single filter conditions, and select with institute The corresponding combination condition operator of the combinational logic relation between multiple different single filter conditions is stated, Create the combination filter condition.
9. device according to claim 8, it is characterised in that the creation module be additionally operable to select with it is described The corresponding combination condition operator of the combinational logic relation between multiple different single filter conditions is many In the case of individual, according to default nested logic, the built-in part of the combination filter condition is first created, then created The coat part of the combination filter condition.
10. device according to claim 8, it is characterised in that the generation module generate it is the plurality of different In single filter condition during arbitrary single filter condition, including:
Submodule is created, for creating the object towards arbitrary single filter condition;
Addition submodule, for adding object letter in the object towards arbitrary single filter condition for creating Breath, the object information includes:The Property Name of single filter condition, action type operator, filter value;
Submodule is generated, for generating arbitrary single filter condition according to the object information of addition.
CN201510710825.7A 2015-10-27 2015-10-27 Data query method and device Pending CN106611031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510710825.7A CN106611031A (en) 2015-10-27 2015-10-27 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510710825.7A CN106611031A (en) 2015-10-27 2015-10-27 Data query method and device

Publications (1)

Publication Number Publication Date
CN106611031A true CN106611031A (en) 2017-05-03

Family

ID=58615147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510710825.7A Pending CN106611031A (en) 2015-10-27 2015-10-27 Data query method and device

Country Status (1)

Country Link
CN (1) CN106611031A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052571A (en) * 2017-12-07 2018-05-18 网易乐得科技有限公司 For the method and device of data screening, storage medium and electronic equipment
CN110119813A (en) * 2019-04-28 2019-08-13 武汉开目信息技术股份有限公司 Judge the knowledge rule modeling and inference method that parameter is separated with decision logic
CN110674179A (en) * 2019-09-24 2020-01-10 政采云有限公司 Query interface generation method, device and medium
CN112559576A (en) * 2019-09-26 2021-03-26 北京国双科技有限公司 Data display method, system, device, storage medium and electronic equipment
CN112765286A (en) * 2021-02-01 2021-05-07 广州海量数据库技术有限公司 Query method and device based on relational database

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050210001A1 (en) * 2004-03-22 2005-09-22 Yeun-Jonq Lee Field searching method and system having user-interface for composite search queries
US20090024593A1 (en) * 2007-07-16 2009-01-22 International Business Machines Corporation Query predicate generator to construct a database query predicate from received query conditions
CN102236659A (en) * 2010-04-27 2011-11-09 中国银联股份有限公司 Method and system for filtering data from data source by using complex conditions
CN102819545A (en) * 2011-12-22 2012-12-12 金蝶软件(中国)有限公司 Bill inquiring method and device based on general filtering condition compound assembly
CN103744891A (en) * 2013-12-23 2014-04-23 大唐软件技术股份有限公司 Method and system for data query

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050210001A1 (en) * 2004-03-22 2005-09-22 Yeun-Jonq Lee Field searching method and system having user-interface for composite search queries
US20090024593A1 (en) * 2007-07-16 2009-01-22 International Business Machines Corporation Query predicate generator to construct a database query predicate from received query conditions
CN102236659A (en) * 2010-04-27 2011-11-09 中国银联股份有限公司 Method and system for filtering data from data source by using complex conditions
CN102819545A (en) * 2011-12-22 2012-12-12 金蝶软件(中国)有限公司 Bill inquiring method and device based on general filtering condition compound assembly
CN103744891A (en) * 2013-12-23 2014-04-23 大唐软件技术股份有限公司 Method and system for data query

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052571A (en) * 2017-12-07 2018-05-18 网易乐得科技有限公司 For the method and device of data screening, storage medium and electronic equipment
CN110119813A (en) * 2019-04-28 2019-08-13 武汉开目信息技术股份有限公司 Judge the knowledge rule modeling and inference method that parameter is separated with decision logic
CN110674179A (en) * 2019-09-24 2020-01-10 政采云有限公司 Query interface generation method, device and medium
CN112559576A (en) * 2019-09-26 2021-03-26 北京国双科技有限公司 Data display method, system, device, storage medium and electronic equipment
CN112765286A (en) * 2021-02-01 2021-05-07 广州海量数据库技术有限公司 Query method and device based on relational database

Similar Documents

Publication Publication Date Title
CN106611031A (en) Data query method and device
CN104143001B (en) Search term recommends method and device
CN105279535B (en) A kind of identification code intellectual analysis processing system and its processing method
CN104537341B (en) Face picture information getting method and device
RU2019114229A (en) FILTERS OF SEARCH RESULTS FROM THE CONTENT OF RESOURCES
CN105302815B (en) The filter method and device of the uniform resource position mark URL of webpage
CN104636349B (en) A kind of index data compression and the method and apparatus of index data search
CN109409964A (en) The recognition methods of Premium Brands and device
CN105893436A (en) Single-account multi-hobby recommendation method and device of video website
CN103810300B (en) The data query method and apparatus covered for non-index
CN106557499A (en) HBase secondary indexs creation method and device
CN103761232B (en) A kind of method and apparatus that web page media content information is provided
CN106933897A (en) Data query method and apparatus
JP2020534622A5 (en)
CN103763760B (en) Network selecting method and 4G multimode terminals
CN104679791A (en) Processing method and device for acquiring data packets
CN109643363A (en) The mthods, systems and devices of feature extraction and object detection
CN106933904B (en) The filter method and device of data
CN107807793A (en) The storage of data trnascription isomery and access method in distributed computer storage system
CN105224533B (en) Browser collection folder method for sorting and device
CN104484451B (en) The extracting method and device of Webpage information
CN112905874B (en) House resource retrieval method, device, storage medium and equipment
US11386340B2 (en) Method and apparatus for performing block retrieval on block to be processed of urine sediment image
CN106681892B (en) The treating method and apparatus of page data
CN105335493B (en) A kind of method and device of layered filtration document

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

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: 8 floors of Cuigong Hotel, 76 Zhichun Road, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20170503

RJ01 Rejection of invention patent application after publication