CN105550270B - Data base query method and device - Google Patents

Data base query method and device Download PDF

Info

Publication number
CN105550270B
CN105550270B CN201510907662.1A CN201510907662A CN105550270B CN 105550270 B CN105550270 B CN 105550270B CN 201510907662 A CN201510907662 A CN 201510907662A CN 105550270 B CN105550270 B CN 105550270B
Authority
CN
China
Prior art keywords
value
field
statistical dimension
record
statistical
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.)
Active
Application number
CN201510907662.1A
Other languages
Chinese (zh)
Other versions
CN105550270A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201510907662.1A priority Critical patent/CN105550270B/en
Publication of CN105550270A publication Critical patent/CN105550270A/en
Application granted granted Critical
Publication of CN105550270B publication Critical patent/CN105550270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2264Multidimensional index structures
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Abstract

This application discloses data base query methods and device.One specific embodiment of data base query method includes: the value of the multiple scheduled fields for the record inquired in scheduled table in the database, wherein multiple scheduled fields include: at least two statistical dimension fields for using the dimension to take statistics;According to the value of multiple scheduled fields of record, generate Virtual table, wherein, record in Virtual table includes following information: statistical dimension combination mark combines the value for identifying corresponding each statistical dimension field with statistical dimension, wherein, statistical dimension combination mark is the combination based on each field name at least two statistical dimension fields and the mark generated;Inquiry by the record in Virtual table according to statistical dimension combination mark, combine with statistical dimension identify corresponding each statistical dimension field value be grouped after, the corresponding statistic of each group.This embodiment, reduces the access to Data source table, have saved a large amount of human cost and computing resource.

Description

