CN106557498A - Date storage method and device and data query method and apparatus - Google Patents

Date storage method and device and data query method and apparatus Download PDF

Info

Publication number
CN106557498A
CN106557498A CN201510625073.4A CN201510625073A CN106557498A CN 106557498 A CN106557498 A CN 106557498A CN 201510625073 A CN201510625073 A CN 201510625073A CN 106557498 A CN106557498 A CN 106557498A
Authority
CN
China
Prior art keywords
dimension
data
combination
achievement data
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510625073.4A
Other languages
Chinese (zh)
Inventor
池雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510625073.4A priority Critical patent/CN106557498A/en
Publication of CN106557498A publication Critical patent/CN106557498A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/278Data partitioning, e.g. horizontal or vertical partitioning
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP

Abstract

This application discloses a kind of date storage method and device and data query method and apparatus.Wherein, the method includes:The dimension of achievement data is combined, multiple dimension combinations are obtained, achievement data is to there are multiple dimensions;Multiple dimensions are calculated respectively combines each corresponding achievement data of dimension combination;And the multiple dimensions of storage combine each dimension and combine corresponding achievement data, so that dimension to be checked is inquired about from the data of storage when data query is carried out with dimension combination combines corresponding achievement data.Present application addresses the technical problem to query time length during the dimension query composition of multiple dimensions.

Description

