A kind of data access method of electronic government affairs system trace
Technical field
The present invention relates to data access fields, and in particular to a kind of data access method of electronic government affairs system trace.
Background technique
As information-based is popularized, information system be will be used wider and wider.In some special application fields, need
Information system can save the historic state of some important object dynamic changing processes, to inquire when needed..
Preservation for dynamic data historic state, general method are to establish snapshot.It, will be right when Obj State changes
A copy is established in the total data duplication of elephant, and records related status information, when needed, going through for object is obtained from copy
History state.This method will establish a copy when changing Obj State, need to occupy a large amount of memory space.For section
About memory space can use incremental backup and data compression process when establishing snapshot.But either incremental backup or data
Compression, access procedure require to increase a large amount of calculating, and essence exchanges space for the time, and access performance is bad, especially exists
In Large Information Systems, the method for establishing snapshot is difficult to meet the performance requirement of system.
Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of numbers of electronic government affairs system trace
According to access method, using less memory space, and there is preferable access performance.
To achieve the above object, The technical solution adopted by the invention is as follows:
A kind of data access method of electronic government affairs system trace, comprising:
S1, classified according to the correlation between object properties to the object in electronic government affairs system, every one kind is right
The attribute of elephant is described with one group of list, wherein each list records a part of attribute of the class object, every in list
One records a state of a corresponding object, and the object is one group of some things in the description electronic government affairs system
Data;
S2, object properties table is established according to the state of object in the electronic government affairs system, the object properties table includes:
Current state table, historic state table and transitory state table;
S3, the access instruction inputted according to user are to the current state table, the historic state table or the interim shape
Data in state table are accessed.
Further, a kind of data access method of electronic government affairs system trace as described above, step S3 include:
S31, increase object is carried out to the data in the current state table according to the first access instruction of user's input, is belonged to
Sexually revise and delete object;
S32, increase object is carried out to the data in the historic state table according to the second access instruction of user's input, is belonged to
Sexually revise and delete object;
After S33, each object variation changed in the electronic government affairs system are complete, by it in the transitory state
Corresponding record deletion in table.
Further, a kind of data access method of electronic government affairs system trace as described above, step S1 further include:
When the number of attributes of object is lower than preset value, all properties of the object are defined in a list.
Further, a kind of data access method of electronic government affairs system trace as described above, the current state table are used
In the attribute value of conservation object current state, in the electronic government affairs system there is currently each object have uniquely
One record it is corresponding, the corresponding one group of current state table of the class object jointly determine object current state.
Further, a kind of data access method of electronic government affairs system trace as described above in step S2, is established current
State table, comprising:
The time for being updated or being established come the part attribute status of description object with a field;
It is another to update or establish corresponding event come the part attribute status of description object with a field.
Further, a kind of data access method of electronic government affairs system trace as described above, step S31 include:
When first access instruction is to increase a new object, it is right that each attribute value of new object is inserted into such
As in corresponding each current state table;
It is when first access instruction is to change certain attributes of certain an object, these attributes are corresponding each current
Record corresponding to the object is updated to the attribute value after changing in state table;
When first access instruction is to delete an object, will be somebody's turn to do in the corresponding each current state table of the class object
Record corresponding to object is all deleted.
Further, a kind of data access method of electronic government affairs system trace as described above, the historic state table are used
In the attribute value of each historic state of conservation object, for once each of existing each object in the electronic government affairs system
State has one to record corresponding, and one records the multiple states an of object of may also corresponding to.
Further, a kind of data access method of electronic government affairs system trace as described above in step S2, establishes history
State table, comprising:
With a field come the state change type of description object, including newly-increased object, attribute change and delete object;
The another time for being updated or being established come the part attribute status of description object with a field;
It is another to update or establish corresponding event come the part attribute status of description object with a field.
Further, a kind of data access method of electronic government affairs system trace as described above, step S32 include:
It is each in the corresponding each historic state table of the object when second access instruction is to increase a new object
It is inserted into a new record, and labeled as newly-increased;
It is corresponding each in each attribute of change when second access instruction is to change certain attributes of certain an object
Respectively be inserted into a new record in a historic state table, record change after attribute value, and labeled as changing, no attribute change it is each
A historic state table does not update;
It is each in the corresponding each historic state table of the object to insert when second access instruction is to delete an object
Enter a new record, and labeled as deletion.
Further, a kind of data access method of electronic government affairs system trace as described above, the transitory state table are used
The attribute changed is temporarily saved during one-shot change in object;
It further include attachment in the electronic government affairs system, for the data file of a certain attribute of description object, the attachment
It is stored in storage equipment with the compressed format of data file, storage location and file name are stored in corresponding object properties
In table.
The beneficial effects of the present invention are: method provided by the present invention can save in electronic government affairs system and dynamically become
The historic state of the object of change using less memory space, and has to realize the trace and retrieval of system dynamic data
There is preferable access performance.
Detailed description of the invention
Fig. 1 is a kind of process signal of the data access method of the electronic government affairs system trace provided in the embodiment of the present invention
Figure.
Specific embodiment
The present invention is described in further detail with specific embodiment with reference to the accompanying drawings of the specification.
As shown in Figure 1, a kind of data access method of electronic government affairs system trace, comprising:
S1, classified according to the correlation between object properties to the object in electronic government affairs system, every one kind is right
The attribute of elephant is described with one group of list, wherein each list records a part of attribute of the class object, every in list
One records a state of a corresponding object, and object is one group of data for describing some things in electronic government affairs system;
S2, object properties table is established according to the state of object in electronic government affairs system, object properties table includes: current state
Table, historic state table and transitory state table;
S3, the access instruction inputted according to user are to the data in current state table, historic state table or transitory state table
It is accessed.
Step S3 includes:
S31, according to user input the first access instruction increase object is carried out to the data in current state table, attribute changes
Become and delete object;
S32, according to user input the second access instruction increase object is carried out to the data in historic state table, attribute changes
Become and delete object;
After S33, each object variation changed in electronic government affairs system are complete, it is corresponded in transitory state table
Record deletion.
Step S1 further include:
When the number of attributes of object is lower than preset value, all properties of the object are defined in a list.
Current state table be used for conservation object current state attribute value, in electronic government affairs system there is currently it is every
A object has unique one to record corresponding, and the class object corresponding one group of current state table determines that object is worked as jointly
Preceding state.
In step S2, current state table is established, comprising:
The time for being updated or being established come the part attribute status of description object with a field;
It is another to update or establish corresponding event come the part attribute status of description object with a field.
Step S31 includes:
When the first access instruction is to increase a new object, each attribute value of new object is inserted into the class object pair
In each current state table answered;
When the first access instruction is to change certain attributes of certain an object, by the corresponding each current state of these attributes
Record corresponding to the object is updated to the attribute value after changing in table;
When the first access instruction is to delete an object, by the object in the corresponding each current state table of the class object
Corresponding record is all deleted.
Historic state table is used for the attribute value of each historic state of conservation object, for once existing in electronic government affairs system
Each state of each object there is one to record corresponding, one records and may also correspond to multiple shapes an of object
State.
In step S2, historic state table is established, comprising:
With a field come the state change type of description object, including newly-increased object, attribute change and delete object;
The another time for being updated or being established come the part attribute status of description object with a field;
It is another to update or establish corresponding event come the part attribute status of description object with a field.
Step S32 includes:
When the second access instruction is to increase a new object, respectively it is inserted into the corresponding each historic state table of the object
One new record, and labeled as newly-increased;
When the second access instruction is to change certain attributes of certain an object, each go through each attribute of change is corresponding
It is respectively inserted into a new record, the attribute value after record change in history state table, and is labeled as changing, each of no attribute change goes through
History state table does not update;
When the second access instruction is to delete an object, one is respectively inserted into the corresponding each historic state table of the object
New record, and labeled as deleting.
Transitory state table is for temporarily saving the attribute changed during the one-shot change of object;
It further include attachment in electronic government affairs system, for the data file of a certain attribute of description object, attachment is with data text
The compressed format of part is stored in storage equipment, and storage location and file name are stored in corresponding object properties table.
Embodiment one
By taking a class object as an example, explains one by one and increase object, change object, delete object and obtain the specific of Obj State
Process.
As shown in table 1, every attribute of object is divided into several set of properties such as set of properties A, set of properties B, set of properties C,
Wherein set of properties A includes the attributes such as attribute A1, attribute A2, attribute A3;Set of properties B includes that attribute B1, attribute B2, attribute B3 etc. belong to
Property;Set of properties C includes the attributes such as attribute C1, attribute C2, attribute C3.Every attribute of object can be numerical value, text, the time,
Any types such as symbol, table shape, expert data.
Set of properties A corresponds to three current state Table A, historic state Table A, transitory state Table A object properties tables;Set of properties B
Corresponding current state table B, tri- historic state table B, transitory state table B object properties tables;Set of properties C correspond to current state table C,
Tri- historic state table C, transitory state table C object properties tables.
The original state of each object attribute list is sky in the present embodiment.The corresponding current state table of set of properties A, B, C
Original state as shown in table 2, table 3, table 4;The original state of the corresponding historic state table of set of properties A, B, C such as table 5, table 6, table
Shown in 7;The original state of the corresponding transitory state table of set of properties A, B, C is as shown in table 8, table 9, table 10.
1 Structure of object attribute of table
The current state table original state of 2 set of properties A of table
The current state table original state of 3 set of properties B of table
The current state table original state of 4 set of properties C of table
The historic state table original state of 5 set of properties A of table
The historic state table original state of 6 set of properties B of table
The historic state table original state of 7 set of properties C of table
The transitory state table original state of 8 set of properties A of table
The transitory state table original state of 9 set of properties B of table
The transitory state table original state of 10 set of properties C of table
When increasing a new object in the present embodiment, one is respectively first inserted into the corresponding historic state table of each set of properties
Each attribute value is saved in new record by new record, the change type field of new record is set as " increasing newly ", then in each category
It is respectively inserted into a new record in the property corresponding current state table of group, each attribute value is saved in new record.
Optionally, when not using current state table, ignore the above-mentioned operation in relation to current state table.
After increasing by three objects 01,02,03 in the present embodiment, the corresponding each object attribute table status of each set of properties is such as
Under:
The state of the corresponding current state table of set of properties A, B, C is as shown in table 11, table 12, table 13;Set of properties A, B, C are corresponding
Historic state table state as shown in table 14, table 15, table 16;The state of the corresponding transitory state table of set of properties A, B, C is constant,
As shown in table 8, table 9, table 10.
Renewal time of the same target newly increased in the corresponding current state table of each set of properties and historic state table,
Update event is identical.
Table 11 increases the current state Table A after object
Table 12 increases the current state table B after object
Table 13 increases the current state table C after three objects
Table 14 increases the historic state Table A after object
Table 15 increases the historic state table B after object
Table 16 increases the historic state table C after object
When changing an attribute of an object in the present embodiment, the corresponding interim shape of elder generation's set of properties belonging to the attribute
State table searches whether the corresponding record of the existing object, and if it does not exist, then the set of properties belonging to the attribute is corresponding current
The corresponding record of the object is found out in state table, is inserted into transitory state table, then arrives the attribute value update after change
In transitory state table in record corresponding to the object.
When changing the multinomial attribute of an object in the present embodiment, according to the method described above gradually more by the attribute value after change
Newly into transitory state table on record corresponding to the object, it can be updated simultaneously when changing simultaneously the multinomial attribute in same set of properties
Into transitory state table on record corresponding to the object.
It is recorded what Obj State changed finally, finding out the corresponding each item of the object in each transitory state table, by it
It is inserted into corresponding each historic state table one by one, corresponding renewal time and update event are saved in the corresponding word of new record
Section, the change type field of new record is set as " changing ", then these records are updated into corresponding each current state table
On the corresponding record of the object, finally the corresponding record of the object in each transitory state table is all deleted.
Optionally, when not using transitory state table, ignore the above-mentioned processing to transitory state table, by the attribute after change
Value is inserted directly into historic state table and current state table.
Optionally, when not using current state table, ignore the above-mentioned operation to current state table, be changed to from historic state
The record of object end-state is obtained in table.
During Obj State changes, such as to cancel change, then by the corresponding note of the object in each transitory state table
Record is all deleted.
Change the state of 01,02 two object in the present embodiment, wherein the attribute A1 of object 01 is changed to 01A12, object O2
Attribute B1 be changed to 02B12, the corresponding each object attribute table status of set of properties is as follows during change and after changing:
During change, the state of the corresponding transitory state table of set of properties A is as shown in table 17;Set of properties B is corresponding to be faced
When state table state it is as shown in table 18;The corresponding transitory state table of set of properties C is constant, as shown in table 10.
After the change, the corresponding current state table of set of properties A is as shown in table 19;The corresponding current state table of set of properties B
As shown in table 20;The corresponding current state table of set of properties C is constant, as shown in table 13;The corresponding historic state table such as table of set of properties A
Shown in 21;The corresponding historic state table of set of properties B is as shown in table 22;The corresponding historic state table of set of properties C is constant, such as 16 institute of table
Show;The corresponding transitory state table of set of properties A, B, C is sky, as shown in table 8, table 9, table 10.
Transitory state Table A during the change of 17 object of table
Transitory state table B during the change of 18 object of table
Current state Table A after the change of 19 object of table
Current state table B after the change of 20 object of table
Historic state Table A after the change of 21 object of table
Historic state table B after the change of 22 object of table
When deleting an object in the present embodiment, one is first respectively inserted into the corresponding historic state table of each set of properties newly
Record, every attribute value are sky, the change type field of new record are set as " deleting ", then search in each current state table
The corresponding record of the object, and be deleted.
Optionally, when not using current state table, ignore the above-mentioned operation to current state table.
After deleting object 03 in the present embodiment, the corresponding each object attribute table status of each set of properties is as follows:
The state of the corresponding current state table of set of properties A, B, C is as shown in table 23, table 24, table 25;Set of properties A, B, C are corresponding
Historic state table state as shown in table 26, table 27, table 28;The corresponding transitory state table of set of properties A, B, C be sky, as table 8,
Shown in table 9, table 10.
Table 23 deletes the current state Table A after object
Table 24 deletes the current state table B after object
Table 25 deletes the current state table C after object
Table 26 deletes the historic state Table A after object
Table 27 deletes the historic state table B after object
Table 28 deletes the historic state table C after object
In the present embodiment, attachment is stored in storage equipment with document form data, and one of each attachment corresponding objects
Attribute, attribute value are the storage location and filename of attachment.When changing attachment, using the number new as one of the attachment after change
It is saved according to file, changes corresponding category according to such as preceding method using the storage location of new file and filename as new attribute value
Property;The attachment that object of reservation is included when deleting object.
When obtaining the current state of an object in the present embodiment, it is only necessary to which by each current state table connection and locating, this is right
As corresponding record.As long as if obtaining the part attribute of object, it is only necessary to look into the connection of current state table belonging to these attributes
It looks for.
It optionally, can be by the corresponding note of each historic state table connection and locating object when not using current state table
Record, wherein renewal time is the current state of object the latest.
When obtaining the historic state of an object in the present embodiment, according to given constraint condition by each historic state table
The corresponding record of the connection and locating object.Such as obtain object 0 in time T1 to the situation of change between time T2, it can will be each
A historic state table connection, qualifications time are greater than T1 and are less than whole records that T2 searches object 0.As long as if obtaining object
Part attribute, it is only necessary to by historic state table connection and locating belonging to these attributes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technology
Within, then the present invention is also intended to include these modifications and variations.