Data base query method and device
Technical field
This application involves field of computer technology, and in particular to database technical field more particularly to data base querying side Method and device.
Background technique
With the arrival of big data era, the data of magnanimity are obtained, are stored, are searched for, are shared, are parsed into work as Preceding important research topic.Can capture within reasonable time, manage, handle and arrange by big data analysis becomes energy Enterprise management decision-making is helped to generate the information of positive purpose.
However, with universal and data volume the sharply expansion of big data the relevant technologies, calculating task amount and calculating are complicated Degree is also risen sharply therewith.Statistical of the prior art for a variety of statistical dimensions combination with multiple optional statistical dimensions Analysis needs the statistical analysis for the combination of every kind of statistical dimension to be carried out primary dedicated query statement.So that manpower at This is higher, and consumes larger amount of computing resource.
Summary of the invention
The purpose of the application is to propose a kind of data base query method and device, mentions to solve background section above To the technical issues of.
In a first aspect, this application provides a kind of data base query method the described method includes: inquiring in the database pre- The value of multiple scheduled fields of record in fixed table, wherein the multiple scheduled field includes: that at least two use take statistics The statistical dimension field of dimension;According to the value of multiple scheduled fields of the record, Virtual table is generated, wherein the Virtual table In record include following information: statistical dimension combination mark combines with the statistical dimension and to identify corresponding each statistics The value of dimension field, wherein statistical dimension combination mark is based on each field in at least two statistical dimensions field The combination of title and the mark generated;Inquiry the record in the Virtual table combines mark and institute according to the statistical dimension State statistical dimension combination identify corresponding each statistical dimension field value be grouped after, the corresponding statistic of each group.
Second aspect, this application provides a kind of database inquiry device, described device includes: field value query unit, The value of multiple scheduled fields of record for being inquired in scheduled table in the database, wherein the multiple scheduled field packet Include: at least two use the statistical dimension field of the dimension to take statistics;Virtual table generation unit, for according to the multiple of the record The value of scheduled field generates Virtual table, wherein the record in the Virtual table includes following information: statistical dimension combination mark, The value for identifying corresponding each statistical dimension field is combined with the statistical dimension, wherein statistical dimension combination mark is base The combination of each field name in at least two statistical dimensions field and the mark generated;Statistic cargo tracer Member the record in the Virtual table combines mark according to statistical dimension combination mark, with the statistical dimension for inquiring After the value of sensible corresponding each statistical dimension field is grouped, the corresponding statistic of each group.
Data base query method and device provided by the present application, by according to the multiple scheduled fields of record inquired Value, generating includes that statistical dimension combination identifies, combines the corresponding each statistical dimension field of mark with the statistical dimension The Virtual table of the information such as value, and mark and institute the record in the Virtual table are combined according to the statistical dimension by inquiry State statistical dimension combination identify corresponding each statistical dimension field value be grouped after, the corresponding statistic of each group, Reduce the access when needing to inquire the statistical data of various statistical dimension combinations to Data source table, saves a large amount of manpower Cost and computing resource.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is the flow chart according to one embodiment of the data base query method of the application;
Fig. 2 is the illustrative diagram according to the inquiry data of the data base query method of the application;
Fig. 3 is the flow chart according to another embodiment of the data base query method of the application;
Fig. 4 is the structural schematic diagram according to one embodiment of the database inquiry device of the application;
Fig. 5 is adapted for the structural schematic diagram for the computer system for realizing the server of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In addition it is also necessary to illustrate, data base query method provided by the embodiment of the present application is usually held by server Row.Correspondingly, database inquiry device is generally disposed in server.
The process 100 of one embodiment of the data base query method according to the application is shown below with reference to Fig. 1, Fig. 1.
As shown in Figure 1, the data base query method of the present embodiment the following steps are included:
Step 101, the value of multiple scheduled fields of the record in scheduled table is inquired in the database.
Wherein, above-mentioned multiple scheduled fields include: at least two statistical dimension fields for using the dimension to take statistics.
In the present embodiment, data base query method operation can be by executing scheduled inquiry language with server thereon Sentence inquires the value of multiple scheduled fields of the record in scheduled table in the database.Wherein, query statement for example can be SQL (Structured Query Language, structured query language), HQL (Hibernate Query Language) etc. are looked into Ask the SELECT statement in language.The dimension of above-mentioned statistics refers to the goal condition (parameter) of statistics, for example, if to count net The request number of times of the various operation requests types (such as: browsing, reply) of user in network forum, then operation requests type is exactly The dimension of the statistics;If the request wanted the various operation requests of counting user, send various operating systems used when request Number (such as counting user with Android android system send browse request request number of times), then operation requests type and Operating system is exactly two dimensions of the statistics.
Step 102, according to the value of multiple scheduled fields of above-mentioned record, Virtual table is generated.
Wherein, the record in above-mentioned Virtual table includes following information: statistical dimension combination mark and above-mentioned statistical dimension group Close the value for identifying corresponding each statistical dimension field, wherein statistical dimension combination mark is based on above-mentioned at least two system The mark counting the combination of each field name in dimension field and generating.
In the present embodiment, server can be first based on each field name in above-mentioned at least two statistical dimensions field Combination, generate and multiple combine mark at least one corresponding statistical dimension of statistical dimension field.For example, it is assumed that above-mentioned statistics The field name of dimension field has: " request type ", " operating system ", " version ", so that it may generate corresponding with " request type " Statistical dimension combination mark " 001 ", combine mark " 002 " with " request type " and " operating system " corresponding statistical dimension, Mark " 003 " is combined with " request type ", " operating system " and " version " corresponding statistical dimension, and so on.
Then, according to the value of multiple scheduled fields of above-mentioned record, it is corresponding to obtain each statistical dimension combination mark The value of each statistical dimension field, to generate above-mentioned Virtual table.For example, it is assumed that the value of multiple scheduled fields of above-mentioned record It is as shown in table 1:
Table 1:
Request type Operating system Version
Browsing iOS 6.5
It replys iOS 6.7
It replys Android 6.5
Then according to the value of three of the record in table 1 fields, Virtual table as shown in Table 2 can be generated:
Table 2:
Step 103, inquiry ties up the record in above-mentioned Virtual table according to above-mentioned statistical dimension combination mark, with above-mentioned statistics After the value that degree combination identifies corresponding each statistical dimension field is grouped, the corresponding statistic of each group.
In the present embodiment, server can be by the sentence (such as GROUP BY sentence) for grouping come according to above-mentioned Statistical dimension combination mark combines with above-mentioned statistical dimension and to identify the value of corresponding each statistical dimension field and be grouped, And the corresponding statistic of each group is inquired by scheduled statistical function (such as: SUM () function, COUNT () function).
By taking above-mentioned Virtual table as shown in Table 2 as an example, statistic that step 103 inquires: request number of times can be such as table 3 It is shown:
Table 3:
Statistical dimension combination mark Statistical dimension field value Request number of times
001 Browsing 1
001 It replys 2
002 Browsing | iOS 1
002 Reply | iOS 1
002 Reply | Android 1
003 Browsing | iOS | 6.5 1
003 Reply | iOS | 6.7 1
003 Reply | Android | 6.5 1
In table 3, one group of each behavior.
In some optional implementations of the present embodiment, step 101 may include: inquire in the database it is scheduled The value of multiple scheduled fields of the record for meeting preset condition in table.To which server can go out accord with according to various condition queries The record of conjunction condition, so that subsequent statistical query is more targeted.
In addition, above-mentioned scheduled table can have at least two in some optional implementations of the present embodiment.And Step 101 may include: the value of the multiple scheduled fields for the record inquired respectively at least two scheduled tables in the database; Record in each tables of data inquired is merged.So that the recording interval that step 101 inquires is wider more comprehensively.
Below with reference to Fig. 2, Fig. 2 shows the exemplary signals according to the inquiry data of the data base query method of the application Figure.
As shown in Fig. 2, server first inquiry table 1 ..., the statistical dimension field 1 of record in table N ..., statistical dimension The value of field M, wherein N can be the natural number more than or equal to 1, and M can be the natural number more than or equal to 2;Then, according to looking into The value for asking each statistical dimension field of record all, generates above-mentioned Virtual table;Finally, having inquired root according to Virtual table According to statistics dimension combination mark, combine with above-mentioned statistical dimension and to identify the value of corresponding each statistical dimension field and be divided into After L group, the corresponding statistic of each group.
Data base query method provided in this embodiment, by the value according to the multiple scheduled fields of record inquired, It generates and identifies including statistical dimension combination, combines the value for identifying corresponding each statistical dimension field with above-mentioned statistical dimension etc. The Virtual table of information, and mark and above-mentioned system the record in above-mentioned Virtual table are combined according to above-mentioned statistical dimension by inquiry After the value that meter dimension combination identifies corresponding each statistical dimension field is grouped, the corresponding statistic of each group is reduced Access when needing to inquire the statistical data of various statistical dimensions combinations to Data source table, has saved a large amount of human cost And computing resource.
The process of another embodiment of the data base query method according to the application is shown with further reference to Fig. 3, Fig. 3 300。
As shown in figure 3, the data base query method of the present embodiment the following steps are included:
Step 301, the value of multiple scheduled fields of the record in scheduled table is inquired in the database.
Wherein, above-mentioned multiple scheduled fields include: at least two with the statistical dimension fields of dimension to take statistics and extremely Few one is used as the objects of statistics field of objects of statistics.
In the present embodiment, the difference of step 301 and the step 101 in Fig. 1 corresponding embodiment is: above-mentioned multiple predetermined Field further includes the objects of statistics field that at least one is used as objects of statistics.Wherein, for being recorded shown in above-mentioned table 1, this The objects of statistics field of the above-mentioned record of embodiment for example can be with are as follows: user name, the record that the present embodiment inquires can be such as tables 4 It is shown:
Table 4:
Request type Operating system Version User name
Browsing iOS 6.5 Zhang San
It replys iOS 6.7 Li Si
It replys Android 6.5 Li Si
The specific processing of the other parts of step 301 can refer to the detailed of the above-mentioned step 101 in Fig. 1 corresponding embodiment Description, details are not described herein.
Step 302, according to the value of multiple scheduled fields of above-mentioned record, Virtual table is generated.
Wherein, the record in above-mentioned Virtual table includes following information: statistical dimension combination mark, with above-mentioned statistical dimension group The value for identifying corresponding each statistical dimension field is closed, and combines with statistical dimension mark, each statistical dimension field It is worth the value of associated objects of statistics field, wherein statistical dimension combination mark is based on above-mentioned at least two statistical dimensions word The combination of each field name in section and the mark that generates.
In the present embodiment, the difference of step 302 and the step 102 in Fig. 1 corresponding embodiment is: in above-mentioned Virtual table Record further include the value that mark, the associated objects of statistics field of value of each statistical dimension field are combined with statistical dimension. For record in the Virtual table shown in the above-mentioned table 2, the record in the above-mentioned Virtual table of the present embodiment increases objects of statistics It, can be as shown in table 5 after the information of the value of field:
Table 5:
The specific processing of the other parts of step 302 can refer to the detailed of the above-mentioned step 101 in Fig. 1 corresponding embodiment Description, details are not described herein.
Step 303, inquiry ties up the record in above-mentioned Virtual table according to above-mentioned statistical dimension combination mark, with above-mentioned statistics After the value that degree combination identifies corresponding each statistical dimension field is grouped, corresponding to the corresponding objects of statistics field of each group Statistic.
In the present embodiment, what step 303 was specifically inquired is statistic corresponding to objects of statistics field.With it is above-mentioned such as For Virtual table shown in table 4, statistic corresponding to the objects of statistics field that step 303 inquires: user number can be with It is as shown in table 6:
Table 6:
Statistical dimension combination mark Statistical dimension field value User number
001 Browsing 1
001 It replys 1
002 Browsing | iOS 1
002 Reply | iOS 1
002 Reply | Android 1
003 Browsing | iOS | 6.5 1
003 Reply | iOS | 6.7 1
003 Reply | Android | 6.5 1
Similarly, in table 6, one group of each behavior.
In some optional implementations of the present embodiment, statistic corresponding to above-mentioned each group objects of statistics field May include: the corresponding objects of statistics field value of each group count value or the corresponding objects of statistics field value of each group and value. Wherein, the count value of objects of statistics field value can refer to the column of the user number in table 6, and server can pass through COUNT () function The count value of query statistic object field value;Objects of statistics field value can be number in the type of objects of statistics field with value When type, obtained by SUM () function.
In some optional implementations of the present embodiment, the record in above-mentioned Virtual table can also include: and count Dimension combines the corresponding count information of value of mark, the value of each statistical dimension field, objects of statistics field.To make Virtual table The statistical information more refined is increased, sends various requests in every kind of statistical dimension combination for example, each user can be counted Number.For example, corresponding with Virtual table shown in table 5, the Virtual table of this implementation can be as shown in table 7:
Table 7:
Statistical dimension combination mark Statistical dimension field value User name Request number of times
001 Browsing Zhang San 1
001 It replys Li Si 2
002 Browsing | iOS Zhang San 1
002 Reply | iOS Li Si 1
002 Reply | Android Li Si 1
003 Browsing | iOS | 6.5 Zhang San 1
003 Reply | iOS | 6.7 Li Si 1
003 Reply | Android | 6.5 Li Si 1
Based on above-mentioned implementation, in some optional implementations of the present embodiment, step 303 may include: to look into It is corresponding that mark is combined the record in above-mentioned Virtual table according to above-mentioned statistical dimension combination mark, with above-mentioned statistical dimension in inquiry After the value of each statistical dimension field is grouped, statistic and each group corresponding to the corresponding objects of statistics field of each group Corresponding count information and value.For the Virtual table shown in the table 7, the corresponding statistics of each group that this implementation is inquired Statistic corresponding to object field and the corresponding count information of each group and value can be as shown in table 8:
Table 8:
By the implementation, so that the present embodiment has inquired more comprehensive statistical information.
Data base querying from Fig. 3 and table 4- table 6 as can be seen that compared with the corresponding embodiment of Fig. 1, in the present embodiment The process 300 of method increases the step of counting to objects of statistics field.The scheme of the present embodiment description can be as a result, Under the premise of not increasing the access times to Data source table, more comprehensive statistical information is inquired.
It should be noted that given example is intended to make the technical solution of the application to be best understood from the various embodiments described above, and Not whole implementations of the present embodiment.For example, statistical dimension combination mark can also using other forms mark (such as A, b, c), statistical dimension combination mark can also have: it is corresponding with " operating system ", it is corresponding with " version ", with " operating system " and " version " is corresponding, and combines corresponding statistical dimension combination mark with various other.
Below with reference to Fig. 4, as the realization to method shown in above-mentioned each figure, this application provides a kind of data base querying dresses The one embodiment set, the Installation practice is corresponding with embodiment of the method shown in FIG. 1, which specifically can be applied to take It is engaged in device.
As shown in figure 4, the above-mentioned database inquiry device 400 of the present embodiment include: field value query unit 401, it is virtual Table generation unit 402 and statistic query unit 403.Wherein, field value query unit 401 for inquiring in the database The value of multiple scheduled fields of record in scheduled table, wherein above-mentioned multiple scheduled fields include: at least two with taking statistics Dimension statistical dimension field;Virtual table generation unit 402 is used for the value of multiple scheduled fields according to above-mentioned record, generates Virtual table, wherein the record in above-mentioned Virtual table includes following information: statistical dimension combination mark and above-mentioned statistical dimension group Close the value for identifying corresponding each statistical dimension field, wherein statistical dimension combination mark is based on above-mentioned at least two system The mark counting the combination of each field name in dimension field and generating;Statistic query unit 403 for inquire by The record in Virtual table is stated to be identified according to the combination of above-mentioned statistical dimension, combine the corresponding each system of mark with above-mentioned statistical dimension After the value of meter dimension field is grouped, the corresponding statistic of each group.
In the present embodiment, field value query unit 401, Virtual table generation unit 402 and statistic query unit 403 specific processing can respectively retouch step 101, step 102, the detailed of step 103 in Fig. 1 corresponding embodiment with reference to above-mentioned It states, details are not described herein.
In some optional implementations of the present embodiment, field value query unit 401 can be further configured to The value of multiple scheduled fields of the record for meeting preset condition in scheduled table is inquired in the database.To which server can be with Go out qualified record according to various condition queries, so that subsequent statistical query is more targeted.
In some optional implementations of the present embodiment, above-mentioned scheduled table can have at least two.And it is above-mentioned Field value query unit 401 may include: field value inquiry subelement (not shown), for inquiring respectively in the database The value of multiple scheduled fields of record at least two scheduled tables;Record merges subelement (not shown), and being used for will Record in each tables of data inquired merges.So that the recording interval that step 101 inquires is wider more comprehensively.
In some optional implementations of the present embodiment, multiple scheduled fields of the inquiry of field value query unit 401 It can also include the objects of statistics field that at least one is used as objects of statistics.And Virtual table generation unit generation 402 is above-mentioned Record in Virtual table can also include: that mark, the associated statistics of value of each statistical dimension field are combined with statistical dimension The value of object field.And the corresponding statistic of above-mentioned each group that above-mentioned statistic query unit 403 is inquired includes: each Statistic corresponding to the corresponding objects of statistics field of group.Field value query unit 401, Virtual table in this implementation is raw It can be respectively with reference to above-mentioned at the specific processing of unit 402 and statistic query unit 403 and its brought technical effect To step 301, step 302, the detailed description of step 303 in Fig. 3 corresponding embodiment, details are not described herein.
In some optional implementations of the present embodiment, the above-mentioned each group that statistic query unit 403 is inquired is united Statistic corresponding to meter object field may include: the count value or each group of the corresponding objects of statistics field value of each group Corresponding objects of statistics field value and value.The specific processing of this implementation and its brought technical effect can refer to above-mentioned To the detailed description of implementation corresponding in Fig. 3 corresponding embodiment, details are not described herein.
Note in some optional implementations of the present embodiment, in the Virtual table of the generation of Virtual table generation unit 402 Record can also include: the corresponding meter of value that mark, the value of each statistical dimension field, objects of statistics field are combined with statistical dimension Number information.The specific processing of this implementation can refer to the above-mentioned detailed description to implementation corresponding in Fig. 3 corresponding embodiment, Details are not described herein.
Based on above-mentioned implementation, in some optional implementations of the present embodiment, statistic query unit 403 It can further be configured to inquire the record in above-mentioned Virtual table according to above-mentioned statistical dimension combination mark and above-mentioned statistics After the value that dimension combination identifies corresponding each statistical dimension field is grouped, the corresponding objects of statistics field institute of each group is right The corresponding count information of statistic and each group answered and value.The specific processing of this implementation and its brought technology Effect can refer to the above-mentioned detailed description to implementation corresponding in Fig. 3 corresponding embodiment, and details are not described herein.
It will be understood by those skilled in the art that above-mentioned database inquiry device 400 further includes some other known features, example Such as processor, memory, in order to unnecessarily obscure embodiment of the disclosure, these well known structures are not shown in Fig. 4.
Database inquiry device provided in this embodiment, by Virtual table generation unit 402 according to field value query unit The value of multiple scheduled fields of 401 records inquired, generating includes that statistical dimension combination is identified, combined with above-mentioned statistical dimension The Virtual table of the information such as the value of corresponding each statistical dimension field is identified, and is inquired by statistic query unit 403 By the record in above-mentioned Virtual table according to above-mentioned statistical dimension combination mark, combine with above-mentioned statistical dimension identify it is corresponding respectively After the value of a statistical dimension field is grouped, the corresponding statistic of each group reduces and is needing to inquire various statistical dimensions Access when combined statistical data to Data source table, has saved a large amount of human cost and computing resource.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the server for being suitable for being used to realize the embodiment of the present application Structural schematic diagram.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in machine readable Computer program on medium, the computer program include the program code for method shown in execution flow chart.At this In the embodiment of sample, which can be downloaded and installed from network by communications portion 509, and/or from removable Medium 511 is unloaded to be mounted.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yiyong The dedicated hardware based system of defined functions or operations is executed to realize, or can be referred to specialized hardware and computer The combination of order is realized.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include field value query unit, Virtual table generation unit and statistic query unit.Wherein, the title of these units is at certain In the case of do not constitute restriction to the unit itself, for example, field value query unit is also described as " in the database Inquire the unit of the value of multiple scheduled fields of the record in scheduled table ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media, the non-volatile calculating Machine storage medium can be nonvolatile computer storage media included in device described in above-described embodiment;It is also possible to Individualism, without the nonvolatile computer storage media in supplying terminal.Above-mentioned nonvolatile computer storage media is deposited One or more program is contained, when one or more of programs are executed by an equipment, so that the equipment: in number According to the value of the multiple scheduled fields for the record inquired in library in scheduled table, wherein the multiple scheduled field includes: at least two A statistical dimension field with the dimension to take statistics;According to the value of multiple scheduled fields of the record, Virtual table is generated, In, the record in the Virtual table includes following information: statistical dimension combination mark combines mark relatively with the statistical dimension The value for each statistical dimension field answered, wherein statistical dimension combination mark is based on at least two statistical dimensions field In each field name combination and the mark that generates;Inquiry is by the record in the Virtual table according to the statistical dimension group Close mark, combine with the statistical dimension identify corresponding each statistical dimension field value be grouped after, each group correspondence Statistic.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the inventive concept, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (14)

