Summary of the invention
The object of the invention is to overcome deficiency of the prior art, the invention provides a kind of automatic detection data variation and follow the apparatus and method of data variation automatically, can initiatively not change under the situation of source data scope the user, allow the function that realized follow the data area of variation (increase or reduce) automatically.
In order to solve the problems of the technologies described above, be achieved through the following technical solutions: a kind of automatic detection and follow the device of data variation, it comprises data equipment and performance equipment, it is characterized in that, described data equipment comprises:
Data editing module, it is used for the operation such as input, deletion of deal with data;
Data memory module, it is used to describe the position of the content and the data of record data;
Data detection module, it is used for the variation of supervising data storage module, and is responsible for notifying following border control module;
Border control module, notice performance equipment is responsible on the border that is used to write down, check and revise data equipment after revise on the border;
Described performance equipment is the carrier of information, and information intuitively is provided, in order to the data in the data equipment are shown by performance equipment.
The present invention also discloses a kind of automatic detection and follows the method for data variation, and it comprises following process:
1, operations such as the input of data editing module deal with data, deletion, and these information are passed to data memory module;
2, the operated data message of data memory module record data editor module;
3, data detection module detects data message whether variation has taken place, if change, then gives border control module with change notification, and carry out step 4, if do not change then forward step 6 to;
4, after border control module is received the notice of data detection module, check whether data variation occurs on the border of data equipment, if, the data that border control module writes down according to data memory module are searched a scope that data are arranged of the maximum adjacent with initial boundary, then the border of the border of the new range that obtains as data equipment; If not, execution in step 6;
5, border control module notice performance equipment border situation of change, performance equipment be according to the shown information of automatically updating data after upgrading in the border control module, and the variation of data equipment is initiatively shown;
6, finish.
The principal feature of apparatus of the present invention and method is that existing source data changes the appointment that depends on the user, and the variation of source data in the present invention can trigger by software self.The problem that the present invention solves safeguards that with manual the mapping relations of " performance equipment " and " data equipment " become automatic maintenance exactly.It does not need to reset the source data of quoting and just can automatically data variation be displayed.So for the user, simplified extensive work, especially under some source datas need regularly more news.
Embodiment
A kind of automatic detection of the present invention and the device of following data variation comprise performance equipment and data equipment.
Performance equipment is the carrier of information, and it provides information (for example chart) intuitively to the people; In order to the data in the data equipment are shown by performance equipment.
Data equipment is the source of information, it is the data set provider of performance equipment, it can be the two dimension also can be three-dimensional (two dimension be meant that data are in same table, three-dimensional is meant that data are in a plurality of tables), and it has the notion on " scope " and " border ", it has occupied the certain physical position, for example the cell zone in the form software.
Introduce the relation between data equipment and the performance equipment below for example:
1) referring to Fig. 1, in electrical form, the content of cell B1 is formula "=SUM (A1:A3) ", and there is numeral A1:A3 the inside, cell zone.So, the formula in the cell B1 shows equipment exactly, and cell zone A1:A3 is exactly a data equipment.
2) referring to Fig. 2, in electrical form, a chart precedents zone A1:A3 is arranged, chart shows equipment exactly so, and regional A1:A3 is exactly a data equipment.
3) referring to Fig. 3, in the electrical form, have a PivotTables with cell zone A1:C4 as data source, PivotTables shows equipment exactly so, regional A1:C4 is exactly a data equipment.Correspondingly, pivot chart is the graphic form of PivotTables based on PivotTables, thereby pivot chart also can be used as performance equipment.
The zone of data equipment data selected generally is a regular domain, that is to say it must is monolithic zone or regular multi-disc zone (strict alignment between the subregion).That is to say, be a rectangular area under the situation of two dimension, is a cube zone under the three-dimensional situation.
Around the former data in the scope from no datat to data being arranged or, just can causing the variation on data equipment border from data being arranged in no datat.Elicitation procedure is caused by editing operation.At this time its can self-verifying original source data next-door neighbour around the row or column of data is arranged, till finding a sky, again with new zone as source data.Performance equipment will comprise the data updated scope like this.
Data equipment comprises with lower module:
Data editing module is used for the operation such as input, deletion of deal with data;
Data memory module is used to describe record data, comprises the position of the content and the data of data, but is not limited to above-mentioned data message;
For instance, in form software, a numeral 1 is arranged in the cell A1, data memory module can write down content (numeral 1) and position (A1) of this cell so;
Data detection module is used for the variation of supervising data storage module, and responsible notice need obtain the module (as border control module) of monitoring message;
Border control module, notice performance equipment is responsible on the border that is used to write down, check and revise data equipment after revise on the border.
Especially, data detection module and border control module can be in same higher level's module.
Introduce the workflow of the inventive method below in conjunction with accompanying drawing 4:
1. (under original state, data equipment necessarily has a border, is called initial boundary under the original state.And data equipment necessarily has scope), the work beginning;
2. data editing module is carried out an editing operation instruction, accepts editor's data message, and information is passed to data memory module;
3. the operated new data message of data memory module record data editor module;
4. whether the information in the data detection module detection data memory module changes, if, carry out step 5, if not, then jump to step 7;
5. after border control module is received the notice of data detection module, check whether data variation occurs on the border of data equipment, if, the data that border control module writes down according to data memory module are searched a scope that data are arranged of the maximum adjacent with initial boundary, then the border of the border of the new range that obtains as data equipment; Otherwise keep initial boundary constant, jump to step 7;
6. border control module notice performance equipment border situation of change, performance equipment be according to the shown information of automatically updating data after upgrading in the border control module, and the variation of data equipment is initiatively shown;
7. end-of-job.
The detected activity of data detection module can be active or passive.The meaning of active detecting is exactly whether the data detection module information in the Monitoring Data memory module of initiatively going changes, at any time the state of data query memory module.And passive detection just is meant that an editing operation of carrying out by data editing module causes that the data memory module recorded content changes, thereby the trigger data detection module monitors this variation.
On the dialog box of performance dialog box of equipment and data equipment, can provide an option, allow the user specify and whether the range of source data is appointed as automatically.
As follows to this option regulation:
<I〉when creating performance equipment, be the zone that meets automatic source data if detect the cell zone of user's selection, provide this option in the first step of creating guide so;
<II〉when using the dialog box of data equipment,, provide this option so if detect the requirement that meets automatic source data.
Usually, can be chosen as automated manner acquiescently.
Further specify the inventive method below by an exemplary embodiments.
With WPS Office form is example, as shown in Figure 5, a data equipment T is arranged, and its scope is A1:C3, and its border comprises A4:D4 and D1:D3.The form of tentation data memory module record cell lattice is Cell=<position, data 〉, suppose that empty data are remembered into nil, the form of regional record is the set of Cell, the form of data memory module posting field A1:D4 is so:
{<A1,1>,<A2,1>,<A3,1>,<A4,nil>,
<B1,1>,<B2,1>,<B3,1>,<B4,nil>,
<C1,1>,<C2,1>,<C3,1>,<C4,nil>,
<D1,nil>,<D2,nil>,<D3,nil>,<D4,nil>}
(1) under the original state, the border of T is { A1:A4 U D1:D3}
(2) as shown in Figure 6, the tentation data load module accepted the input data 2,2,2}, and the input data pass to data memory module.
(3) data memory module record new data, record is being described below of regional A1:D4 afterwards:
{<A1,1>,<A2,1>,<A3,1>,<A4,nil>,
<B1,1>,<B2,1>,<B3,1>,<B4,nil>,
<C1,1>,<C2,1>,<C3,1>,<C4,nil>,
<D1,2>,<D2,2>,<D3,2>,<D4,nil>}
Meanwhile, data detection module monitors data memory module variation has taken place.
(4) data detection module notice border control module, the notified back of border control module check the border data on the A1:A4 U D1:D3} whether with original state under consistent, under this routine situation, this moment data boundary and original state under inconsistent, that is to say that variation has taken place data boundary, has increased new data.So the Boundary Detection module comprises into these new datas by the change scope.Thereby the new range of data equipment becomes A1:C4, and new border becomes { A5:D5 U D1:D4}.Do not embody performance equipment in this example,, so, after data equipment changes this variation is reflected on the performance equipment automatically if add performance equipment in this example.
Below explain in detail some terms among the present invention:
Data memory module is used for record and manages the table an of three-dimensional (or two dimension), and this table is referred to as the data summary table.The data summary table is made up of several layers, and each layer all is a bivariate table, and this bivariate table is made up of several rows and some row, and the infall of a certain particular row and a certain particular column is referred to as data cell.Especially, when the number of plies was 1, the data summary table just deteriorated to a bivariate table.
Suppose U representative data unit, data cell can be expressed as<r so, c, d 〉, wherein r represent the row number, c represent row number, d represents level number.
Data cell includes but is not limited to describe the attribute of position and describes the attribute of the value that it comprises.These two attributes are represented with P and V respectively.The position of data of description unit and value can be with (P V) represents.
Suppose T representative data summary table, the data summary table can be expressed as the set of data cell so, promptly
T={Ui|i=1,2,3,……}
Continuous data cell (rectangle or cube that one or more data cell forms) is referred to as the data area, and the data area is the subclass of data summary table.
Suppose that R represents the data area, so R={t|t ε T}.
For convenience of description, we can be designated as (Ua with the data area, Ub, Uc), wherein Ua represents the data cell position at the place, the upper left corner of data area ground floor, Ub represents the data cell position at the place, the lower right corner of data area ground floor, and Uc represents the data cell position at the place, the lower right corner of the last one deck in data area.
It is benchmark that the border, data area refers to the data area, it capable dimension and the row dimension on increase simultaneously a formed data area of unit with it capable dimension and the row dimension on reduce the difference set of a formed data area of unit simultaneously.The tentation data zone boundary represents that with B the tentation data region R is (<r1, c1, d1,<r2, c2, d2,<r3, c3, d3) B=(<r so1+ 1, c1+ 1, d1,<r2+ 1, c2+ 1, d2,<r3+ 1, c3+ 1, d3)-(<r1-1, c1-1, d1,<r2-1, c2-1, d2,<r3-1, c3-1, d3)
" scope " of " data equipment " of our indication is exactly by the formed set in one or more data areas.Suppose that this scope represents with S, so S={r|r ε R}.
" border " of " data equipment " refers to the union on border, data area of each element (data area) of S.
That is to say, suppose S={s1, s2 ..., sn} supposes that " border " of " data equipment " represented with Q, so:
Each element si of S is a data zone, supposes that the border, data area of this data area is bi, Q={b1 so, and b2 ..., bn}.
Above example is the unrestricted technical scheme of the present invention in order to explanation only.Any modification or partial replacement that does not break away from spirit and scope of the invention all should be encompassed in the middle of the claim scope of the present invention.