CN105550270A - Database inquiry method and device - Google Patents

Database inquiry method and device Download PDF

Info

Publication number
CN105550270A
CN105550270A CN201510907662.1A CN201510907662A CN105550270A CN 105550270 A CN105550270 A CN 105550270A CN 201510907662 A CN201510907662 A CN 201510907662A CN 105550270 A CN105550270 A CN 105550270A
Authority
CN
China
Prior art keywords
field
statistics
value
dimension
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510907662.1A
Other languages
Chinese (zh)
Other versions
CN105550270B (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

The invention discloses a database inquiry method and device. A specific application mode of the database inquiry method comprises following steps: inquiring the values of multiple scheduled fields recorded in a preset table in a database, wherein the multiple scheduled fields comprises at least two statistic dimension fields as statistic dimensions; generating a virtual table according to the values of the recorded multiple scheduled fields, wherein the records in the virtual table comprises following information: statistic dimension combination identifiers and values of each statistic dimension field corresponding to the statistic dimension combination identifiers, the statistic dimension combination identifiers are identifiers generated by combining each field name in the at least two statistic dimension fields; inquiring statistic values corresponding to each group, wherein the groups are formed by grouping the records in the virtual table according to the statistic dimension combination identifiers and the values of each statistic dimension field corresponding to the statistic dimension combination identifiers. According to the application mode of the invention, access to a data source table is reduced; and a great deal of manpower cost and computing resource are saved.

Description

Data base query method and device
Technical field
The application relates to field of computer technology, is specifically related to database technical field, particularly relates to data base query method and device.
Background technology
Along with the arrival of large data age, the data of magnanimity obtained, stores, search for, share, be parsed in order to current important research topic.Can capture within the rational time by large data analysis, manage, process and arrange the information becoming and enterprise management decision-making can be helped to produce positive object.
But along with the universal of large data correlation techniques and the sharply expansion of data volume, calculation task amount and computation complexity are also risen sharply thereupon.The statistical study that prior art combines for the multiple statistics dimension with multiple optional statistical dimension, needs the statistical study for the combination of often kind of statistics dimension all to perform once special query statement.Thus make human cost higher, and consume relatively large computational resource.
Summary of the invention
The object of the application is to propose a kind of data base query method and device, solves the technical matters that above background technology part is mentioned.
First aspect, a kind of method described in data base query method that this application provides comprises: the value of inquiring about the multiple predetermined field of the record in predetermined table in a database, wherein, described multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics; According to the value of the multiple predetermined field of described record, generating virtual table, wherein, record in described Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with described statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in described at least two statistics dimension fields and the mark that generates; To inquire about the record in described Virtual table according to described statistics dimension combination mark, combine with described statistics dimension and identify after each corresponding value of adding up dimension field divides into groups, respectively organize the statistic of correspondence.
Second aspect, this application provides a kind of database inquiry device, described device comprises: field value query unit, for inquiring about the value of the multiple predetermined field of the record in predetermined table in a database, wherein, described multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics; Virtual table generation unit, for the value of the multiple predetermined field according to described record, generating virtual table, wherein, record in described Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with described statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in described at least two statistics dimension fields and the mark that generates; Statistic query unit, for inquiring about the record in described Virtual table according to described statistics dimension combination mark, combine identify after each corresponding value of adding up dimension field divides into groups with described statistics dimension, respectively organizes the statistic of correspondence.
The data base query method that the application provides and device, by the value of the multiple predetermined field according to the record inquired, generation comprises statistics dimension combination mark, combine with described statistics dimension and identify the Virtual table that corresponding each adds up the information such as the value of dimension field, and by inquiry, the record in described Virtual table is identified according to described statistics dimension combination, combining with described statistics dimension identifies after each corresponding value of adding up dimension field divides into groups, each group of corresponding statistic, decrease the access to data source table when needing the statistics of inquiring about the combination of various statistics dimension, a large amount of human costs and computational resource are saved.
Accompanying drawing explanation
By reading the detailed description done non-limiting example done with reference to the following drawings, the other features, objects and advantages of the application will become more obvious:
Fig. 1 is the process flow diagram of an embodiment of data base query method according to the application;
Fig. 2 is the illustrative diagram of the data query of data base query method according to the application;
Fig. 3 is the process flow diagram of another embodiment of data base query method according to the application;
Fig. 4 is the structural representation of an embodiment of database inquiry device according to the application;
Fig. 5 is the structural representation of the computer system of the server be suitable for for realizing the embodiment of the present application.
Embodiment
Below in conjunction with drawings and Examples, the application is described in further detail.Be understandable that, specific embodiment described herein is only for explaining related invention, but not the restriction to this invention.It also should be noted that, for convenience of description, in accompanying drawing, illustrate only the part relevant to Invention.
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.Below with reference to the accompanying drawings and describe the application in detail in conjunction with the embodiments.
In addition, also it should be noted that, the data base query method that the embodiment of the present application provides is performed by server usually.Correspondingly, database inquiry device is arranged in server usually.
The flow process 100 of an 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 comprises the following steps:
Step 101, inquires about the value of the multiple predetermined field of the record in predetermined table in a database.
Wherein, above-mentioned multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics.
In the present embodiment, data base query method runs and can pass through to perform the value that predetermined query statement inquires about the multiple predetermined field of the record in predetermined table in a database with the server on it.Wherein, query statement can be such as the SELECT statement in the query languages such as SQL (StructuredQueryLanguage, Structured Query Language (SQL)), HQL (HibernateQueryLanguage).The dimension of above-mentioned statistics refers to the goal condition (parameter) of statistics, such as, if want the request number of times of the various operation requests types (such as: browse, reply) of user in statistics network forum, so operation requests type is exactly the dimension of this statistics; If want the various operation requests of counting user, the request number of times of various operating systems used when sending request (such as counting user Android android system sends the request number of times of browse request), so operation requests type and operating system are exactly two dimensions of this statistics.
Step 102, according to the value of the multiple predetermined field of above-mentioned record, generating virtual table.
Wherein, record in above-mentioned Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with above-mentioned statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in above-mentioned at least two statistics dimension fields and the mark that generates.
In the present embodiment, server can first based on the combination of each field name in above-mentioned at least two statistics dimension fields, generates multiplely to add up statistics dimension corresponding to dimension field with at least one and combine and identify.Such as, suppose that the field name of above-mentioned statistics dimension field has: " request type ", " operating system ", " version ", just can generate the statistics dimension corresponding with " request type " to combine and identify " 001 ", the statistics dimension corresponding with " request type " and " operating system " combines and identifies " 002 ", the statistics dimension corresponding with " request type ", " operating system " and " version " combines and identifies " 003 ", by that analogy.
Then, according to the value of the multiple predetermined field of above-mentioned record, obtain the value of each corresponding statistics dimension field of each statistics dimension combination mark, thus generate above-mentioned Virtual table.Such as, suppose that the value of the multiple predetermined field of above-mentioned record is as shown in table 1:
Table 1:
Request type Operating system Version
Browse iOS 6.5
Reply iOS 6.7
Reply Android 6.5
Then according to the value of three fields of the record in table 1, Virtual table as shown in table 2 can be generated:
Table 2:
Step 103, to inquire about the record in above-mentioned Virtual table according to above-mentioned statistics dimension combination mark, combine identify after each corresponding value of adding up dimension field divides into groups with above-mentioned statistics dimension, respectively organize the statistic of correspondence.
In the present embodiment, server can combine by identifying according to above-mentioned statistics dimension combination for the statement (such as GROUPBY statement) that divides into groups, with above-mentioned statistics dimension and identify each corresponding value of adding up dimension field and divide into groups, and inquires about each group of corresponding statistic by predetermined statistical function (such as: SUM () function, COUNT () function).
For above-mentioned Virtual table as shown in table 2, the statistic that step 103 inquires: request number of times can be as shown in table 3:
Table 3:
Statistics dimension combination mark Statistics dimension field value Request number of times
001 Browse 1
001 Reply 2
002 Browse | iOS 1
002 Reply | iOS 1
002 Reply | Android 1
003 Browse | iOS|6.5 1
003 Reply | iOS|6.7 1
003 Reply | Android|6.5 1
In table 3, each behavior one group.
In some optional implementations of the present embodiment, step 101 can comprise: inquire about the value meeting the multiple predetermined field of pre-conditioned record in predetermined table in a database.Thus server can go out qualified record according to various condition query, to make follow-up statistical query more targeted.
In addition, in some optional implementations of the present embodiment, above-mentioned predetermined table can have at least two.And step 101 can comprise: the value of inquiring about the multiple predetermined field of the record at least two predetermined tables in a database respectively; Record in each tables of data inquired is merged.Thus the recording interval making step 101 inquire is wider more comprehensively.
The illustrative diagram of the data query of the data base query method according to the application is shown below with reference to Fig. 2, Fig. 2.
As shown in Figure 2, server first question blank 1 ..., table N in record statistics dimension field 1 ..., statistics dimension field M value, wherein, N can for the natural number being more than or equal to 1, and M can for the natural number being more than or equal to 2; Then, according to the value of each statistics dimension field of inquiry record all, above-mentioned Virtual table is generated; Finally, according to Virtual table, inquire according to statistics dimension combination mark, combine with above-mentioned statistics dimension and identify after each corresponding value of adding up dimension field carries out being divided into L group, respectively organized the statistic of correspondence.
The data base query method that the present embodiment provides, by the value of the multiple predetermined field according to the record inquired, generation comprises statistics dimension combination mark, combine with above-mentioned statistics dimension and identify the Virtual table that corresponding each adds up the information such as the value of dimension field, and by inquiry, the record in above-mentioned Virtual table is identified according to above-mentioned statistics dimension combination, combining with above-mentioned statistics dimension identifies after each corresponding value of adding up dimension field divides into groups, each group of corresponding statistic, decrease the access to data source table when needing the statistics of inquiring about the combination of various statistics dimension, a large amount of human costs and computational resource are saved.
The flow process 300 of another embodiment of the data base query method according to the application is shown with further reference to Fig. 3, Fig. 3.
As shown in Figure 3, the data base query method of the present embodiment comprises the following steps:
Step 301, inquires about the value of the multiple predetermined field of the record in predetermined table in a database.
Wherein, above-mentioned multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics and at least one objects of statistics field as objects of statistics.
In the present embodiment, the difference of the step 101 in step 301 embodiment corresponding to Fig. 1 is: above-mentioned multiple predetermined field also comprises the objects of statistics field that at least one is used as objects of statistics.Wherein, to be recorded as example shown in above-mentioned table 1, the objects of statistics field of the above-mentioned record of the present embodiment can be such as: user name, and the record that the present embodiment inquires can be as shown in table 4:
Table 4:
Request type Operating system Version User name
Browse iOS 6.5 Zhang San
Reply iOS 6.7 Li Si
Reply Android 6.5 Li Si
The concrete process of the other parts of step 301 with reference to the above-mentioned detailed description to the step 101 in the corresponding embodiment of Fig. 1, can not repeat them here.
Step 302, according to the value of the multiple predetermined field of above-mentioned record, generating virtual table.
Wherein, record in above-mentioned Virtual table comprises following information: statistics dimension combination mark, combine with above-mentioned statistics dimension and identify the value that corresponding each adds up dimension field, and to combine with statistics dimension identify, the value of objects of statistics field that value that each adds up dimension field is associated, wherein, dimension combination mark is added up to be combination based on each field name in above-mentioned at least two statistics dimension fields and the mark that generates.
In the present embodiment, the difference of the step 102 in step 302 embodiment corresponding to Fig. 1 is: the record in above-mentioned Virtual table also comprise to combine with statistics dimension identify, the value of objects of statistics field that value that each adds up dimension field is associated.To be recorded as example in the Virtual table shown in above-mentioned table 2, after the record in the above-mentioned Virtual table of the present embodiment adds the information of the value of objects of statistics field, can be as shown in table 5:
Table 5:
The concrete process of the other parts of step 302 with reference to the above-mentioned detailed description to the step 101 in the corresponding embodiment of Fig. 1, can not repeat them here.
Step 303, to inquire about the record in above-mentioned Virtual table according to above-mentioned statistics dimension combination mark, combine identify after each corresponding value of adding up dimension field divides into groups with above-mentioned statistics dimension, respectively organize the statistic corresponding to objects of statistics field of correspondence.
In the present embodiment, step 303 specifically inquiry be statistic corresponding to objects of statistics field.For above-mentioned Virtual table as shown in table 4, the statistic corresponding to objects of statistics field that step 303 inquires: user number can be as shown in table 6:
Table 6:
Statistics dimension combination mark Statistics dimension field value User number
001 Browse 1
001 Reply 1
002 Browse | iOS 1
002 Reply | iOS 1
002 Reply | Android 1
003 Browse | iOS|6.5 1
003 Reply | iOS|6.7 1
003 Reply | Android|6.5 1
Similarly, in table 6, each behavior one group.
In some optional implementations of the present embodiment, the statistic corresponding to above-mentioned each group of objects of statistics field can comprise: the count value of the objects of statistics field value that each group is corresponding, or objects of statistics field value corresponding to each group and value.Wherein, the count value of objects of statistics field value can user number row in reference table 6, and server can by the count value of COUNT () functional query objects of statistics field value; When the type of objects of statistics field is numeric type, can being obtained by SUM () function with value of objects of statistics field value.
In some optional implementations of the present embodiment, the record in above-mentioned Virtual table can also comprise: combine with statistics dimension identify, count information that the value of value that each adds up dimension field, objects of statistics field is corresponding.Thus make Virtual table add the statistical information of more refinement, such as, each user sends various request number of times in the combination of often kind of statistics dimension can be added up.Such as, corresponding with the Virtual table shown in table 5, the Virtual table of this implementation can be as shown in table 7:
Table 7:
Statistics dimension combination mark Statistics dimension field value User name Request number of times
001 Browse Zhang San 1
001 Reply Li Si 2
002 Browse | iOS Zhang San 1
002 Reply | iOS Li Si 1
002 Reply | Android Li Si 1
003 Browse | 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 can comprise: to inquire about the record in above-mentioned Virtual table according to above-mentioned statistics dimension combination mark, combine identify after each corresponding value of add up dimension field divides into groups with above-mentioned statistics dimension, the statistic corresponding to objects of statistics field that each group is corresponding and respectively organize correspondence count information and be worth.For the Virtual table shown in table 7, the statistic corresponding to objects of statistics field that this implementation each group of inquiring is corresponding and count information corresponding to each group can be as shown in table 8 with value:
Table 8:
By this implementation, the present embodiment is inquired more comprehensive statistical information.
As can be seen from Fig. 3 and table 4-table 6, compared with the embodiment that Fig. 1 is corresponding, the flow process 300 of the data base query method in the present embodiment adds the step of adding up objects of statistics field.Thus, the scheme that the present embodiment describes can not increase under the prerequisite to the access times of data source table, inquires more comprehensively statistical information.
It should be noted that, in the various embodiments described above, given example is intended to make the technical scheme of the application better to understand, and is not whole implementations of the present embodiment.Such as, statistics dimension combination mark can also adopt other forms of mark (such as a, b, c), statistics dimension combination mark can also have: corresponding with " operating system ", corresponding with " version ", corresponding with " operating system " and " version ", and variously combine corresponding statistics dimension with other and combine and identify.
Below with reference to Fig. 4, as the realization to method shown in above-mentioned each figure, this application provides an a kind of embodiment of database inquiry device, this device embodiment is corresponding with the embodiment of the method shown in Fig. 1, and this device specifically can be applied in server.
As shown in Figure 4, the database inquiry device 400 that the present embodiment is above-mentioned comprises: field value query unit 401, Virtual table generation unit 402 and statistic query unit 403.Wherein, field value query unit 401 is for inquiring about the value of the multiple predetermined field of the record in predetermined table in a database, and wherein, above-mentioned multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics; Virtual table generation unit 402 is for the value of the multiple predetermined field according to above-mentioned record, generating virtual table, wherein, record in above-mentioned Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with above-mentioned statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in above-mentioned at least two statistics dimension fields and the mark that generates; Statistic query unit 403, for inquiring about the record in above-mentioned Virtual table according to above-mentioned statistics dimension combination mark, combine identify after each corresponding value of adding up dimension field divides into groups with above-mentioned statistics dimension, respectively organizes the statistic of correspondence.
In the present embodiment, the concrete process of field value query unit 401, Virtual table generation unit 402 and statistic query unit 403 respectively with reference to the above-mentioned detailed description to step 101, step 102, step 103 in the corresponding embodiment of Fig. 1, can not repeat them here.
In some optional implementations of the present embodiment, field value query unit 401 can be configured for the value meeting the multiple predetermined field of pre-conditioned record of inquiring about in a database in predetermined table further.Thus server can go out qualified record according to various condition query, to make follow-up statistical query more targeted.
In some optional implementations of the present embodiment, above-mentioned predetermined table can have at least two.And above-mentioned field value query unit 401 can comprise: field value inquiry subelement (not shown), for inquiring about the value of the multiple predetermined field of the record at least two predetermined tables in a database respectively; Record merges subelement (not shown), merges for the record in each tables of data that will inquire.Thus the recording interval making step 101 inquire is wider more comprehensively.
In some optional implementations of the present embodiment, the multiple predetermined field that field value query unit 401 is inquired about can also comprise the objects of statistics field that at least one is used as objects of statistics.And the record that Virtual table generation unit generates in the above-mentioned Virtual table of 402 can also comprise: combine with statistics dimension identify, the value of objects of statistics field that value that each adds up dimension field is associated.And the statistic that above-mentioned statistic query unit 403 above-mentioned each group of inquiring about is corresponding comprises: the statistic corresponding to objects of statistics field that each group is corresponding.The concrete process of the field value query unit 401 in this implementation, Virtual table generation unit 402 and statistic query unit 403 and the technique effect brought thereof respectively with reference to the above-mentioned detailed description to step 301, step 302, step 303 in the corresponding embodiment of Fig. 3, can not repeat them here.
In some optional implementations of the present embodiment, the statistic corresponding to above-mentioned each group of objects of statistics field that statistic query unit 403 is inquired about can comprise: the count value of the objects of statistics field value that each group is corresponding, or objects of statistics field value corresponding to each group and value.The concrete process of this implementation and the technique effect brought thereof with reference to the above-mentioned detailed description to corresponding implementation in the corresponding embodiment of Fig. 3, can not repeat them here.
In some optional implementations of the present embodiment, the record in the Virtual table that Virtual table generation unit 402 generates can also comprise: combine with statistics dimension identify, count information that the value of value that each adds up dimension field, objects of statistics field is corresponding.The concrete process of this implementation with reference to the above-mentioned detailed description to corresponding implementation in the corresponding embodiment of Fig. 3, can not repeat them here.
Based on above-mentioned implementation, in some optional implementations of the present embodiment, statistic query unit 403 can be configured for further inquiry by the record in above-mentioned Virtual table according to above-mentioned statistics dimension combination mark, combine with above-mentioned statistics dimension and identify after each corresponding value of add up dimension field divides into groups, the statistic corresponding to objects of statistics field that each group is corresponding and respectively organize correspondence count information and be worth.The concrete process of this implementation and the technique effect brought thereof with reference to the above-mentioned detailed description to corresponding implementation in the corresponding embodiment of Fig. 3, can not repeat them here.
It will be understood by those skilled in the art that above-mentioned database inquiry device 400 also comprises some other known features, such as processor, storeies etc., in order to unnecessarily fuzzy embodiment of the present disclosure, these known structures are not shown in the diagram.
The database inquiry device that the present embodiment provides, the value of the multiple predetermined field of the record inquired according to field value query unit 401 by Virtual table generation unit 402, generation comprises statistics dimension combination mark, combine with above-mentioned statistics dimension and identify the Virtual table that corresponding each adds up the information such as the value of dimension field, and inquired about the record in above-mentioned Virtual table according to above-mentioned statistics dimension combination mark by statistic query unit 403, combining with above-mentioned statistics dimension identifies after each corresponding value of adding up dimension field divides into groups, each group of corresponding statistic, decrease the access to data source table when needing the statistics of inquiring about the combination of various statistics dimension, a large amount of human costs and computational resource are saved.
Below with reference to Fig. 5, it illustrates the structural representation of the computer system 500 of the server be suitable for for realizing the embodiment of the present application.
As shown in Figure 5, computer system 500 comprises CPU (central processing unit) (CPU) 501, and it or can be loaded into the program random access storage device (RAM) 503 from storage area 508 and perform various suitable action and process according to the program be stored in ROM (read-only memory) (ROM) 502.In RAM503, also store system 500 and operate required various program and data.CPU501, ROM502 and RAM503 are connected with each other by bus 504.I/O (I/O) interface 505 is also connected to bus 504.
I/O interface 505 is connected to: the importation 506 comprising keyboard, mouse etc. with lower component; Comprise the output 507 of such as cathode-ray tube (CRT) (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.; Comprise the storage area 508 of hard disk etc.; And comprise the communications portion 509 of network interface unit of such as LAN card, modulator-demodular unit etc.Communications portion 509 is via the network executive communication process of such as the Internet.Driver 510 is also connected to I/O interface 505 as required.Detachable media 511, such as disk, CD, magneto-optic disk, semiconductor memory etc., be arranged on driver 510 as required, so that the computer program read from it is mounted into storage area 508 as required.
Especially, according to embodiment of the present disclosure, the process that reference flow sheet describes above may be implemented as computer software programs.Such as, embodiment of the present disclosure comprises a kind of computer program, and it comprises the computer program visibly comprised on a machine-readable medium, and described computer program comprises the program code for the method shown in flowchart.In such embodiments, this computer program can be downloaded and installed from network by communications portion 509, and/or is mounted from detachable media 511.
Process flow diagram in accompanying drawing and block diagram, illustrate according to the architectural framework in the cards of the system of the various embodiment of the application, method and computer program product, function and operation.In this, each square frame in process flow diagram or block diagram can represent a part for module, program segment or a code, and a part for described module, program segment or code comprises one or more executable instruction for realizing the logic function specified.Also it should be noted that at some as in the realization of replacing, the function marked in square frame also can be different from occurring in sequence of marking in accompanying drawing.Such as, in fact the square frame that two adjoining lands represent can perform substantially concurrently, and they also can perform by contrary order sometimes, and this determines according to involved function.Also it should be noted that, the combination of the square frame in each square frame in block diagram and/or process flow diagram and block diagram and/or process flow diagram, can realize by the special hardware based system of the function put rules into practice or operation, or can realize with the combination of specialized hardware and computer instruction.
Be described in unit involved in the embodiment of the present application to be realized by the mode of software, also can be realized by the mode of hardware.Described unit also can be arranged within a processor, such as, can be described as: a kind of processor comprises field value query unit, Virtual table generation unit and statistic query unit.Wherein, the title of these unit does not form the restriction to this unit itself under certain conditions, and such as, field value query unit can also be described to " inquiring about the unit of the value of the multiple predetermined field of the record in predetermined table in a database ".
As another aspect, present invention also provides a kind of non-volatile computer storage medium, this non-volatile computer storage medium can be the non-volatile computer storage medium comprised in device described in above-described embodiment; Also can be individualism, be unkitted the non-volatile computer storage medium allocated in terminal.Above-mentioned non-volatile computer storage medium stores one or more program, when one or more program described is performed by an equipment, make described equipment: the value of inquiring about the multiple predetermined field of the record in predetermined table in a database, wherein, described multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics; According to the value of the multiple predetermined field of described record, generating virtual table, wherein, record in described Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with described statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in described at least two statistics dimension fields and the mark that generates; To inquire about the record in described Virtual table according to described statistics dimension combination mark, combine with described statistics dimension and identify after each corresponding value of adding up dimension field divides into groups, respectively organize the statistic of correspondence.
More than describe and be only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art are to be understood that, invention scope involved in the application, be not limited to the technical scheme of the particular combination of above-mentioned technical characteristic, also should be encompassed in when not departing from described inventive concept, other technical scheme of being carried out combination in any by above-mentioned technical characteristic or its equivalent feature and being formed simultaneously.The technical characteristic that such as, disclosed in above-mentioned feature and the application (but being not limited to) has similar functions is replaced mutually and the technical scheme formed.

Claims (14)

1. a data base query method, is characterized in that, described method comprises:
Inquire about the value of the multiple predetermined field of the record in predetermined table in a database, wherein, described multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics;
According to the value of the multiple predetermined field of described record, generating virtual table, wherein, record in described Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with described statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in described at least two statistics dimension fields and the mark that generates;
To inquire about the record in described Virtual table according to described statistics dimension combination mark, combine with described statistics dimension and identify after each corresponding value of adding up dimension field divides into groups, respectively organize the statistic of correspondence.
2. method according to claim 1, is characterized in that, the value of the multiple predetermined field of the described record inquired about in a database in predetermined table comprises:
Inquire about the value meeting the multiple predetermined field of pre-conditioned record in predetermined table in a database.
3. method according to claim 1, is characterized in that, described predetermined table has at least two; And
The value of the multiple predetermined field of the described record inquired about in a database in predetermined table comprises:
Inquire about the value of the multiple predetermined field of the record at least two predetermined tables in a database respectively;
Record in each tables of data inquired is merged.
4. according to the arbitrary described method of claim 1-3, it is characterized in that, described multiple predetermined field also comprises the objects of statistics field that at least one is used as objects of statistics; And
Record in described Virtual table also comprises: combine with statistics dimension identify, the value of objects of statistics field that value that each adds up dimension field is associated; And
Described each group of corresponding statistic comprises: the statistic corresponding to objects of statistics field that each group is corresponding.
5. method according to claim 4, is characterized in that, the statistic corresponding to described each group of objects of statistics field comprises: the count value of the objects of statistics field value that each group is corresponding, or objects of statistics field value corresponding to each group and value.
6. method according to claim 5, is characterized in that, the record in described Virtual table also comprises: combine with statistics dimension identify, count information that the value of value that each adds up dimension field, objects of statistics field is corresponding.
7. method according to claim 6, it is characterized in that, described inquiry by the record in described Virtual table according to described statistics dimension combination mark, combine with described statistics dimension and identify after each corresponding value of adding up dimension field divides into groups, respectively organize the statistic of correspondence, comprising:
To inquire about the record in described Virtual table according to described statistics dimension combination mark, combine with described statistics dimension and identify after each corresponding value of add up dimension field divides into groups, the statistic corresponding to objects of statistics field that each group is corresponding and respectively organize correspondence count information and be worth.
8. a database inquiry device, is characterized in that, described device comprises:
Field value query unit, for inquiring about the value of the multiple predetermined field of the record in predetermined table in a database, wherein, described multiple predetermined field comprises: at least two statistics dimension fields by the dimension taken statistics;
Virtual table generation unit, for the value of the multiple predetermined field according to described record, generating virtual table, wherein, record in described Virtual table comprises following information: statistics dimension combination mark, to combine identify the value that corresponding each adds up dimension field with described statistics dimension, wherein, dimension combination mark is added up to be combination based on each field name in described at least two statistics dimension fields and the mark that generates;
Statistic query unit, for inquiring about the record in described Virtual table according to described statistics dimension combination mark, combine identify after each corresponding value of adding up dimension field divides into groups with described statistics dimension, respectively organizes the statistic of correspondence.
9. device according to claim 8, is characterized in that, described field value query unit is configured for the value meeting the multiple predetermined field of pre-conditioned record of inquiring about in a database in predetermined table further.
10. device according to claim 8, is characterized in that, described predetermined table has at least two; And
Described field value query unit comprises:
Field value inquiry subelement, for inquiring about the value of the multiple predetermined field of the record at least two predetermined tables in a database respectively;
Record merges subelement, merges for the record in each tables of data that will inquire.
11.-10 arbitrary described devices according to Claim 8, it is characterized in that, described multiple predetermined fields of described field value query unit inquiry also comprise the objects of statistics field that at least one is used as objects of statistics; And
Record in the described Virtual table that described Virtual table generation unit generates also comprises: combine with statistics dimension identify, the value of objects of statistics field that value that each adds up dimension field is associated; And
The statistic that described each group of described statistic query unit inquiry is corresponding comprises: the statistic corresponding to objects of statistics field that each group is corresponding.
12. devices according to claim 11, it is characterized in that, the statistic corresponding to described each group of objects of statistics field of described statistic query unit inquiry comprises: the count value of the objects of statistics field value that each group is corresponding, or objects of statistics field value corresponding to each group and value.
13. devices according to claim 12, is characterized in that, the record in the Virtual table that described Virtual table generation unit generates also comprises: combine with statistics dimension identify, count information that the value of value that each adds up dimension field, objects of statistics field is corresponding.
14. devices according to claim 13, it is characterized in that, described statistic query unit be configured for further inquiry by the record in described Virtual table according to described statistics dimension combination mark, combine with described statistics dimension and identify after each corresponding value of add up dimension field divides into groups, the statistic corresponding to objects of statistics field that each group is corresponding and respectively organize correspondence count information and be worth.
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 true CN105550270A (en) 2016-05-04
CN105550270B 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)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106372985A (en) * 2016-08-30 2017-02-01 五八同城信息技术有限公司 Order data processing method and device
CN107025542A (en) * 2016-10-27 2017-08-08 阿里巴巴集团控股有限公司 The method and apparatus that the integration capability of mix is provided
CN108268524A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 Database aggregation processing method and device
CN109947791A (en) * 2019-03-27 2019-06-28 上海达梦数据库有限公司 A kind of database statement optimization method, device, equipment and storage medium
CN110928928A (en) * 2019-12-09 2020-03-27 中国建设银行股份有限公司 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
CN111367966A (en) * 2020-03-05 2020-07-03 世纪龙信息网络有限责任公司 Method, device and cluster system for carrying out multi-dimensional statistics on data

Citations (2)

* 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
CN103729448A (en) * 2013-12-31 2014-04-16 深圳市科漫达智能管理科技有限公司 Method and device for querying data

Patent Citations (2)

* 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
CN103729448A (en) * 2013-12-31 2014-04-16 深圳市科漫达智能管理科技有限公司 Method and device for querying data

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106372985A (en) * 2016-08-30 2017-02-01 五八同城信息技术有限公司 Order data processing method and device
CN107025542A (en) * 2016-10-27 2017-08-08 阿里巴巴集团控股有限公司 The method and apparatus that the integration capability of mix is provided
CN108268524A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 Database aggregation processing method and device
CN109947791A (en) * 2019-03-27 2019-06-28 上海达梦数据库有限公司 A kind of database statement optimization method, device, equipment and storage medium
CN110928928A (en) * 2019-12-09 2020-03-27 中国建设银行股份有限公司 Data statistics method and device for investment subject, electronic 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
CN111367966A (en) * 2020-03-05 2020-07-03 世纪龙信息网络有限责任公司 Method, device and cluster system for carrying out multi-dimensional statistics on data
CN111367966B (en) * 2020-03-05 2024-04-12 天翼数字生活科技有限公司 Method, device and cluster system for carrying out multidimensional statistics on data

Also Published As

Publication number Publication date
CN105550270B (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN105550270A (en) Database inquiry method and device
CN108733681B (en) Information processing method and device
CN110019540B (en) Implementation method, display method, device and equipment of enterprise atlas
US20210365421A1 (en) Data analysis method, computer device and storage medium
CN109214730B (en) Information pushing method and device
CN110168529A (en) Date storage method, device and storage medium
CN109684369B (en) Information updating method and device
CN105550225A (en) Index construction method and query method and apparatus
CN105808538A (en) Method and device for generating mobile report form
CN105450705A (en) Service data processing method and apparatus
CN110019367B (en) Method and device for counting data characteristics
CN112084208A (en) Data visualization method and system, storage medium and electronic device
CN111125266A (en) Data processing method, device, equipment and storage medium
CN105491078A (en) Data processing method and device in SOA system, and SOA system
CN106156040A (en) multi-dimensional data management method and device
US11531706B2 (en) Graph search using index vertices
CN112100177A (en) Data storage method and device, computer equipment and storage medium
CN111159183A (en) Report generation method, electronic device and computer readable storage medium
CN110737727B (en) Data processing method and system
CN111553749A (en) Activity push strategy configuration method and device
CN107688581B (en) Data model processing method and device
US20110231360A1 (en) Persistent flow method to define transformation of metrics packages into a data store suitable for analysis by visualization
WO2007089378A2 (en) Apparatus and method for forecasting control chart data
CN111881082A (en) Snapshot generation method and device, electronic equipment and storage medium
CN110609926A (en) Data tag storage management method and device

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