1. a kind of data base query method, which is characterized in that the described method includes:
The value of multiple scheduled fields of the record in scheduled table is inquired in the database, wherein the multiple scheduled field packet Include: at least two use the statistical dimension field of the dimension to take statistics;
According to the value of multiple scheduled fields of the record, Virtual table is generated, wherein the record in the Virtual table includes following Information: statistical dimension combination mark combines the value for identifying corresponding each statistical dimension field with the statistical dimension, In, statistical dimension combination mark is the combination based on each field name in at least two statistical dimensions field and generates Mark, the corresponding statistical dimension combination mark of identical quantity statistical dimension field is identical;
Record in the Virtual table is identified according to statistical dimension combination, combines mark phase with the statistical dimension by inquiry After the value of corresponding each statistical dimension field is grouped, the corresponding statistic of each group.
2. the method according to claim 1, wherein described inquire record in scheduled table in the database The value of multiple scheduled fields includes:
The value of multiple scheduled fields of the record for meeting preset condition in scheduled table is inquired in the database.
3. the method according to claim 1, wherein the scheduled table has at least two;And
The value of multiple scheduled fields of the record inquired in scheduled table in the database includes:
Inquire the value of multiple scheduled fields of the record at least two scheduled tables respectively in the database;
Record in each tables of data inquired is merged.
4. method according to claim 1 to 3, which is characterized in that the multiple scheduled field further includes at least one Objects of statistics field as objects of statistics;And
Record in the Virtual table further include: it is associated that mark, the value of each statistical dimension field are combined with statistical dimension The value of objects of statistics field;And
The corresponding statistic of each group includes: statistic corresponding to the corresponding objects of statistics field of each group.
5. according to the method described in claim 4, it is characterized in that, statistic corresponding to each group objects of statistics field Include: the corresponding objects of statistics field value of each group count value or the corresponding objects of statistics field value of each group and value.
6. according to the method described in claim 5, it is characterized in that, record in the Virtual table further include: with statistical dimension Combine the corresponding count information of value of mark, the value of each statistical dimension field, objects of statistics field.
7. according to the method described in claim 6, it is characterized in that, the inquiry is by the record in the Virtual table according to Statistical dimension combination mark combines with the statistical dimension and to identify the value of corresponding each statistical dimension field and be grouped Afterwards, the corresponding statistic of each group, comprising:
Record in the Virtual table is identified according to statistical dimension combination, combines mark phase with the statistical dimension by inquiry After the value of corresponding each statistical dimension field is grouped, statistic corresponding to the corresponding objects of statistics field of each group with And the corresponding count information of each group and value.
8. a kind of database inquiry device, which is characterized in that described device includes:
Field value query unit, the value of multiple scheduled fields of the record for being inquired in scheduled table in the database, wherein The multiple scheduled field includes: at least two statistical dimension fields for using the dimension to take statistics;
Virtual table generation unit generates Virtual table, wherein the void for the value according to multiple scheduled fields of the record Record in quasi- table includes following information: statistical dimension combination mark, combined with the statistical dimension identify it is corresponding each The value of statistical dimension field, wherein statistical dimension combination mark is based on each in at least two statistical dimensions field The combination of field name and the mark generated, the corresponding statistical dimension combination mark of identical quantity statistical dimension field are identical;
Statistic query unit, for inquire by the record in the Virtual table according to the statistical dimension combination mark, with After the value that the statistical dimension combination identifies corresponding each statistical dimension field is grouped, the corresponding statistical number of each group Value.
9. device according to claim 8, which is characterized in that the field value query unit is further configured in number According to the value of the multiple scheduled fields for the record for meeting preset condition inquired in library in scheduled table.
10. device according to claim 8, which is characterized in that the scheduled table has at least two;And
The field value query unit includes:
Field value inquires subelement, and the multiple of the record for being inquired at least two scheduled tables respectively in the database make a reservation for The value of field;
Record merges subelement, for merging the record in each tables of data inquired.
11. according to any device of claim 8-10, which is characterized in that the field value query unit is inquired described Multiple scheduled fields further include the objects of statistics field that at least one is used as objects of statistics;And
The record in the Virtual table that the Virtual table generation unit generates further include: mark, each is combined with statistical dimension The value of the associated objects of statistics field of the value of statistical dimension field;And
The corresponding statistic of each group of the statistic query unit inquiry includes: the corresponding objects of statistics word of each group Statistic corresponding to section.
12. device according to claim 11, which is characterized in that each group of the statistic query unit inquiry Statistic corresponding to objects of statistics field includes: the count value or each group pair of the corresponding objects of statistics field value of each group The objects of statistics field value answered and value.
13. device according to claim 12, which is characterized in that in the Virtual table that the Virtual table generation unit generates Record further include: the corresponding counting of value of mark, the value of each statistical dimension field, objects of statistics field is combined with statistical dimension Information.
14. device according to claim 13, which is characterized in that the statistic query unit is further configured to It is corresponding that mark is combined the record in the Virtual table according to statistical dimension combination mark, with the statistical dimension in inquiry Each statistical dimension field value be grouped after, statistic corresponding to the corresponding objects of statistics field of each group and each The corresponding count information of group and value.
CN201510907662.1A 2015-12-09 2015-12-09 Data base query method and device Active CN105550270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510907662.1A CN105550270B (en) 2015-12-09 2015-12-09 Data base query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510907662.1A CN105550270B (en) 2015-12-09 2015-12-09 Data base query method and device