Date storage method and device and data query method and apparatus
Technical field
The application is related to data processing field, looks in particular to a kind of date storage method and device and data Ask method and apparatus.
Background technology
At present, the inquiry based on dimension and index generally first builds true table (Fact Table), wherein, Fact Table Be mainly characterized by collect comprising numerical data (fact), and these digital informations, using provide units concerned as The data of history.Then set up dimension table (Dimension Table) to associate with Fact Table, finally build dynamic State query statement is inquired about.This is traditional on-line analytical processing (OLAP) analysis mode, in single dimension analysis There is good query performance, while report can also be derived according to the combination of multiple dimensions.
However, Fact Table are the maximum sets combined based on dimension stored, in the inquiry speed to single dimension Degree is very fast, but for the dimension combination of multiple dimensions is while when inquiring about, query script needs first to be grouped according to dimension Polymerization, when combination and it is more, then so that the query script time is longer.
For above-mentioned problem, effective solution is not yet proposed at present.
The content of the invention
The embodiment of the present application provides a kind of date storage method and device and data query method and apparatus, with least Solve the technical problem to query time length during the dimension query composition of multiple dimensions.
According to the one side of the embodiment of the present application, there is provided a kind of date storage method, including:To achievement data Dimension is combined, and obtains multiple dimension combinations, and the achievement data is to there is multiple dimensions;Calculate respectively described Multiple dimensions combine each dimension and combine corresponding achievement data;And the plurality of dimension of storage combines each dimension group Corresponding achievement data is closed, so that inquiring about to be checked when data query being carried out with dimension combination from the data of storage Dimension combine corresponding achievement data.
Further, each dimension combination of the plurality of dimension combination includes one or more groups of dimension datas, stores institute Stating multiple dimensions and combining each dimension and combine corresponding achievement data includes:Set up the unique mark of every group of dimension data; One achievement data table is set up respectively to the combination of the plurality of dimension, on the achievement data table, includes corresponding dimension group The corresponding achievement data of every group of dimension data included by conjunction;And by the unique mark its corresponding dimension data Corresponding achievement data is associated storage, so that inquiring about index by the unique mark when data query is carried out Data.
Further, the unique mark for setting up every group of dimension data includes:The number of dimensions included to each dimension combination According to carrying out duplicate removal;Dimension data after duplicate removal is stored to and the dimension corresponding dimension of combination residing for the dimension data In combination table;And the unique mark of the every group of dimension data set up after duplicate removal.
According to the another aspect of the embodiment of the present application, a kind of data query method is additionally provided, including:Receiving data is looked into Request is ask, the data inquiry request is used for the target dimension of the multiple dimensions of requesting query and combines corresponding achievement data; The target dimension combination is determined based on the inquiry request;Combined as querying condition from prestoring using target dimension The plurality of dimension combine during each dimension combines corresponding achievement data and inquire about target dimension and combine corresponding index number According to.
Further, combined as querying condition using target dimension each dimension is combined from the plurality of dimension for prestoring The corresponding achievement data of target dimension combination is inquired about in the corresponding achievement data of degree combination to be included:Made with target dimension combination The table name and index number of dimension combination table corresponding with target dimension combination are inquired about from metadata table for querying condition According to the table name of table;With the unique mark inquiry achievement data in the achievement data table, and associate the dimension combination table Obtain dimension data corresponding with the unique mark.
According to the another aspect of the embodiment of the present application, a kind of data storage device is additionally provided, including:Assembled unit, For being combined to the dimension of achievement data, multiple dimension combinations are obtained, the achievement data is to there are multiple dimensions; Computing unit, combines each corresponding achievement data of dimension combination for calculating the plurality of dimension respectively;And deposit Storage unit, combines each corresponding achievement data of dimension combination for storing the plurality of dimension, so that with dimension Dimension to be checked is inquired about from the data of storage when combination carries out data query and combines corresponding achievement data.
Further, each dimension combination of the plurality of dimension combination includes one or more groups of dimension datas, described to deposit Storage unit includes:First sets up module, for setting up the unique mark of every group of dimension data;Second sets up module, uses In an achievement data table being set up respectively to the combination of the plurality of dimension, include corresponding dimension on the achievement data table The corresponding achievement data of every group of dimension data included by combination;And memory module, for by the unique mark with The corresponding achievement data of its corresponding dimension data is associated storage, so that when data query is carried out by described Unique mark inquires about achievement data.
Further, described first set up module and include:Duplicate removal submodule, for included to the combination of each dimension Dimension data carries out duplicate removal;Sub-module stored, for the dimension data after duplicate removal is stored to and the dimension data institute The dimension at place is combined in corresponding dimension combination table;And setting up submodule, for the every group of number of dimensions set up after duplicate removal According to unique mark.
According to the another aspect of the embodiment of the present application, a kind of data query arrangement is additionally provided, including:Receiving unit, For receiving data inquiry request, the target dimension combination that the data inquiry request is used for the multiple dimensions of requesting query is right The achievement data answered;Determining unit, for determining the target dimension combination based on the inquiry request;Query unit, Each dimension combination correspondence is combined from the plurality of dimension for prestoring for combining as querying condition using target dimension Achievement data in inquire about target dimension and combine corresponding achievement data.
Further, the query unit includes:First enquiry module, for being combined as inquiry bar using target dimension Part inquires about the table of the table name and achievement data table of dimension combination table corresponding with target dimension combination from metadata table Name;Second enquiry module, for inquiring about achievement data with the unique mark in the achievement data table, and associates described Dimension combination table obtains dimension data corresponding with the unique mark.
According to the embodiment of the present application, the dimension of achievement data is combined in phase data memory, obtains multiple dimensions Combination, calculates multiple dimensions respectively and combines each corresponding achievement data of dimension combination, store multiple dimensions combinations every Individual dimension combines corresponding achievement data, so that looking into from the data of storage when data query is carried out with dimension combination Ask dimension to be checked and combine corresponding achievement data, without the need for polymerization process being carried out to data in query script, improve The speed of the data query of dimension combination, solves query time length during the dimension query composition to multiple dimensions Technical problem.
Description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes the part of the application, this Shen Schematic description and description please does not constitute the improper restriction to the application for explaining the application.In accompanying drawing In:
Fig. 1 is the flow chart of the date storage method according to the embodiment of the present application;
Fig. 2 is the flow chart of the data query method according to the embodiment of the present application;
Fig. 3 is the schematic diagram of the data storage device according to the embodiment of the present application;
Fig. 4 is the schematic diagram of the data query arrangement according to the embodiment of the present application.
Specific embodiment
In order that those skilled in the art more fully understand application scheme, below in conjunction with the embodiment of the present application Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present application, it is clear that described embodiment The only embodiment of the application part, rather than the embodiment of whole.Based on the embodiment in the application, ability The every other embodiment obtained under the premise of creative work is not made by domain those of ordinary skill, should all belong to The scope of the application protection.
It should be noted that the description and claims of this application and the term " first " in above-mentioned accompanying drawing, " Two " it is etc. for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that this The data that sample is used can be exchanged in the appropriate case, so as to embodiments herein described herein can with except Here the order beyond those for illustrating or describing is implemented.Additionally, term " comprising " and " having " and they Any deformation, it is intended that cover non-exclusive process, the side for including, for example, containing series of steps or unit Method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include unclear List or other intrinsic for these processes, method, product or equipment step or unit.
According to the embodiment of the present application, there is provided a kind of embodiment of the method for date storage method, it should be noted that The step of flow process of accompanying drawing is illustrated can be performed in the such as computer system of one group of computer executable instructions, and And, although show logical order in flow charts, but in some cases, can be with different from order herein Perform shown or described step.
Fig. 1 is the flow chart of the date storage method according to the embodiment of the present application, as shown in figure 1, the method include as Lower step:
Step S102, is combined to the dimension of achievement data, obtains multiple dimension combinations, and achievement data is more to having Individual dimension.
Index refers to the method for weighing target data;Pre- interim plan attended index, specification, standard, typically use data Represent.Such as, everybody has a meeting and can say at the end of the year, has increased several indexs this year newly:It is the rate of personnel outflow, shops respectively The volume of the flow of passengers, objective unit price, etc..These indexs be all to result, that is, to target generality description.The application Achievement data in embodiment is then the actual quantization result to target data, and for example, the click of advertisement refers to advertisement One index, its actual click volume for counting are then the achievement datas of the index.
In the embodiment of the present application, the achievement data multiple dimensions of correspondence, also by taking advertisement as an example, the playback equipment of advertisement and Browser etc., is the dimension of advertisement index data.When data query is carried out, can be dimension with browser looking into Ask the achievement data of advertisement, for example, click volume, light exposure and visit capacity etc., it is also possible to be dimension with playback equipment come Inquiry.
As when data query is carried out, the often dimension combination to multiple dimensions is inquired about.In the present embodiment, First the dimension of achievement data is combined, multiple dimension combinations are obtained, each dimension combination includes one or more Dimension.
Step S104, each dimension for being calculated in multiple dimension combinations respectively combine corresponding achievement data.
Step S106, stores multiple dimensions and combines each corresponding achievement data of dimension combination, so that with dimension group Dimension to be checked is inquired about from the data of storage when conjunction carries out data query and combines corresponding achievement data.
In the present embodiment, based on dimension combination, its corresponding achievement data is calculated, combined to referring to further according to dimension Mark data carry out classification storage, so so that when the achievement data of certain dimension combination is inquired about, can directly with dimension Degree combination directly inquires corresponding achievement data as querying condition, without the need for carrying out at polymerization to data in query script Reason, so as to improve the speed of the data query to dimension combination.
According to the embodiment of the present application, the dimension of achievement data is combined in phase data memory, obtains multiple dimensions Combination, calculates multiple dimensions respectively and combines each corresponding achievement data of dimension combination, store multiple dimensions combinations every Individual dimension combines corresponding achievement data, so that looking into from the data of storage when data query is carried out with dimension combination Ask dimension to be checked and combine corresponding achievement data, without the need for polymerization process being carried out to data in query script, improve The speed of the data query of dimension combination, solves query time length during the dimension query composition to multiple dimensions Technical problem.
Preferably, in the embodiment of the present application, after multiple dimension combinations are obtained, can be by dimension combination storage to unit In tables of data, in order to when the data query of dimension combination is carried out, dimension to be inquired about be inquired about from metadata table The table name of combination.
Preferably, after multiple dimension combinations are obtained, the combination of the plurality of dimension can also be filtered, to retain Needed for data query business dimension combination, for be not needed for data query business dimension combination can remove, so Afterwards by the dimension combination storage after filtration in metadata table.When the dimension corresponding achievement data of combination is calculated, also may be used Corresponding achievement data is combined only to calculate the dimension after filtering.
Preferably, each dimension combination of multiple dimension combinations includes one or more groups of dimension datas, stores multiple dimensions Combining each corresponding achievement data of dimension combination includes:Set up the unique mark of every group of dimension data;To multiple dimensions An achievement data table is set up in combination respectively, includes every group of dimension that the combination of corresponding dimension is included on achievement data table The corresponding achievement data of data;And unique mark its corresponding dimension data corresponding achievement data is associated Storage, so that inquiring about achievement data by unique mark when data query is carried out.
In the embodiment of the present application, each dimension combination includes one or more groups of dimension datas, and dimension data here is referred to The species data of dimension combination, for example, for dimension combines " browser+equipment ", as browser has many kinds Class, such as IE browser, Chrome browsers etc., equipment there is also many types, such as mobile phone, panel computer etc. Deng dimension that this is combination " browser+equipment " includes dimension data such as " IE browser+mobile phone ", " IE is browsed Device+panel computer ", " Chrome browsers+mobile phone ", " Chrome browsers+panel computer " etc..
The unique mark of every group of dimension data is set up, for uniquely representing this group of dimension data, and respectively to each dimension A kind of corresponding achievement data table is set up in combination, and every group of dimension data by the achievement data table and thereon is only One mark is associated storage, so, when inquiring about to certain corresponding index of group dimension data, can pass through the group The unique mark of dimension data carries out Querying by group, obtains achievement data.
According to the embodiment of the present application, unique mark is set up by every group of dimension data to each dimension combination, and will only One mark and achievement data table associated storage so that when data are inquired about, it is possible to use unique mark is looked into carrying out packet Ask, quickly determine dimension data, inquire its corresponding achievement data.
Further, the unique mark for setting up every group of dimension data includes:The number of dimensions included to each dimension combination According to carrying out duplicate removal;Dimension data storage after duplicate removal is combined to dimension corresponding with the dimension combination residing for dimension data In table;And the unique mark of the every group of dimension data set up after duplicate removal.
As the situation that dimension data can have repetition, in the present embodiment, Ke Yixian are obtained in the case where multiple dimension combinations are carried out Duplicate removal is carried out to dimension data, and the dimension data after duplicate removal is stored in dimension combination table, be stored with the table each Dimension data under individual dimension combination.Then, corresponding unique mark is set up respectively to the dimension data after above-mentioned process.
According to the embodiment of the present application, by carrying out storing after duplicate removal to dimension data, when further improving data query Inquiry velocity, reduces inquiry time-consuming.
According to the embodiment of the present application, a kind of data query method is additionally provided, the data query method can be in the application The querying method on the basis of date storage method in above-described embodiment.As shown in Fig. 2 the data query method includes:
Step S202, receiving data inquiry request, data inquiry request are used for the target dimension of the multiple dimensions of requesting query Combine corresponding achievement data.
Based on inquiry request, step S204, determines that target dimension is combined.
Step S206, combines each dimension group from the multiple dimensions for prestoring as querying condition using target dimension combination Target dimension is inquired about in closing corresponding achievement data and combines corresponding achievement data.
For the date storage method that data storage method in the embodiment of the present application may refer in the above embodiments of the present application, Here do not repeat.
As in the embodiment of the present application, data are to carry out storage of classifying with dimension combination, receiving for inquiring about target During the data inquiry request of the achievement data of dimension combination, then querying condition is combined as with target dimension directly, from advance Target data is inquired about in the achievement data of storage and combines corresponding achievement data, without the need for gathering to data in query script Conjunction is processed, so as to improve the speed of the data query to dimension combination.
Preferably, combined as querying condition using target dimension each dimension combination is combined from the multiple dimensions for prestoring The corresponding achievement data of target dimension combination is inquired about in corresponding achievement data to be included:Combined as inquiry using target dimension Condition inquires about the table name of the table name and achievement data table of dimension combination table corresponding with target dimension combination from metadata table; With the unique mark inquiry achievement data in achievement data table, and relevant dimension combination table obtains corresponding with unique mark Dimension data.
In the embodiment of the present application, can be by the storage of the table name of the dimension combination table for pre-building and achievement data table to first number According in table.When the achievement data for carrying out target dimension combination is inquired about, target dimension can be inquired from metadata table The table name of corresponding dimension combination table and achievement data table is combined, then by the unique mark stored in dimension combination table from finger Corresponding achievement data is searched in mark data table.
According to the embodiment of the present application, a kind of data storage device is additionally provided, the device can be used for performing the application reality The date storage method of example is applied, as shown in figure 3, the device includes:Assembled unit 301, computing unit 303 and deposit Storage unit 305.
Assembled unit 301 obtains multiple dimension combinations, achievement data pair for being combined to the dimension of achievement data There should be multiple dimensions.
Index refers to measurement mesh calibration method;Pre- interim plan attended index, specification, standard, are typically represented with data. Such as, everybody has a meeting and can say at the end of the year, has increased several indexs this year newly:Be respectively the rate of personnel outflow, shops's volume of the flow of passengers, Objective unit price, etc..These indexs be all to result, that is, to target generality description.In the embodiment of the present application Achievement data be then the actual quantization result to index, for example, the click of advertisement refers to an index of advertisement, its The click volume that actual count goes out is then the achievement data of the index.
In the embodiment of the present application, the achievement data multiple dimensions of correspondence, also by taking advertisement as an example, the playback equipment of advertisement and Browser etc., is the dimension of advertisement index data.When data query is carried out, can be looked into browser as dimension Ask the achievement data of advertisement, for example, click volume, light exposure and visit capacity etc., it is also possible to come by dimension of playback equipment Inquiry.
As when data query is carried out, the often dimension combination to multiple dimensions is inquired about.In the present embodiment, First the dimension of achievement data is combined, multiple dimension combinations are obtained, each dimension combination includes one or more Dimension.
Computing unit 303 combines each corresponding achievement data of dimension combination for calculating multiple dimensions respectively.
Memory element 305 is used to storing multiple dimensions and combines each dimension and combine corresponding achievement data so that with Dimension combination is inquired about dimension to be checked from the data of storage when carrying out data query and combines corresponding achievement data.
In the present embodiment, based on dimension combination, its corresponding achievement data is calculated, combined to referring to further according to dimension Mark data carry out classification storage, so so that when the achievement data of certain dimension combination is inquired about, can directly with dimension Degree combination directly inquires corresponding achievement data as querying condition, without the need for carrying out at polymerization to data in query script Reason, so as to improve the speed of the data query to dimension combination.
According to the embodiment of the present application, the dimension of achievement data is combined by grouped element in phase data memory, Multiple dimension combinations are obtained, multiple dimensions that computing unit calculate respectively combine each dimension and combine corresponding achievement data, Memory element stores multiple dimensions and combines each corresponding achievement data of dimension combination, so that being carried out with dimension combination Dimension to be checked is inquired about from the data of storage during data query and combines corresponding achievement data, need not in query script Polymerization process is carried out to data, the speed of the data query of dimension combination is improve, is solved the dimension to multiple dimensions The technical problem of query time length during query composition.
Preferably, in the embodiment of the present application, after multiple dimension combinations are obtained, can be by dimension combination storage to unit In tables of data, in order to when the data query of dimension combination is carried out, dimension to be inquired about be inquired about from metadata table The table name of combination.
Preferably, after multiple dimension combinations are obtained, the combination of the plurality of dimension can also be filtered, to retain Needed for data query business dimension combination, for be not needed for data query business dimension combination can remove, so Afterwards by the dimension combination storage after filtration in metadata table.When the dimension corresponding achievement data of combination is calculated, also may be used Corresponding achievement data is combined only to calculate the dimension after filtering.
Preferably, each dimension combination of multiple dimension combinations includes one or more groups of dimension datas, and memory element includes: First sets up module, for setting up the unique mark of every group of dimension data;Second sets up module, for multiple dimensions An achievement data table is set up in combination respectively, includes every group of dimension that the combination of corresponding dimension is included on achievement data table The corresponding achievement data of data;And memory module, for by unique mark its corresponding dimension data corresponding finger Mark data are associated storage, so that inquiring about achievement data by unique mark when data query is carried out.
In the embodiment of the present application, each dimension combination includes one or more groups of dimension datas, and dimension data here is referred to The species data of dimension combination, for example, for dimension combines " browser+equipment ", as browser has many kinds Class, such as IE browser, Chrome browsers etc., equipment there is also many types, such as mobile phone, panel computer etc. Deng dimension that this is combination " browser+equipment " includes dimension data such as " IE browser+mobile phone ", " IE is browsed Device+panel computer ", " Chrome browsers+mobile phone ", " Chrome browsers+panel computer " etc..
The unique mark of every group of dimension data is set up, for uniquely representing this group of dimension data, and respectively to each dimension A kind of corresponding achievement data table is set up in combination, and every group of dimension data by the achievement data table and thereon is only One mark is associated storage, so, when inquiring about to certain corresponding index of group dimension data, can pass through the group The unique mark of dimension data carries out Querying by group, obtains achievement data.
According to the embodiment of the present application, unique mark is set up by every group of dimension data to each dimension combination, and will only One mark and achievement data table associated storage so that when data are inquired about, it is possible to use unique mark is looked into carrying out packet Ask, quickly determine dimension data, inquire its corresponding achievement data.
Further, first set up module and include:Duplicate removal submodule, for the dimension included to each dimension combination Data carry out duplicate removal;Sub-module stored, for the dimension data after duplicate removal is stored to and the dimension residing for dimension data Combine in corresponding dimension combination table;And setting up submodule, for the unique of every group of dimension data setting up after duplicate removal Mark.
As the situation that dimension data can have repetition, in the present embodiment, Ke Yixian are obtained in the case where multiple dimension combinations are carried out Duplicate removal is carried out to dimension data, and the dimension data after duplicate removal is stored in dimension combination table, be stored with the table each Dimension data under individual dimension combination.Then, corresponding unique mark is set up respectively to the dimension data after above-mentioned process.
According to the embodiment of the present application, by carrying out storing after duplicate removal to dimension data, when further improving data query Inquiry velocity, reduces inquiry time-consuming.
According to the embodiment of the present application, a kind of data query arrangement is additionally provided, the device can be used for performing the application reality The data query method of example is applied, as shown in figure 4, the device includes:Receiving unit 401, determining unit 403 and look into Ask unit 405.
Receiving unit 401 is used for receiving data inquiry request, and data inquiry request is used for the mesh of the multiple dimensions of requesting query Mark dimension combines corresponding achievement data.
Determining unit 403 for based on inquiry request determine target dimension combine.
Query unit 405 combines each from the multiple dimensions for prestoring as querying condition for combining using target dimension Dimension is inquired about target dimension in combining corresponding achievement data and combines corresponding achievement data.
For the date storage method that data storage method in the embodiment of the present application may refer in the above embodiments of the present application, Here do not repeat.
As in the embodiment of the present application, data are to carry out storage of classifying with dimension combination, receiving for inquiring about target During the data inquiry request of the achievement data of dimension combination, then querying condition is combined as with target dimension directly, from advance Target data is inquired about in the achievement data of storage and combines corresponding achievement data, without the need for gathering to data in query script Conjunction is processed, so as to improve the speed of the data query to dimension combination.
Preferably, query unit includes:First enquiry module, for being combined as querying condition from unit using target dimension The table name of the table name and achievement data table of dimension combination table corresponding with target dimension combination is inquired about in tables of data;Second looks into Ask module, for in achievement data table unique mark inquiry achievement data, and relevant dimension combination table obtain with only The corresponding dimension data of one mark.
In the embodiment of the present application, can be by the storage of the table name of the dimension combination table for pre-building and achievement data table to first number According in table.When the achievement data for carrying out target dimension combination is inquired about, target dimension can be inquired from metadata table The table name of corresponding dimension combination table and achievement data table is combined, then by the unique mark stored in dimension combination table from finger Corresponding achievement data is searched in mark data table.
The data query of data query process of the prior art and the embodiment of the present application is contrasted below by an example Process:
Existing data storage includes:Dimension table Dimesion1 (table 1) and Dimesion2 (table 2), and it is true Table FACT (table 3), it is as follows:
Table 1
Dimension ID Browser
1 Chrome
2 IE
Table 2
Dimension ID Equipment
1 PC
2 Pad
Table 3
Key Time Cookie Browser ID Device id Click on Exposure Access
1 2015/8/1 A67A57F4-B439-4FA8-A819-0BE8D0099C19 1 1 1 1 1
2 2015/8/1 A67A57F4-B439-4FA8-A819-0BE8D0099C19 1 2 1 1 1
3 2015/8/1 A67A57F4-B439-4FA8-A819-0BE8D0099C19 2 1 1 1 1
When data query is carried out, its query statement is:
SELECT browsers, equipment, SUM (click) are clicked on, and SUM (exposure) exposures, SUM (access) access FROM Fact
INNER JOIN Dimension1 ON Fact. browser ID=Dimension1. browser ID
INNER JOIN Dimension1 ON Fact. browser ID=Dimension1. device ids
WHERE time=2015/8/1
GROUP BY browsers, equipment
In the query script, needs packet aggregation is carried out according to dimension, when combination and it is more, time longer performance is extremely Lowly.
The data storage of the embodiment of the present application includes:Metadata table Metadata (table 4) dimension combination table Dimension_ is browsed Device (table 5), Dimension_ browsers (table 6) and Dimension_ browser equipments (table 7), and achievement data Table Metric_ browsers (table 8), Metric_ equipment (table 9) and Metric_ browser equipments (table 10), it is as follows It is shown:
Table 4
Key Dimension table Index table Dimension is combined
1 Dimension_ browsers Metric_ browsers Browser
2 Dimension_ equipment Metric_ equipment Equipment
3 Dimension_ browser equipments Metric_ equipment Browser equipment
Table 5
Dimension ID Browser
1 Chrome
2 IE
Table 6
Dimension ID Equipment
1 PC
2 Pad
Table 7
Dimension ID Browser Equipment
1 Chrome PC
2 Chrome Pad
3 IE PC
Table 8
Dimension ID Browser ID Time Click on Exposure Access
1 1 2015/8/1 2 2 2
2 2 2015/8/1 2 2 2
Table 9
Dimension ID Device id Time Click on Exposure Access
1 1 2015/8/1 2 2 2
2 2 2015/8/1 2 2 2
Table 10
Dimension ID Browser equipment ID Time Click on Exposure Access
1 1 2015/8/1 1 1 1
2 2 2015/8/1 1 1 1
3 3 2015/8/1 1 1 1
On the basis of above-mentioned data storage, in the embodiment of the present application, click under Query Browser and equipment dimension, expose As a example by light and access dimension, understood using Dimension_ browser equipments and Metric_ browsers according to Metadata Equipment, query statement are as follows:
SELECT browsers, equipment are clicked on, and exposure accesses FROM
Dimension_ browser equipments
INNER JOIN
(SELECT browser equipment ID, SUM (click) are clicked on, and SUM (exposure) exposures, SUM (access) access FROM Metric_ browser equipments
WHERE time=2015/8/1
Group by browser equipment ID) T
ON T. look at device device id=Dimension_ browser equipments. look at device device id
As can be seen here, only need to be searched only from the case of required dimension related with being grouped according to browser equipment ID after improvement Data, reduce inquiry and the grouping field of data volume, greatly improve performance.
Above-mentioned the embodiment of the present application sequence number is for illustration only, does not represent the quality of embodiment.
In above-described embodiment of the application, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain embodiment The part of detailed description, may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, other can be passed through Mode realize.Wherein, device embodiment described above is only schematic, such as division of described unit, Can be a kind of division of logic function, when actually realizing, can have other dividing mode, such as multiple units or component Can with reference to or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, institute The coupling each other for showing or discussing or direct-coupling or communication connection can be by some interfaces, unit or mould The INDIRECT COUPLING of block or communication connection, can be electrical or other forms.
The unit as separating component explanation can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location, you can local to be located at one, or can also be distributed to On multiple units.Some or all of unit therein can be selected according to the actual needs to realize this embodiment scheme Purpose.
In addition, each functional unit in the application each embodiment can be integrated in a processing unit, it is also possible to It is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.It is above-mentioned integrated Unit both can be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit realized using in the form of SFU software functional unit and as independent production marketing or use when, Can be stored in a computer read/write memory medium.Based on such understanding, the technical scheme essence of the application On all or part of part that in other words prior art is contributed or the technical scheme can be with software product Form is embodied, and the computer software product is stored in a storage medium, is used so that one including some instructions Platform computer equipment (can be personal computer, server or network equipment etc.) performs each embodiment institute of the application State all or part of step of method.And aforesaid storage medium includes:USB flash disk, read only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD Etc. it is various can be with the medium of store program codes.
The above is only the preferred implementation of the application, it is noted that for the ordinary skill people of the art For member, on the premise of without departing from the application principle, some improvements and modifications can also be made, these improve and moisten Decorations also should be regarded as the protection domain of the application.

