CN103793469A - Data inquiry statistics method and data inquiry statistics system - Google Patents
Data inquiry statistics method and data inquiry statistics system Download PDFInfo
- Publication number
- CN103793469A CN103793469A CN201310752326.5A CN201310752326A CN103793469A CN 103793469 A CN103793469 A CN 103793469A CN 201310752326 A CN201310752326 A CN 201310752326A CN 103793469 A CN103793469 A CN 103793469A
- Authority
- CN
- China
- Prior art keywords
- data
- query
- mode
- gathers
- inquiry
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2462—Approximate or statistical queries
Abstract
The invention discloses a data inquiry statistics method and a data inquiry statistics system. The data inquiry statistics method comprises the following steps of firstly, establishing a data structure chart according to stored data information; secondly, receiving a data inquiry command; thirdly, generating an inquiry statement by selecting a summary mode and other inquiry conditions according to the data inquiry command; and finally, generating an inquiry result in the data structure chart according to the inquiry statement. According to the scheme, different inquiry results obtained by using different inquiry modes are outputted according to different summary modes by selecting the summary modes in the inquiry statement, the shortcoming that a user is required to export data, process the data again and manually count the data when the user is required to inquire the data by using another method which is different from a built-in method of the system is overcome, the data inquiry statistics efficiency is improved, and the data inquiry statistics accuracy is also improved.
Description
Technical field
The present invention relates to data query statistics field, relate in particular to a kind of data query statistical method and system.
Background technology
At present, generally use when thering are the data of tree structure or hierarchical structure and inquire about and add up, conventionally adopt two kinds of methods, a kind of is that upper DBMS directly comes from gathering of all lower DBMSs, gathering of all data that the data that are father node are leafy node, another kind is the needs according to user, is upwards gathered step by step by selected lower DBMS, is gathered to father node step by step by selected leafy node.
Because the built-in data statistical approach of system is changeless, therefore, adopt present equipment or device to carry out data query and all can only adopt the one in above-mentioned two kinds of methods, can not realize same device and carry out the change of querying method for the different query demands of different user.When another kind of method beyond user need to adopt system built-in method realizes the query statistic of data, can only be by data be derived and carry out secondary processing, in EXCEL, completed the statistics of data by user oneself, and adopt the query statistic that carries out in such a way data, efficiency is lower, and easily occurs mistake.
Summary of the invention
In view of this, the invention provides a kind of data query statistical method and system, can not realize the query statistic mode different to data to solve a system in prior art, need the shortcoming of secondary processing, its concrete scheme is as follows:
A kind of data query statistical method, comprising:
According to the data message of storage, set up data structure chart;
Receive data query instruction;
According to described data query instruction, select to gather mode and other querying conditions, generated query statement;
In described data structure chart, export Query Result according to described query statement.
Further, described data structure chart is specially: tree data table.
Further, comprising: in described tree data table, related data information is stored in leafy node.
Further, described in, the mode of gathering comprises:
First gathers mode, first successively upwards gathers selection data object from leafy node, then filters according to selected data object;
Second gathers mode, first filters according to selected data object in querying condition, more upwards gathers step by step according to the result of described filtration.
Further, described second gathers in mode, and described data object comprises: the data object of leafy node.
A kind of data query statistical system, comprising:
Data storage cell, command reception unit, the data query unit being connected respectively with described data storage cell and command reception unit, the display unit being connected with described data query unit,
Described data storage cell storage data, and set up data structure chart according to the data message of storage, preserve;
Described command reception unit receives data query instruction, and according to the described data query instruction receiving, selects to gather mode and other querying conditions, generated query statement, and send;
The query statement that described data query unit sends according to described command reception unit, query-relevant data gathering according to the mode of gathering comprising in described query statement from described data structure chart;
Described display unit is inquired about the data message output display Query Result gathering according to described data query unit.
Further, the data structure chart that described data storage cell generates is specially: tree data table.
Further, comprising: in described tree data table, related data information is stored in leafy node.
Further, the mode that gathers described in specifically comprises:
First gathers mode, first successively upwards gathers selection data object from leafy node, then filters according to selected data object;
Second gathers mode, first filters according to selected data object in querying condition, more upwards gathers step by step according to the result of described filtration.
Further, described second gathers in mode, and described data object comprises: the data object of leafy node.
Can find out from technique scheme, data query statistical method disclosed by the invention and system, first according to the data message of storage, set up data structure chart, secondly, receive data query instruction, according to data query instruction, selection gathers mode and other querying conditions, generated query statement, in data structure chart according to query statement generated query result.This programme by increasing the selection of the mode that gathers in query statement, realize according to the different modes that gathers, export the different Query Result that different inquiry modes obtain, while having avoided user need to adopt system built-in method another kind of method in addition to carry out data query, data need to be derived and carry out secondary processing, complete by hand the defect of statistics, improved the efficiency of data query statistics, improved the accuracy rate of data query statistics.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the process flow diagram of the disclosed a kind of data query statistical method of the embodiment of the present invention;
Fig. 2 is the structural drawing of the disclosed a kind of tree data table of the embodiment of the present invention;
Fig. 3 is the structural drawing of the disclosed a kind of tree data table of the embodiment of the present invention;
Fig. 4 is the structural representation of the disclosed a kind of data query statistical system of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The invention discloses a kind of data query statistical method, its process flow diagram as shown in Figure 1, comprising:
Step S11, according to storage data message, set up data structure chart;
Wherein, data structure chart, is specifically as follows tree data table, is convenient to observe and inquiry.
Tree data table is mainly made up of father and son's node, father and son's node has formed data hierarchical relationship, any node that there is no next stage node is leafy node, next stage node is child node, upper level node is father node, any node that there is no father node is root node, neither each branch node that leafy node neither root node is father node, root node is the father node of all branches.In a tree data table, only has a root node, the ground floor node that root node is tables of data.
Concrete, tree data table can be as shown in Figure 2.
Wherein, A is root node, and K, L, I, E, F, G, H are leafy node, and J, D, B, C, A are father node.
Wherein, the data message in treelike structural table need to be stored in leaf node.
Step S12, the instruction of reception data query;
Step S13, according to data query instruction, select to gather mode and other querying conditions, generated query statement;
In the disclosed scheme of the present embodiment, in query statement, increase and gather this querying condition of mode, realized according to the different modes that gathers, export the different Query Result that different inquiry modes obtain.
Wherein, gathering this option of mode is essential option, data structure diagram table being carried out in the process of query statistic, must select the one mode of gathering to inquire about.
Step S14, in data structure chart according to query statement output Query Result.
The disclosed data query statistical method of the present embodiment, first according to the data message of storage, set up data structure chart, secondly, receive data query instruction, according to data query instruction, select to gather mode and other querying conditions, generated query statement, in data structure chart according to query statement generated query result.This programme by increasing the selection of the mode that gathers in query statement, realize according to the different modes that gathers, export the different Query Result that different inquiry modes obtain, while having avoided user need to adopt system built-in method another kind of method in addition to carry out data query, data need to be derived and carry out secondary processing, complete by hand the defect of statistics, improved the efficiency of data query statistics, improved the accuracy rate of data query statistics.
Further, in the disclosed data query statistical method of the present embodiment, the mode of gathering can roughly be divided into two kinds: first gathers mode, and second gathers mode.
Wherein, the first mode of gathering is: first successively upwards gather selection data object from leafy node, then filter according to selected data object.
Select first to gather mode, in the time of inquiry, select the data object of which level, just show the data object of which level, can select arbitrary data or the various level arbitrary data of same level, selection can be that jump, discontinuous, and result might not be shown with complete tree structure, if the level object of selecting itself is exactly complete tree structure level, show with complete tree structure.
If what select is leafy node object, the numerical value of this leafy node comes from the data of leafy node object itself; If what select is father node object, the numerical value of selected father node object comes from the gathering of all leafy node object datas of its correspondence.The difference of the child node data of selecting can't have influence on the tabulate statistics result of father node data.
The second mode of gathering is: first filter according to selected data object in querying condition, more upwards gather step by step according to the result of filtering.
Select second to gather mode, father node data are upwards to gather step by step according to the data of selected leafy node, therefore, select different leafy nodes, will have influence on the tabulate statistics result of father node data; In addition, in Query Result, what present is complete tree-like or hierarchical structure.
In addition, in the situation that selecting second to gather mode, selected data object need to comprise: the data object of leafy node, if there is no the data object of leafy node in selected data object, can not inquire about any result.
In addition, in the disclosed data query statistical method of the present embodiment, if do not select first to gather mode, second and gather mode, can also manual modification one of them gather mode, realize user oneself and give the situation of the mode of gathering.
The disclosed data query statistical method of the present embodiment, by two kinds of selections that gather mode, can realize the different demands of the inquiry combined data to different user, has avoided the secondary processing to data, and has improved work efficiency and accuracy rate.
Concrete, the present embodiment discloses a kind of example of concrete data query statistical method, and its tree data table is as shown in Figure 3.
Wherein, father node is A, A1, A1-1, A1-2, B1, B1-2, and leafy node is: A1-1-1, A1-1-2, A1-2-1, A1-2-2, A1-2-3, B1-1, B1-2-1.
In the time that the data object of selecting is A1-1, A1-2-2, A1-2-3, adopt first to gather mode, the Query Result of output is: A1-1, A1-2-2, A1-2-3, wherein, the output data of A1-1 are the data that A1-1-1, A1-1-2 are corresponding, the data of A1-2-2 output are the data of itself correspondence, and the data of A1-2-3 output are the data of itself correspondence.
In the time that the data object of selecting is A1-1, A1-2-2, A1-2-3, adopt second to gather mode, the Query Result of output is: A, A1, A1-2, A1-2-2, A1-2-3, wherein, the calculating summarized results that the output data of A are A1, the calculating summarized results that the output data of A1 are A1-2, the output data of A1-2 are the calculating summarized results of A1-2-2 and A1-2-3, the output data of A1-2-2 are the data of itself correspondence, and the output data of A1-2-3 are the data of itself correspondence.
Wherein, while adopting second to gather mode, if there is no the data object of leafy node in selected data object, can not inquire about any result, there is no the Output rusults of A1-1; In addition, due in Query Result, what present is complete tree-like or hierarchical structure, and therefore, while adopting second to gather mode, its Output rusults is A, A1, A1-2, A1-2-2, A1-2-3; And its summarized results gathers according to hierarchic sequence.
The present embodiment discloses a kind of data query statistical system, and its structural representation as shown in Figure 4, comprising:
Wherein, data query unit 43 is connected with data storage cell 41, command reception unit 42, display unit 44 respectively.
Wherein, data structure chart is specifically as follows: tree data table.
In addition, in tree data table, related data information is all stored in leafy node.
In the disclosed scheme of the present embodiment, in query statement, increase and gather this querying condition of mode, realized according to the different modes that gathers, export the different Query Result that different inquiry modes obtain.
Wherein, gathering this option of mode is essential option, data structure diagram table being carried out in the process of query statistic, must select the one mode of gathering to inquire about.
The query statement that data query unit 43 sends according to command reception unit 42, query-relevant data from data structure chart, and gather according to the mode of gathering comprising in query statement.
The disclosed data query statistical system of the present embodiment, store data by data storage cell, set up data structure chart and preserve, command reception unit receives data query instruction, select to gather mode and other querying conditions according to data query instruction, generated query statement, data query unit is according to query statement, query-relevant data gathering from data structure chart, the data that display unit gathers inquiry show.This programme by increasing the selection of the mode that gathers in query statement, realize according to the different modes that gathers, export the different Query Result that different inquiry modes obtain, while having avoided user need to adopt system built-in method another kind of method in addition to carry out data query, data need to be derived and carry out secondary processing, complete by hand the defect of statistics, improved the efficiency of data query statistics, improved the accuracy rate of data query statistics.
Further, in the disclosed data query statistical system of the present embodiment, the mode of gathering can roughly be divided into two kinds: first gathers mode, and second gathers mode.
Wherein, the first mode of gathering is: first successively upwards gather selection data object from leafy node, then filter according to selected data object.
Select first to gather mode, in the time of inquiry, select the data object of which level, just show the data object of which level, can select arbitrary data or the various level arbitrary data of same level, selection can be that jump, discontinuous, and result might not be shown with complete tree structure, if the level object of selecting itself is exactly complete tree structure level, show with complete tree structure.
If what select is leafy node object, the numerical value of this leafy node comes from the data of leafy node object itself; If what select is father node object, the numerical value of selected father node object comes from the gathering of all leafy node object datas of its correspondence.The difference of the child node data of selecting can't have influence on the tabulate statistics result of father node data.
The second mode of gathering is: first filter according to selected data object in querying condition, more upwards gather step by step according to the result of filtering.
Select second to gather mode, father node data are upwards to gather step by step according to the data of selected leafy node, therefore, select different leafy nodes, will have influence on the tabulate statistics result of father node data; In addition, in Query Result, what present is complete tree-like or hierarchical structure.
In addition, in the situation that selecting second to gather mode, selected data object need to comprise: the data object of leafy node, if there is no the data object of leafy node in selected data object, can not inquire about any result.
In addition, in the disclosed data query statistical system of the present embodiment, if do not select first to gather mode, second and gather mode, can also manual modification one of them gather mode, realize user oneself and give the situation of the mode of gathering.
The disclosed data query statistical system of the present embodiment, by two kinds of selections that gather mode, can realize the different demands of the inquiry combined data to different user, has avoided the secondary processing to data, and has improved work efficiency and accuracy rate.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment, between each embodiment identical similar part mutually referring to.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates referring to method part.
Professional can also further recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with electronic hardware, computer software or the combination of the two, for the interchangeability of hardware and software is clearly described, composition and the step of each example described according to function in the above description in general manner.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can realize described function with distinct methods to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
The software module that the method for describing in conjunction with embodiment disclosed herein or the step of algorithm can directly use hardware, processor to carry out, or the combination of the two is implemented.Software module can be placed in the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
To the above-mentioned explanation of the disclosed embodiments, make professional and technical personnel in the field can realize or use the present invention.To be apparent for those skilled in the art to the multiple modification of these embodiment, General Principle as defined herein can, in the situation that not departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (10)
1. a data query statistical method, is characterized in that, comprising:
According to the data message of storage, set up data structure chart;
Receive data query instruction;
According to described data query instruction, select to gather mode and other querying conditions, generated query statement;
In described data structure chart, export Query Result according to described query statement.
2. method according to claim 1, is characterized in that, described data structure chart is specially: tree data table.
3. method according to claim 2, is characterized in that, comprising: in described tree data table, related data information is stored in leafy node.
4. method according to claim 3, is characterized in that, described in the mode of gathering comprise:
First gathers mode, first successively upwards gathers selection data object from leafy node, then filters according to selected data object;
Second gathers mode, first filters according to selected data object in querying condition, more upwards gathers step by step according to the result of described filtration.
5. method according to claim 4, is characterized in that, described second gathers in mode, and described data object comprises: the data object of leafy node.
6. a data query statistical system, is characterized in that, comprising:
Data storage cell, command reception unit, the data query unit being connected respectively with described data storage cell and command reception unit, the display unit being connected with described data query unit,
Described data storage cell storage data, and set up data structure chart according to the data message of storage, preserve;
Described command reception unit receives data query instruction, and according to the described data query instruction receiving, selects to gather mode and other querying conditions, generated query statement, and send;
The query statement that described data query unit sends according to described command reception unit, query-relevant data gathering according to the mode of gathering comprising in described query statement from described data structure chart;
Described display unit is inquired about the data message output display Query Result gathering according to described data query unit.
7. system according to claim 6, is characterized in that, the data structure chart that described data storage cell generates is specially: tree data table.
8. system according to claim 7, is characterized in that, comprising: in described tree data table, related data information is stored in leafy node.
9. system according to claim 8, is characterized in that, described in the mode that gathers specifically comprise:
First gathers mode, first successively upwards gathers selection data object from leafy node, then filters according to selected data object;
Second gathers mode, first filters according to selected data object in querying condition, more upwards gathers step by step according to the result of described filtration.
10. system according to claim 9, is characterized in that, described second gathers in mode, and described data object comprises: the data object of leafy node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310752326.5A CN103793469A (en) | 2013-12-30 | 2013-12-30 | Data inquiry statistics method and data inquiry statistics system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310752326.5A CN103793469A (en) | 2013-12-30 | 2013-12-30 | Data inquiry statistics method and data inquiry statistics system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103793469A true CN103793469A (en) | 2014-05-14 |
Family
ID=50669135
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310752326.5A Pending CN103793469A (en) | 2013-12-30 | 2013-12-30 | Data inquiry statistics method and data inquiry statistics system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103793469A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106250480A (en) * | 2016-08-01 | 2016-12-21 | 浪潮软件集团有限公司 | Metadata-based visual statistical analysis method |
CN106909602A (en) * | 2016-08-26 | 2017-06-30 | 阿里巴巴集团控股有限公司 | A kind of information query method and device |
CN107679172A (en) * | 2017-09-29 | 2018-02-09 | 北京奇艺世纪科技有限公司 | A kind of query statistic method and device of data |
CN111522819A (en) * | 2020-04-24 | 2020-08-11 | 上海用天网络科技有限公司 | Method and system for summarizing tree-structured data |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102279848A (en) * | 2010-06-09 | 2011-12-14 | 中国电信股份有限公司 | Method and device for generating report template |
CN102651020A (en) * | 2012-03-31 | 2012-08-29 | 中国科学院软件研究所 | Method for storing and searching mass sensor data |
CN103399904A (en) * | 2013-07-26 | 2013-11-20 | 浙江吉利汽车研究院有限公司 | Data processing method and data processing system |
-
2013
- 2013-12-30 CN CN201310752326.5A patent/CN103793469A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102279848A (en) * | 2010-06-09 | 2011-12-14 | 中国电信股份有限公司 | Method and device for generating report template |
CN102651020A (en) * | 2012-03-31 | 2012-08-29 | 中国科学院软件研究所 | Method for storing and searching mass sensor data |
CN103399904A (en) * | 2013-07-26 | 2013-11-20 | 浙江吉利汽车研究院有限公司 | Data processing method and data processing system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106250480A (en) * | 2016-08-01 | 2016-12-21 | 浪潮软件集团有限公司 | Metadata-based visual statistical analysis method |
CN106909602A (en) * | 2016-08-26 | 2017-06-30 | 阿里巴巴集团控股有限公司 | A kind of information query method and device |
CN107679172A (en) * | 2017-09-29 | 2018-02-09 | 北京奇艺世纪科技有限公司 | A kind of query statistic method and device of data |
CN111522819A (en) * | 2020-04-24 | 2020-08-11 | 上海用天网络科技有限公司 | Method and system for summarizing tree-structured data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104123374B (en) | The method and device of aggregate query in distributed data base | |
CN102023983B (en) | Managing method of statistical space-time database | |
CN106528787A (en) | Mass data multi-dimensional analysis-based query method and device | |
CN106294462B (en) | It is a kind of to obtain the method and system for recommending video | |
CN104462434A (en) | Data inquiring method and device | |
CA2893912C (en) | Systems and methods for optimizing data analysis | |
CN108268565B (en) | Method and system for processing user browsing behavior data based on data warehouse | |
CN103793469A (en) | Data inquiry statistics method and data inquiry statistics system | |
CN103942210A (en) | Processing method, device and system of mass log information | |
CN109271321A (en) | A kind of contribution code number statistical method and device | |
US20070271218A1 (en) | Statistics collection using path-value pairs for relational databases | |
CN106709851B (en) | Big data retrieval method and device | |
CN103246549B (en) | A kind of method and system of data conversion storage | |
CN105930491A (en) | Monitoring data storage method based on time sequence database InfluxDB | |
CN104408067A (en) | Multi-tree structure database design method and device | |
CN105787090A (en) | Index building method and system of OLAP system of electric data | |
CN106354775A (en) | Data dynamic configuration system and method based on custom fields | |
CN103645984A (en) | Method and device for optimizing logs | |
CN104408057B (en) | A kind of method and device of data summarization | |
CN108073641A (en) | The method and apparatus for inquiring about tables of data | |
CN101937455B (en) | Method for establishing multi-dimensional classification cluster based on infinite hierarchy and heredity information | |
US8229924B2 (en) | Statistics collection using path-identifiers for relational databases | |
CN115982177B (en) | Method, device, equipment and medium for data aggregation based on tree dimension | |
CN106780039A (en) | The method and system of processing information | |
CN103761316A (en) | Data compression storage method and device based on sparse matrix |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140514 |