Publications (2)

Publication Number Publication Date
CN105550270A CN105550270A (en) 2016-05-04
CN105550270B true CN105550270B (en) 2019-07-12

Family

ID=55829459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510907662.1A Active CN105550270B (en) 2015-12-09 2015-12-09 Data base query method and device

Country Status (1)

Country Link
CN (1) CN105550270B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106372985B (en) * 2016-08-30 2020-11-06 五八同城信息技术有限公司 Order data processing method and device
CN107025542B (en) * 2016-10-27 2020-12-29 创新先进技术有限公司 Method and apparatus for providing integration capability of channel combination
CN108268524A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 Database aggregation processing method and device
CN109947791B (en) * 2019-03-27 2021-01-26 上海达梦数据库有限公司 Database statement optimization method, device, equipment and storage medium
CN110928928B (en) * 2019-12-09 2023-03-14 中国建设银行股份有限公司 Data statistics method and device for investment subject, electronic equipment and storage medium
CN111143433A (en) * 2019-12-10 2020-05-12 中国平安财产保险股份有限公司 Method and device for counting data of data bins
CN111367966B (en) * 2020-03-05 2024-04-12 天翼数字生活科技有限公司 Method, device and cluster system for carrying out multidimensional statistics on data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729448A (en) * 2013-12-31 2014-04-16 深圳市科漫达智能管理科技有限公司 Method and device for querying data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050203903A1 (en) * 2004-03-10 2005-09-15 Rajan Rajeev B. System and method for locking and isolation in a storage platform

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729448A (en) * 2013-12-31 2014-04-16 深圳市科漫达智能管理科技有限公司 Method and device for querying data

