Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification embodiment, below in conjunction with this
Attached drawing in specification embodiment is described in detail the technical solution in this specification embodiment, it is clear that described
Embodiment is only a part of the embodiment of this specification, instead of all the embodiments.The embodiment of base in this manual,
Those of ordinary skill in the art's every other embodiment obtained, all should belong to the range of protection.
The contents such as table, chart are generally comprised in Visual Report Forms, so as to show data letter in visual form
Breath more intuitively obtains key message conducive to user, carries out data analysis.From extensive flattening chart such as line chart, pie
Figure, bar chart, stacked bar graph etc., the chart that can be interacted to advanced three-dimensional or functional hotspot graph, GIS map etc.
It is all common Visual Chart form.
As shown in Figure 1, being the Visual Report Forms showed with graphical format.In the report include 2 kinds of parameters, i.e., provinces and cities with
Date, and including 3 kinds of data, i.e. time, PV (Page View, page browsing amount) and UV (Unique visitor, the page
User sessions).By selecting different parameter values, that is, different provinces and cities and date are selected, can dynamically show corresponding data
Information shows this day of provinces and cities in PV the and UV curve graph of various time points.
In addition, the data information in report can also be with real-time update with the update of data in database.For example, if
Date selection be this day, then in 17:00 page presentation curve graph can with as shown in Figure 1, and after 19:00 page presentation
Curve graph can also include 18:00 and 19:00 data.
Different Visual Report Forms generally pass through different clock rate and data category, show different data informations,
When needing to carry out data analysis by Visual Report Forms, it is necessary first to determine clock rate and data included in the report
Classification, to design the list data structure that bottom data stores in the database.
For needing the report of structure figures 1, it is first determined clock rate is provinces and cities, the date 2, when data category is
Between, PV, UV 3, thus may determine that in database in the corresponding tables of data of the report, need to include 2 parameters column and 3
Data column.Then, in order to improve data search efficiency, meets the needs of instant analysis, it is also necessary to establish rope for 2 parameter column
Draw, can promptly to find corresponding 3 kinds of data in the case where specifying provinces and cities and date parameter value.
According to the clock rate in report with after data category design list data structure, data can be established in the database
The index of table and parameter column, to realize the building of Visual Report Forms.After constructing Visual Report Forms, by respectively joining in the selection page
Several values can quickly search data corresponding with calling by indexing, generate table, chart etc. and be presented in the page.
It can be seen that according to process described above for different Visual Report Forms, due to its clock rate, data category
And required index is different, needs to separately design bottom data storage list data structure used, in addition, if having constructed report
Clock rate in table needs to modify, and at least also needs to re-establish index.
Therefore, it is based on the prior art, Visual Report Forms building shows that efficiency is lower with data, and a variety of list data structure
Increase maintenance difficulties.
In view of the above technical problems, this specification embodiment provides a kind of Visual Report Forms method for exhibiting data, referring to fig. 2
Shown, this method may comprise steps of:
S201, according to the multi-dimensional indexing of preparatory building Visual Report Forms, is obtained in the case where receiving data displaying request
It obtains the data and shows the specified corresponding data of parameter value of request;
In this specification embodiment, the list data structure of Visual Report Forms is abstracted, to design and create
For storing the general purpose table of different report bottom datas.General purpose table storage bottom number can be directly used when constructing Visual Report Forms
According to, and in carrying out data displaying the selected corresponding data of parameter value can be obtained directly using the multi-dimensional indexing of general purpose table
It is shown, to improve the efficiency that building Visual Report Forms and data are shown.
The general purpose table of this specification embodiment may include that N column parameter column are arranged with M column data.Each column parameter column can be right
A kind of clock rate is answered, every column data column can correspond to a kind of data category.Before unstructured Visual Report Forms, general purpose table can be with
For the empty table of not stored data, the bottom data for being more possibly used for building Visual Report Forms can also be stored in advance.
1 general purpose table can be pre-created in database, then N and M need to take biggish numerical value, more visual to meet
Change report for the demand of parameter column and data column, it can be according to parameter type and data class when constructing visualized list
Situation determines that corresponding parameter column are arranged with data.
Multiple general purpose tables can also be pre-created in database, and estimate different Visual Report Forms and parameter column are arranged with data
Demand, N is pre-created and takes the general purpose table of different numerical value respectively from M, for example, can be pre-created it is multiple include 2 column parameters column,
The general purpose table of 5 column datas column, multiple includes the general purpose table of 5 column parameters column, 10 column datas column, and multiple includes 5 column parameters column, 20 column
The general purpose table, etc. of data column.Can be according to parameter type and data class when constructing visualized list the case where, determining pair
General purpose table and parameter column, the data column answered.
In this specification embodiment, research staff can set the value of N and M according to actual needs and be pre-created
General purpose table quantity, also, can also adjust according to demand in practical applications, this specification does not limit this.
In addition, may be implemented quickly to search by the index that parameter arranges when the data for carrying out Visual Report Forms are shown, from
And instant analysis being carried out, therefore in this specification embodiment, one or more creation includes N column parameter column and M column data column
After general purpose table, multi-dimensional indexing also is established for N column parameter column.
It is understood that the multi-dimensional indexing established is more comprehensive, then it is applied to the data query timeliness of Visual Report Forms
Rate is higher.For example, 1 2-d index can be established for every 2 column parameter column of general purpose table, then when any 2 column of general purpose table correspond to
When 2 clock rates of a certain Visual Report Forms, number directly can be inquired using the 2-d index established in advance for this 2 column
According to, and when a certain Visual Report Forms include 3 clock rates, then it needs to arrange using for corresponding 3 column parameter when data query
3 2-d indexs establishing two-by-two in advance, or 2 2-d indexs inquiry data at least within and intersection is taken, efficiency may
Data are inquired lower than direct establish after three-dimensional indexes for 3 column parameters column.
Therefore, more comprehensive multi-dimensional indexing can be established for each column parameter column in general purpose table, for example, if certain is general
Include that 4 column parameters arrange in table, then 6 2-d indexs, 4 three-dimensional indexes and 1 four-dimensional index can be established respectively, thus for not
Efficient data query is provided with possible Visual Report Forms.
On the other hand, index amount will be increased by establishing more comprehensive multi-dimensional indexing, and therefore, those skilled in the art can root
Multi-dimensional indexing is neatly established according to actual conditions, this specification embodiment is without limiting.
For example, more comprehensive multi-dimensional indexing can be established in the lesser situation of N value, and in the biggish feelings of N value
Under condition, two dimension, three-dimensional index, etc. are only established.
In addition, disparate databases such as MySQL, Oracle, SQL Server etc., the index type supported is different, for example,
MySQL database can support the types such as BTree index, hash index, full-text index, and this specification embodiment is not to establishing rope
The concrete type drawn is defined.
Based on the general purpose table for being pre-designed and creating, as shown in figure 3, building can in advance in this specification example scheme
Depending on change report method may include:
S301 is instructed according to the Visual Report Forms building received, is included in the Visual Report Forms that determining needs construct
Clock rate and data category;
S302, in the default general purpose table of database, determine the clock rate corresponding with data category parameter column with
Data column, and obtaining is that the parameter arranges the multi-dimensional indexing being pre-created;
As previously described, the general purpose table being pre-created can be sky table, can also be stored in be possibly used for constructing visualizing and report
The bottom data of table when determining clock rate parameter column corresponding with data category with data column, can accordingly be examined first
It looks into general purpose table and whether has been stored in the data of the clock rate or data category, if then can be direct when carrying out data displaying
Data are called, if otherwise it needs to be determined that idle parameter column and data column deposit data.
In a kind of embodiment of this specification, it can be obtained corresponding first according to the number of the clock rate
Parameter columns n;According to the number of the data category, corresponding data columns m is obtained;Wherein, n, m are positive integer;Then,
In the default general purpose table of database, the idle n for having created multi-dimensional indexing column are determined as to the ginseng of this building Visual Report Forms
Ordered series of numbers arranges the data that the idle m for not creating multi-dimensional indexing column are determined as this building Visual Report Forms;Finally, by this structure
Several datas for building Visual Report Forms are written identified parameter column and arrange with data.
As previously described, the general purpose table being pre-created can may be several for one, therefore, as an example
Son can be some Visual Report Forms of required building, determine corresponding 1 general purpose table, specifically, can be first in data
In the preset several general purpose tables in library, by any idle general purpose table for meeting preset condition, it is determined as this building Visual Report Forms
Target general purpose table;The preset condition are as follows: the parameter preset columns of target general purpose table is not less than n, and target general purpose table is preset
Data columns is not less than m;Then, the n column parameter column in target general purpose table are determined as to the parameter of this building Visual Report Forms
Column;N column data column in target general purpose table are determined as to the data column of this building Visual Report Forms.
In order to improve the utilization rate of general purpose table, by any idle general purpose table for meeting preset condition, it is determined as this structure
When building the target general purpose table of Visual Report Forms, it can also further compare the numerical relation of n Yu N, m and M, preset condition will be met
Idle general purpose table in, parameter columns and/or the smallest any idle general purpose table of data columns are determined as this building visualization
The target general purpose table of report.
It, can be in addition, generally there are the limitations of dominant record item number for database list table, therefore when general purpose table is pre-created
Multiple N general purpose table identical with M value is created, and this is being constructed determined by several datas write-in of Visual Report Forms
When parameter column are with data column, judge to whether there is idle record strip number in the target general purpose table;If it is not, then pre- in database
If several general purpose tables in, by any idle general purpose table for meeting the preset condition, determine this building Visual Report Forms
Second target general purpose table, the second target general purpose table are used to continue to write to the data of this building Visual Report Forms.
In advance after building Visual Report Forms, when receiving data displaying request, it can be reported according to constructed visualization
The multi-dimensional indexing of table obtains the specified corresponding data of parameter value of request.
S202 shows data obtained according to preset Visual Report Forms model;
Visual Report Forms model specifically, can be preset using table, X-Y scheme, 3-D graphic etc. form exhibition
Show, can also set and be shown in the form of either statically or dynamically, can also carry out setting with regard to lines, color etc., etc., this explanation
Book to preset Visual Report Forms model without limitation.
Below with reference to a more specifically example, the Visual Report Forms method for exhibiting data that this specification provides is carried out
Explanation.
Assuming that user needs based on Visual Report Forms, different provinces and cities not same date is analyzed in certain webpage, in each period
Page browsing amount PV and page user sessions UV.
It is possible, firstly, to construct Visual Report Forms.Determine clock rate be provinces and cities and date, data category be the time, PV with
UV, to determine that corresponding idle 2 column parameters column are arranged with 3 column datas in the default general purpose table of database.Bottom data is write
The column of parameter determined by entering are arranged with data, and are obtained in advance to the 2-d index of 2 column parameters column creation.
Secondly, Visual Report Forms model can be set, graphical format is such as used, the longitudinal axis is quantity, and horizontal axis is time, PV
Curve is using red, and UV curve is using blue, etc..
User can select the parameter value of 2 parameters by the button of click Visual Report Forms displayed page, as provinces and cities select
Beijing, date selection 2018-02-11 are selected, and trigger data shows request.It, can basis after receiving data displaying request
Above-mentioned 2-d index navigates to the corresponding data of above-mentioned parameter value in the bottom data of general purpose table storage.These data are obtained,
And according to above-mentioned preset Visual Report Forms model, data obtained are shown, show that result can be as shown in Figure 1.
As it can be seen that, when needing based on Visual Report Forms analysis data, can be directly based upon and be pre-created using above scheme
General purpose table construct Visual Report Forms, and quickly find data by multi-dimensional indexing and be shown, improve Visual Report Forms
The efficiency that data are shown.
Corresponding to above method embodiment, this specification embodiment also provides a kind of Visual Report Forms data displaying device,
It is shown in Figure 4, the apparatus may include:
Data acquisition module 120, for being reported according to preparatory building visualization in the case where receiving data displaying request
The multi-dimensional indexing of table obtains the data and shows the specified corresponding data of parameter value of request;
Data display module 130, for showing data obtained according to preset Visual Report Forms model;
Described device further includes report building module 110, comprising: classification determines submodule 111, receives for basis
Visual Report Forms building instruction, determines the clock rate and data category for needing to include in the Visual Report Forms constructed;Index obtains
Submodule 112 is taken, in the default general purpose table of database, determining clock rate parameter column corresponding with data category
It is arranged with data, and obtaining is that the parameter arranges the multi-dimensional indexing being pre-created;Wherein, in the general purpose table, each parameter class
Not Dui Ying parameter column, the corresponding data column of each data category, each multi-dimensional indexing is to arrange to create based at least two parameter
The index built.
In a kind of specific embodiment that this specification provides, the index acquisition submodule 112 may include:
Columns determination unit obtains corresponding parameter columns n for the number according to the clock rate;According to described
The number of data category obtains corresponding data columns m;Wherein, n, m are positive integer;
Report column determination unit, for the idle n for having created multi-dimensional indexing being arranged true in the default general purpose table of database
It is set to the parameter column of this building Visual Report Forms, the idle m for not creating multi-dimensional indexing column is determined as this building and are visualized
The data of report arrange;
Data write unit, for by this building Visual Report Forms several datas be written determined by parameter column with
Data column.
In a kind of specific embodiment that this specification provides, the report column determination unit may include:
General purpose table determines subelement, in the preset several general purpose tables of database, by any preset condition that meets
Idle general purpose table is determined as the target general purpose table of this building Visual Report Forms;The preset condition are as follows: target general purpose table it is pre-
Setting parameter columns is not less than n, and the preset data columns of target general purpose table is not less than m;
Report, which arranges, determines subelement, for the n column parameter column in target general purpose table to be determined as this building visualization report
The parameter of table arranges;N column data column in target general purpose table are determined as to the data column of this building Visual Report Forms.
In a kind of specific embodiment that this specification provides, the data write unit specifically can be used for:
Judge to whether there is idle record strip number in the target general purpose table;If it is not, then preset several in database
In general purpose table, by any idle general purpose table for meeting the preset condition, the second target of this building Visual Report Forms is determined
General purpose table, the second target general purpose table are used to continue to write to the data of this building Visual Report Forms.
In a kind of specific embodiment that this specification provides, the general purpose table determines subelement, specifically can be used for:
By in the idle general purpose table for meeting preset condition, parameter columns and/or data columns the smallest any free time are general
Table is determined as the target general purpose table of this building Visual Report Forms.
The function of modules and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
This specification embodiment also provides a kind of computer equipment, includes at least memory, processor and is stored in
On reservoir and the computer program that can run on a processor, wherein processor is realized above-mentioned visual when executing described program
Change report data methods of exhibiting.This method includes at least:
In the case where receiving data displaying request, according to the multi-dimensional indexing of preparatory building Visual Report Forms, it is somebody's turn to do
Data show the specified corresponding data of parameter value of request;
According to preset Visual Report Forms model, data obtained are shown;
Wherein, the method for constructing Visual Report Forms includes: to determine and need according to the Visual Report Forms building instruction received
The clock rate and data category for including in the Visual Report Forms of building;In the default general purpose table of database, the ginseng is determined
Several classes of parameter column not corresponding with data category are arranged with data, and obtaining is that the parameter arranges the multi-dimensional indexing being pre-created;Its
In, in the general purpose table, the corresponding parameter column of each clock rate, the corresponding data column of each data category, each
Multi-dimensional indexing is the index based on the column creation of at least two parameter.
Fig. 5 shows one kind provided by this specification embodiment and more specifically calculates device hardware structural schematic diagram,
The equipment may include: processor 1010, memory 1020, input/output interface 1030, communication interface 1040 and bus
1050.Wherein processor 1010, memory 1020, input/output interface 1030 and communication interface 1040 are real by bus 1050
The now communication connection inside equipment each other.
Processor 1010 can use general CPU (Central Processing Unit, central processing unit), micro- place
Reason device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one
Or the modes such as multiple integrated circuits are realized, for executing relative program, to realize technical side provided by this specification embodiment
Case.
Memory 1020 can use ROM (Read Only Memory, read-only memory), RAM (Random Access
Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 1020 can store
Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware
When, relevant program code is stored in memory 1020, and execution is called by processor 1010.
Input/output interface 1030 is for connecting input/output module, to realize information input and output.Input and output/
Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein
Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,
Loudspeaker, vibrator, indicator light etc..
Communication interface 1040 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment
Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly
(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 1050 include an access, equipment various components (such as processor 1010, memory 1020, input/it is defeated
Outgoing interface 1030 and communication interface 1040) between transmit information.
It should be noted that although above equipment illustrates only processor 1010, memory 1020, input/output interface
1030, communication interface 1040 and bus 1050, but in the specific implementation process, which can also include realizing normal fortune
Other assemblies necessary to row.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising real in above equipment
Component necessary to existing this specification example scheme, without including all components shown in figure.
This specification embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
Visual Report Forms method for exhibiting data above-mentioned is realized when sequence is executed by processor.This method includes at least:
In the case where receiving data displaying request, according to the multi-dimensional indexing of preparatory building Visual Report Forms, it is somebody's turn to do
Data show the specified corresponding data of parameter value of request;
According to preset Visual Report Forms model, data obtained are shown;
Wherein, the method for constructing Visual Report Forms includes: to determine and need according to the Visual Report Forms building instruction received
The clock rate and data category for including in the Visual Report Forms of building;In the default general purpose table of database, the ginseng is determined
Several classes of parameter column not corresponding with data category are arranged with data, and obtaining is that the parameter arranges the multi-dimensional indexing being pre-created;Its
In, in the general purpose table, the corresponding parameter column of each clock rate, the corresponding data column of each data category, each
Multi-dimensional indexing is the index based on the column creation of at least two parameter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification
Embodiment can be realized by means of software and necessary general hardware platform.Based on this understanding, this specification is implemented
Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words,
The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are to make
It is each to obtain computer equipment (can be personal computer, server or the network equipment etc.) execution this specification embodiment
Method described in certain parts of a embodiment or embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.The apparatus embodiments described above are merely exemplary, wherein described be used as separate part description
Module may or may not be physically separated, can be each module when implementing this specification example scheme
Function realize in the same or multiple software and or hardware.Can also select according to the actual needs part therein or
Person's whole module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not the case where making the creative labor
Under, it can it understands and implements.
The above is only the specific embodiment of this specification embodiment, it is noted that for the general of the art
For logical technical staff, under the premise of not departing from this specification embodiment principle, several improvements and modifications can also be made, this
A little improvements and modifications also should be regarded as the protection scope of this specification embodiment.