Claims (10)

1. a kind of date storage method, it is characterised in that include:
The dimension of achievement data is combined, multiple dimension combinations are obtained;
Each dimension for being calculated in the plurality of dimension combination respectively combines corresponding achievement data;And
Store the plurality of dimension and combine each corresponding achievement data of dimension combination, so that being combined with dimension Dimension to be checked is inquired about from the data of storage when carrying out data query and combines corresponding achievement data.
2. method according to claim 1, it is characterised in that each dimension combination bag of the plurality of dimension combination One or more groups of dimension datas are included, the plurality of dimension is stored and is combined each corresponding achievement data bag of dimension combination Include:
Set up the unique mark of every group of dimension data;
One achievement data table is set up respectively to the combination of the plurality of dimension, is included on the achievement data table corresponding The dimension corresponding achievement data of every group of dimension data that included of combination;And
The unique mark its corresponding dimension data corresponding achievement data is associated into storage, so that Achievement data is inquired about by the unique mark when data query is carried out.
3. method according to claim 2, it is characterised in that the unique mark for setting up every group of dimension data includes:
The dimension data included to each dimension combination carries out duplicate removal;
Dimension data storage after duplicate removal is combined to dimension corresponding with the dimension combination residing for the dimension data In table;And
The unique mark of the every group of dimension data set up after duplicate removal.
4. a kind of data query method, it is characterised in that include:
Receiving data inquiry request, the data inquiry request are used for the target dimension group of the multiple dimensions of requesting query Close corresponding achievement data;
The target dimension combination is determined based on the inquiry request;
Combined as querying condition using target dimension each dimension combination is combined from the plurality of dimension for prestoring Target dimension is inquired about in corresponding achievement data and combines corresponding achievement data.
5. method according to claim 4, it is characterised in that combined as querying condition from advance using target dimension The plurality of dimension of storage is combined during each dimension combines corresponding achievement data inquires about target dimension combination correspondence Achievement data include:
From metadata table inquire about with target dimension combination corresponding as querying condition using target dimension combination The table name of the table name and achievement data table of dimension combination table;
With the unique mark inquiry achievement data in the achievement data table, and associate the dimension combination table acquisition Dimension data corresponding with the unique mark.
6. a kind of data storage device, it is characterised in that include:
Assembled unit, for being combined to the dimension of achievement data, obtains multiple dimension combinations, the index Data are to there is multiple dimensions;
Computing unit, combines corresponding index for calculating each dimension in the plurality of dimension combination respectively Data;And
Memory element, combines each corresponding achievement data of dimension combination for storing the plurality of dimension, so that Obtain inquire about the corresponding finger of dimension combination to be checked when data query being carried out with dimension combination from the data of storage Mark data.
7. device according to claim 6, it is characterised in that each dimension combination bag of the plurality of dimension combination One or more groups of dimension datas are included, the memory element includes:
First sets up module, for setting up the unique mark of every group of dimension data;
Second sets up module, for setting up an achievement data table, the finger respectively to the combination of the plurality of dimension Include the corresponding achievement data of every group of dimension data included by the combination of corresponding dimension in mark tables of data;And
Memory module, for the unique mark its corresponding dimension data corresponding achievement data is closed Connection storage, so that inquiring about achievement data by the unique mark when data query is carried out.
8. device according to claim 7, it is characterised in that described first sets up module includes:
Duplicate removal submodule, carries out duplicate removal for the dimension data included to each dimension combination;
Sub-module stored, for the dimension data after duplicate removal is stored to and the dimension group residing for the dimension data Close in corresponding dimension combination table;And
Setting up submodule, the unique mark of every group of dimension data for setting up after duplicate removal.
9. a kind of data query arrangement, it is characterised in that include:
Receiving unit, for receiving data inquiry request, the data inquiry request is used for the multiple dimensions of requesting query The target dimension of degree combines corresponding achievement data;
Determining unit, for determining the target dimension combination based on the inquiry request;
Query unit, for being combined as querying condition from the plurality of dimension group for prestoring using target dimension Close during each dimension combines corresponding achievement data and inquire about the corresponding achievement data of target dimension combination.
10. device according to claim 9, it is characterised in that the query unit includes:
First enquiry module, for using target dimension combine as querying condition inquire about from metadata table with it is described Target dimension combines the table name of the table name and achievement data table of corresponding dimension combination table;
Second enquiry module, for inquiring about achievement data with the unique mark in the achievement data table, and associates The dimension combination table obtains dimension data corresponding with the unique mark.
CN201510625073.4A 2015-09-25 2015-09-25 Date storage method and device and data query method and apparatus Pending CN106557498A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510625073.4A CN106557498A (en) 2015-09-25 2015-09-25 Date storage method and device and data query method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510625073.4A CN106557498A (en) 2015-09-25 2015-09-25 Date storage method and device and data query method and apparatus

Publications (1)

Publication Number Publication Date
CN106557498A true CN106557498A (en) 2017-04-05

Family

ID=58415425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510625073.4A Pending CN106557498A (en) 2015-09-25 2015-09-25 Date storage method and device and data query method and apparatus

Country Status (1)

Country Link
CN (1) CN106557498A (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135284A (en) * 2017-05-05 2017-09-05 携程旅游信息技术(上海)有限公司 The querying method and system of terminal device in business system
CN107229730A (en) * 2017-06-08 2017-10-03 北京奇虎科技有限公司 Data query method and device
CN107480268A (en) * 2017-08-17 2017-12-15 北京奇虎科技有限公司 Data query method and device
CN107729399A (en) * 2017-09-21 2018-02-23 北京京东尚科信息技术有限公司 The method and apparatus of data processing
CN107977897A (en) * 2017-12-28 2018-05-01 平安健康保险股份有限公司 Insurance business data analysis method, system and computer-readable recording medium
CN108829795A (en) * 2018-06-04 2018-11-16 北京奇艺世纪科技有限公司 Data query method and device
CN108920516A (en) * 2018-05-31 2018-11-30 北京字节跳动网络技术有限公司 Real-time analysis method, system, device and computer readable storage medium
CN108932257A (en) * 2017-05-25 2018-12-04 北京国双科技有限公司 The querying method and device of multi-dimensional data
CN108959485A (en) * 2018-06-21 2018-12-07 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of flow indicator data
CN109033173A (en) * 2018-06-21 2018-12-18 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of multidimensional index data
CN109086339A (en) * 2018-07-06 2018-12-25 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of index recombination rate
CN109165238A (en) * 2018-06-21 2019-01-08 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of cyclical indicator data
CN109241197A (en) * 2018-06-21 2019-01-18 深圳市彬讯科技有限公司 Data processing method, server and the storage medium that index is shown
CN109299141A (en) * 2018-10-19 2019-02-01 深圳市元征科技股份有限公司 A kind of method of data query, system and associated component
CN109359141A (en) * 2018-08-07 2019-02-19 阿里巴巴集团控股有限公司 A kind of Visual Report Forms method for exhibiting data and device
CN109561326A (en) * 2017-09-26 2019-04-02 北京国双科技有限公司 A kind of data query method and device
CN109558432A (en) * 2017-09-27 2019-04-02 北京国双科技有限公司 Data processing method and device
CN109828993A (en) * 2017-08-31 2019-05-31 北京国双科技有限公司 A kind of querying method and device of statistical data
CN110008211A (en) * 2019-02-21 2019-07-12 北京奇艺世纪科技有限公司 Data query method, apparatus, electronic equipment and storage medium
WO2019232933A1 (en) * 2018-06-05 2019-12-12 平安科技(深圳)有限公司 Data storage method and system employing distributed database
CN110688541A (en) * 2019-10-08 2020-01-14 中国建设银行股份有限公司 Report data query method and device, storage medium and electronic equipment
CN112286995A (en) * 2020-11-16 2021-01-29 北京达佳互联信息技术有限公司 Data analysis method, device, server, system and storage medium
CN112380275A (en) * 2021-01-15 2021-02-19 北京金山云网络技术有限公司 Data query method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1949226A (en) * 2006-11-23 2007-04-18 金蝶软件(中国)有限公司 Multidimensional data reading and writing method and apparatus in on-line analytical processing system
US8620857B1 (en) * 2007-10-18 2013-12-31 Google Inc. Querying multidimensional data with independent fact and dimension pipelines combined at query time
CN104424251A (en) * 2013-08-28 2015-03-18 腾讯科技(深圳)有限公司 Calculation method and system of multi-dimensional split
CN104424231A (en) * 2013-08-26 2015-03-18 腾讯科技(深圳)有限公司 Multi-dimensional data processing method and device
CN104462434A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 Data inquiring method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1949226A (en) * 2006-11-23 2007-04-18 金蝶软件(中国)有限公司 Multidimensional data reading and writing method and apparatus in on-line analytical processing system
US8620857B1 (en) * 2007-10-18 2013-12-31 Google Inc. Querying multidimensional data with independent fact and dimension pipelines combined at query time
CN104424231A (en) * 2013-08-26 2015-03-18 腾讯科技(深圳)有限公司 Multi-dimensional data processing method and device
CN104424251A (en) * 2013-08-28 2015-03-18 腾讯科技(深圳)有限公司 Calculation method and system of multi-dimensional split
CN104462434A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 Data inquiring method and device

Cited By (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135284A (en) * 2017-05-05 2017-09-05 携程旅游信息技术(上海)有限公司 The querying method and system of terminal device in business system
CN108932257A (en) * 2017-05-25 2018-12-04 北京国双科技有限公司 The querying method and device of multi-dimensional data
CN108932257B (en) * 2017-05-25 2021-10-08 北京国双科技有限公司 Multi-dimensional data query method and device
CN107229730A (en) * 2017-06-08 2017-10-03 北京奇虎科技有限公司 Data query method and device
CN107480268A (en) * 2017-08-17 2017-12-15 北京奇虎科技有限公司 Data query method and device
CN109828993A (en) * 2017-08-31 2019-05-31 北京国双科技有限公司 A kind of querying method and device of statistical data
CN107729399B (en) * 2017-09-21 2020-06-05 北京京东尚科信息技术有限公司 Data processing method and device
CN107729399A (en) * 2017-09-21 2018-02-23 北京京东尚科信息技术有限公司 The method and apparatus of data processing
CN109561326B (en) * 2017-09-26 2021-02-12 北京国双科技有限公司 Data query method and device
CN109561326A (en) * 2017-09-26 2019-04-02 北京国双科技有限公司 A kind of data query method and device
CN109558432A (en) * 2017-09-27 2019-04-02 北京国双科技有限公司 Data processing method and device
CN107977897A (en) * 2017-12-28 2018-05-01 平安健康保险股份有限公司 Insurance business data analysis method, system and computer-readable recording medium
CN108920516B (en) * 2018-05-31 2022-03-22 北京字节跳动网络技术有限公司 Real-time analysis method, system, device and computer readable storage medium
CN108920516A (en) * 2018-05-31 2018-11-30 北京字节跳动网络技术有限公司 Real-time analysis method, system, device and computer readable storage medium
CN108829795A (en) * 2018-06-04 2018-11-16 北京奇艺世纪科技有限公司 Data query method and device
WO2019232933A1 (en) * 2018-06-05 2019-12-12 平安科技(深圳)有限公司 Data storage method and system employing distributed database
CN109241197A (en) * 2018-06-21 2019-01-18 深圳市彬讯科技有限公司 Data processing method, server and the storage medium that index is shown
CN109165238A (en) * 2018-06-21 2019-01-08 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of cyclical indicator data
CN108959485A (en) * 2018-06-21 2018-12-07 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of flow indicator data
CN109033173A (en) * 2018-06-21 2018-12-18 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of multidimensional index data
CN109086339A (en) * 2018-07-06 2018-12-25 深圳市彬讯科技有限公司 It is a kind of for generating the data processing method and device of index recombination rate
CN109359141A (en) * 2018-08-07 2019-02-19 阿里巴巴集团控股有限公司 A kind of Visual Report Forms method for exhibiting data and device
CN109299141A (en) * 2018-10-19 2019-02-01 深圳市元征科技股份有限公司 A kind of method of data query, system and associated component
CN110008211B (en) * 2019-02-21 2021-07-06 北京奇艺世纪科技有限公司 Data query method and device, electronic equipment and storage medium
CN110008211A (en) * 2019-02-21 2019-07-12 北京奇艺世纪科技有限公司 Data query method, apparatus, electronic equipment and storage medium
CN110688541A (en) * 2019-10-08 2020-01-14 中国建设银行股份有限公司 Report data query method and device, storage medium and electronic equipment
CN112286995B (en) * 2020-11-16 2021-07-13 北京达佳互联信息技术有限公司 Data analysis method, device, server, system and storage medium
CN112286995A (en) * 2020-11-16 2021-01-29 北京达佳互联信息技术有限公司 Data analysis method, device, server, system and storage medium
CN112380275B (en) * 2021-01-15 2021-07-23 北京金山云网络技术有限公司 Data query method and device and electronic equipment
CN112380275A (en) * 2021-01-15 2021-02-19 北京金山云网络技术有限公司 Data query method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN106557498A (en) Date storage method and device and data query method and apparatus
CN108510311B (en) Method and device for determining marketing scheme and electronic equipment
CN104504077B (en) The statistical method and device of web page access data
CN102890714B (en) Method and device for indexing data
CN107798102A (en) A kind of page display method and device
US10579589B2 (en) Data filtering
CN104965863B (en) A kind of clustering objects method and apparatus
CN108932257A (en) The querying method and device of multi-dimensional data
CN105550175A (en) Malicious account identification method and apparatus
CN105303437A (en) Processing method and device for account checking
CN106790487A (en) The display methods of help information, apparatus and system
CN110069676A (en) Keyword recommendation method and device
CN103475748B (en) A kind of method and apparatus of the geographic location type determining IP address
CN107886382B (en) Method, device and system for analyzing channel drainage effect in website
CN107193822A (en) For the method for paging query, device and equipment
CN104408180A (en) Stored data inquiring method and device
CN104182544B (en) The dimension method for decomposing and device of analytical database
CN106991090A (en) The analysis method and device of public sentiment event entity
CN106649368A (en) Data storage method and device and data query method and device
CN111414410A (en) Data processing method, device, equipment and storage medium
CN107391532A (en) The method and apparatus of data filtering
Punhani et al. Segmenting E-commerce customer through data mining techniques
CN103605744B (en) The analysis method and device of site search engine data on flows
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN106933918A (en) The querying method and device of tables of data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170405