Also Published As

Publication number Publication date
CN105550270A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN105550270B (en) Data base query method and device
US20170139952A1 (en) System and method transforming source data into output data in big data environments
CN103377336B (en) The control method of a kind of computer system user authority and system
CN108228817A (en) Data processing method, device and system
CN108932313B (en) Data processing method and device, electronic equipment and storage medium
US8924373B2 (en) Query plans with parameter markers in place of object identifiers
US11086694B2 (en) Method and system for scalable complex event processing of event streams
CN103544153A (en) Data updating method and system based on database
CN108959510B (en) Partition level connection method and device for distributed database
CN102346744B (en) Device for processing materialized table in multi-tenancy (MT) application system
US20110131247A1 (en) Semantic Management Of Enterprise Resourses
US20170140160A1 (en) System and method for creating, tracking, and maintaining big data use cases
CN111046237A (en) User behavior data processing method and device, electronic equipment and readable medium
CN111813804A (en) Data query method and device, electronic equipment and storage medium
US20070124275A1 (en) Considering transient data also in reports generated based on data eventually stored in a data-warehouse
CN110502506B (en) Data processing method, device, equipment and storage medium
US20130304707A1 (en) Data Archiving Approach Leveraging Database Layer Functionality
US9286348B2 (en) Dynamic search system
CN110908983A (en) Intelligent marketing system based on user portrait recognition
US11645283B2 (en) Predictive query processing
US10331693B1 (en) Filters and event schema for categorizing and processing streaming event data
US11580125B2 (en) Information system with temporal data
CN105683961B (en) Method and system for managing data for write back of hypothesis analysis
CN110362595A (en) A kind of SQL statement dynamic analysis method
US20130254224A1 (en) Dynamic relevant reporting

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant