The online synergic editing method of power network multitask
Technical field
The present invention relates to electric network information communication technical field, more particularly to a kind of online collaborative editing side of power network multitask
Method.
Background technology
In order to effectively support units at different levels and department comprehensively to effective management of power network resources information, it is necessary to build covering state
Family's grid company, provincial company, prefecture-level company's power network resources maintenance applications at different levels.In infrastructure project, technological transformation overhaul engineering, Yong Hugong
After the completion of the engineerings such as journey, O&M maintainer will update related equipment figure and machine account information to dispatcher, realize power network
The figure of installations and facilities, topology, the board service of Unit account of plant, realize full company's power network horizontal and vertical " throws the net ".
O&M maintainer needs to safeguard all devices information of O&M maintenance portion's operation management, realizes that Unit account of plant is mutual with assets
Connection, supports assets life-cycle management, realizes that power network and customer information are interconnected, support breakdown repair, line loss become more meticulous etc. it is comprehensive should
With.
Existing version way to manage is most based on unit and task isolation method, i.e. client downloads portion whole network data
In the local database, user carries out graphics edition on local data basis for storage, after the completion of local editor, is submitting to
Link write into Databasce after complicated edition data merges.In this manner, with the growth of electric network data, local text
Part is excessive and cause data query performance more and more lower, graphic panning performance Caton phenomenon is serious, in multitask submission, data
Merge that link is excessively complicated, the data for frequently resulting in submission can just see at second day, and task is entirely isolated, it is impossible to real
Existing multi-person synergy editor, displaying and issue, reduce operating efficiency.
In the Chinese patent open file of Publication No. CN104717239A, it is proposed that a kind of collaboration of shared file is compiled
Method, server and user terminal are collected, methods described includes:Originated according to shared file, be that multiple user terminal distribution are literary to sharing
The editing authority of part;Set up a stack table;Shared file editor's information of the multiple user terminal is obtained, by the shared file
Editor's information is stored in the stack table one by one.But in the program, for other users end, only part editing authority,
Edlin cannot be entered to the total data of shared file, there is limitation.
The content of the invention
The technical problems to be solved by the invention are:A kind of online synergic editing method of power network multitask is provided, is capable of achieving
The Real-Time Sharing of edited result.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention is:A kind of power network multitask cooperates with volume online
The method of collecting, including:
Creation state numbered sequence, the sequential value in the status number sequence sorts successively from small to large;
According to editor's task, edit operation is carried out to base version table;
If the edit operation is carried out in the case where state is edited, the data of editor recorded corresponding with base version table
In version table, and record the corresponding start context of editor's task and the corresponding editor's mark of the edit operation;
According to the time tandem of edit operation, the sequential value that will successively be taken out in edit operation and status number sequence
It is associated, and by the sequential value write-in version table;
The sequential value and the base edited version table numbering are associated, and write version change table;
According to the version change table, judge whether base version table changes;
If changing, according to the corresponding version table of base version table, correspondence updates the base version table;
Meanwhile, update described operation and be associated with next sequential value of status number sequence, and by next sequence
In train value write-in base version table;
Next sequential value and the base of renewal version table numbering are associated, and write base version list of modification;
Issue the base version table.
The beneficial effects of the present invention are:When edit operation is carried out, by sequentially taking out sequence from status number sequence
Train value is associated with edit operation, because the sequential value in status number sequence sorts from small to large, therefore can earth's surface directly perceived
The order of each edit operation is shown;By setting version change table, can judge whether base version table becomes by sequential value
More, can also be numbered by base corresponding with sequential value version table and obtain the base for changing version table, further according to what is recorded in version table
Modification information, correspondence updates base version table, so as to realize that multiple client is based on different editor's tasks to similar and different base
Version table carries out collaborative editing.
Brief description of the drawings
Fig. 1 is a kind of flow chart of the online synergic editing method of multitask of the invention;
Fig. 2 is the method flow diagram of the embodiment of the present invention one;
The flow chart of the step of Fig. 3 is the embodiment of the present invention two S6.
Specific embodiment
It is to describe technology contents of the invention, the objects and the effects in detail, below in conjunction with implementation method and coordinates attached
Figure is explained in detail.
The design of most critical of the present invention is:The order of edit operation is represented by the sequential value of status number sequence, and
All tasks share a status number sequence, when edlin is entered, it can be seen that the real-time results of other tasks editor.
Refer to Fig. 1, a kind of online synergic editing method of power network multitask, including:
Creation state numbered sequence, the sequential value in the status number sequence sorts successively from small to large;
According to editor's task, edit operation is carried out to base version table;
If the edit operation is carried out in the case where state is edited, the data of editor recorded corresponding with base version table
In version table, and record the corresponding start context of editor's task and the corresponding editor's mark of the edit operation;
According to the time tandem of edit operation, the sequential value that will successively be taken out in edit operation and status number sequence
It is associated, and by the sequential value write-in version table;
The sequential value and the base edited version table numbering are associated, and write version change table;
According to the version change table, judge whether base version table changes;
If changing, according to the corresponding version table of base version table, correspondence updates the base version table;
Meanwhile, update described operation and be associated with next sequential value of status number sequence, and by next sequence
In train value write-in base version table;
Next sequential value and the base of renewal version table numbering are associated, and write base version list of modification;
Issue the base version table.
Knowable to foregoing description, the beneficial effects of the present invention are:Edlin is entered to base version table in the case where state is edited, not directly
Data to base version table enter edlin, but in first recorded version table, when version to be carried out is issued just by version table
Data correspondence is updated in base version table.
Further, after described " according to editor's task, edit operation being carried out to base version table ", further include:
If the edit operation is carried out under run mode, the base version table is updated according to the edit operation, and remember
Record the corresponding start context of editor's task;
According to the time tandem of edit operation, the sequential value that will successively be taken out in edit operation and status number sequence
It is associated, and by the sequential value write-in base version table;
The sequential value and the base edited version table numbering are associated, and write base version list of modification.
Seen from the above description, edlin is entered to base version table under run mode, then real-time update base version table, is not related to version
Table.
Further, described " according to the version change table, judging whether base version table changes " is specially:
Obtain the sequential value of maximum in version change table;
Obtain the sequential value of maximum in all base version tables and version table;
Judge whether two maximum sequential values are consistent;
If inconsistent, according to version change table, the sequential value correspondence between two maximum sequential values is obtained
Base version table numbering;
Judge the corresponding base version table numbering whether comprising base version table numbering;
If comprising judging that base version table is changed.
Seen from the above description, by representing the sequential value of the time tandem of edit operation, it is right intuitively to represent
Whether each data enters the order of edlin, can easily learn relative to a time point, have into edlin afterwards, from
And judge whether to change.
It is further, described that " if changing, according to the corresponding version table of base version table, correspondence updates described
One base version table " is specially:
If the corresponding editor of a data is designated default newly-increased Data Identification in the corresponding version table of base version table,
During a data then are increased into base version table, and corresponding start context is set in base version table default
Initial number;
If the corresponding editor of a data is designated default modification Data Identification in the corresponding version table of base version table,
An original data then are searched in base version table, the data syn-chronization after being edited in the version table
Into base version table, and corresponding start context is set to default initial number in base version table;
If the corresponding editor of a data is designated default deletion base version data in the corresponding version table of base version table
Mark, then delete a data in base version table.
Seen from the above description, it is updated in the way of incremental data, only retains last edited result, without considers
Editing process.
It is further, described that " if changing, according to the corresponding version table of base version table, correspondence updates described
After one base version table ", further include:
Delete the data in the corresponding version table.
Seen from the above description, the data that will be updated are deleted from version table in time, so as to ensure to have sent out
The colophon of cloth can be deleted from version caching in time.
Further, before described " according to editor's task, edit operation being carried out to base version table ", further include:
The base version table of grid equipment and its corresponding version table are loaded into internal memory, and are mapped as memory object organization and administration.
Seen from the above description, stored in the form of object-oriented in internal memory by by spatial data table, can be saved
About memory headroom.
Further, the data in the base version table can only enter edlin in editor's task.
Seen from the above description, by version locking mechanism, it is to avoid conflict editor.
Embodiment one
Embodiments of the invention one are:A kind of online synergic editing method of power network multitask, methods described is based on version pipe
Reason technology, version management technology be safeguard in figure, editor when using to a kind of figure of Long routine safeguard treatment technology.It is logical
Crossing it can realize that different graphics version layers carry out maintenance and the editor of respective task, and be independent of each other.In systems, it is used for
Realize run mode power network and edit isolating for state power network.The editing of version task is all carried out in the case where state is edited, in run mode
Under can't see the data of editor's state, only need after task issue, editor's state data are merged into run mode just can be with.By each
Grid equipment O&M job order records the change of power network G I S datas as a version;After version is through examination & verification issue, then
Terminate the life cycle of version;The examination & verification issue of version is used as a Long routine, otherwise all successes, otherwise all failures.
In the present embodiment, the reset condition of table is referred to as base version table in database, and multiple bases version is there are in a database
Table, therefore for each base version table is provided with numbering, each base version table has and its one-to-one version table;Meanwhile, in order to
The editing mode in version is preserved, and improves edition data search efficiency, each base version table increases by two fields, is respectively shape
State numbers (STATEID) and start context (VERSIONID), and status number is represented before and after data are carried out with the time of edit operation
Sequentially, start context is the corresponding numbering of editor's task.Version table increases editor's identification field with respect to base version table
(ADDFLAG), editing type (newly-increased, modification, the deletion, wherein deletion includes deleting base version data and deletion newly of description data
Increase data), facilitate the inquiry of version editor's increment.
Fig. 2 is refer to, methods described comprises the following steps:
S1:Creation state numbered sequence, the sequential value in the status number sequence sorts successively from small to large;It is preferred that
Ground, can sequence incremented by successively from small to large, such as 0,1,2,3 ... by that analogy.
S2:According to editor's task, edit operation is carried out to base version table;Now, judge the edit operation whether in editor's state
Under carry out, if so, performing step S3, if not, then it represents that the edit operation is carried out under run mode, perform step S11.
Further, marketing, communication system usage scenario are that, directly in the enterprising edlin of run mode, fortune check system can not be compiled in run mode
Volume, it is necessary to by creating a task work order, edlin is entered in task, after submitting to examination & verification, examination & verification to pass through afterwards, issue is compiled
Data after volume, now can be by the editor's data write-in base version table in task.Editor's data under run mode are write direct base
In version table, the editor's data under editor's state are write direct in version table.
S3:The data of editor recorded with the base version corresponding version table of table, and editor's task pair is recorded
The corresponding editor's mark of start context and the edit operation answered.When edlin is entered to base version table under editing state, not directly
Be connected on base version table on modify, but the data that will be edited recorded with base version the one-to-one version table of table in, now,
Domestic consumer can't see the result of real-time edition under run mode.
S4:According to the time tandem of edit operation, the sequence that will successively be taken out in edit operation and status number sequence
Train value is associated, and by the sequential value write-in version table;All of editor's task all corresponds to a status number
Sequence.
S5:The sequential value and the base edited version table numbering are associated, and write version change table;That is version
List of modification record is the numbering for representing the sequential value of status number and the corresponding base version table edited.
S6:According to the version change table, judge whether base version table changes, if so, performing step S7.
S7:According to the corresponding version table of base version table, correspondence updates the base version table.Further, according to institute
The editor's identification field (ADDFLAG) in version table is stated to be operated accordingly.
Specifically, if the corresponding editor of a data is designated default newly-increased number in the corresponding version table of base version table
According to mark, then in a data being increased into the base version table, and by corresponding start context in base version table
It is set to default initial number, it is preferable that default initial number is 0;
If the corresponding editor of a data is designated default modification Data Identification in the corresponding version table of base version table,
An original data then are searched in base version table, the data syn-chronization after being edited in the version table
Into base version table, and corresponding start context is set to default initial number in base version table;
If the corresponding editor of a data is designated default deletion base version data in the corresponding version table of base version table
Mark, then delete a data in the base version table;
If the corresponding editor of a data in the corresponding version table of base version table is designated and default deletes newly-increased number
According to mark, then base version table is not operated.
S8:Meanwhile, the renewal operation is associated with next sequential value of status number sequence, and will be described next
In sequential value write-in base version table;Continue to take out sequential value from status number sequence in sequence, now, operation will be updated and worked as
Do an edit operation for entirety, therefore only with a sequential value be used as status number.
S9:Next sequential value and the base of renewal version table numbering are associated, and write base version list of modification.
S10:Issue the base version table.
S11:The base version table is updated according to the edit operation, and records the corresponding start context of editor's task.
When entering edlin to base version table under run mode, then it is not related to version table, but directly updates base version table, domestic consumer is in operation
Edited result can be in real time seen under state.
S12:According to the time tandem of edit operation, the sequence that will successively be taken out in edit operation and status number sequence
Train value is associated, and by the sequential value write-in base version table.
S13:The sequential value and the base edited version table numbering are associated, and write base version list of modification.
In step s3, the corresponding start context of record editor's task, is in order to prevent conflict from editing, by using version
Locking mechanism, it is ensured that any one data in base version table can only enter edlin in editor's task.If a for example, visitor
Edlin is entered in family end in editor's task that start context is 100 to a data, if another client will also be carried out to the data
Whether during editor, it is consistent with the start context of the editor's task performed by itself to compare the corresponding start context of the data, if
Unanimously, then editor is allowed, if inconsistent, if the start context of the editor's task performed by for example another client is 200, no
Edlin can be entered to the data.
The present embodiment when edit operation is carried out, by sequentially from status number sequence take out sequential value and edit operation
Association, because the sequential value in status number sequence sorts from small to large, therefore can intuitively represent each editor behaviour
The order of work;By setting version change table, can by sequential value judge base version table whether change, can also by with sequence
The corresponding base version table numbering of train value obtains the base version table for changing, and further according to the modification information recorded in version table, correspondence is more
New base version table, collaboration volume is carried out so as to realize that multiple client is based on different editor's tasks to similar and different base version table
Volume.
Embodiment two
Further expansion of the present embodiment to step S6 in embodiment one.
As shown in figure 3, step S6 is specifically included:
S601:Obtain the sequential value of maximum in version change table.
S602:Obtain the sequential value of maximum in all base version tables and version table;Obtain in internal memory all bases version tables and its
Maximum sequential value in corresponding version table.
S603:Judge whether two maximum sequential values are consistent, if, then it represents that not to any one base version table
Enter edlin, if not, then it represents that have and edlin is entered to base version table, perform step S604.
S604:According to version change table, the corresponding base version of sequential value between two maximum sequential values is obtained
Table is numbered.
S605:Whether the corresponding base version table numbering is judged comprising base version table numbering, if so, performing step
S606。
S606:Judge that the base version table is changed.
Due to the time tandem of the edit operation that sequential value is represented, therefore base version table can be determined according to sequential value
Whether change, then the base the edited version table numbering according to version change token record is learnt specifically to which base version
Table is edited.During renewal, only the data corresponding to the sequential value between two sequential values of maximum are updated.
Alternatively, data that can be in issue to overall editor are updated, also can be before issue to the base in editor's state
Version table carries out real-time update, now, can obtain two according to default cycle timing scan base version list of modification and version change table
Maximum sequential value in table, the maximum-sequence-value for then being obtained with a upper cycle is compared, if inconsistent, shows there occurs
Change, using two intervals of the maximum sequential value as querying condition, inquiry base version list of modification or version change table, searches
There is the base version table edited in the cycle, then accordingly updated according to its corresponding version table.
Embodiment three
The present embodiment is the further expansion of above-described embodiment.
Before step S1 or S2, the base version table of grid equipment and its corresponding version table are loaded into internal memory, and be mapped as
Memory object organize, will power network base version with version space data be loaded into internal memory, and using corresponding data structure encapsulation
Spatial data database data, spatial data forms data abstraction including point, line, surface and annotation etc. using Object-Oriented Design thought
Data are packaged by type, main management space record object, right while encapsulated using respective data structures to spatial table
As indexing and providing data read-write operation.
When edlin is entered, rear end manages spatial data concentratedly by method of service, and mechanism is penetrated using version, that is, compiling
The edited result of other tasks mutually can be in real time seen in the task of collecting, realizes that multiple tasks " one throws the net " formula is managed.Version is worn
Saturating mechanism is mainly overlapped mutually realization by multiple edition datas with base version data.
When being updated, using data real-time update technology, by periodic scanning base version list of modification and version change table
Reading data in real-time and incremental data is loaded into internal memory in the way of increment, for real-time update internal storage data, embodies client
The data consistency of access.Realize that multitask edition data is issued by incremental data real-time update technology and version management technology
Management.
Further, additionally use version and cache automatic maintenance mechanism, i.e., after step S6, delete the corresponding version
A data in this table.Specifically, when edition data is issued, it is data cached that grid service can automatically clear up version,
After data write-in base version table in version table, the data in base version table are changed, and initiator version table updates, if in base version table
The corresponding start context of data (VERSIONID) are 0, and grid service can the automatic data in version caching in base version table
ID searches corresponding edition data, if it is found, then deleting.After edition data issue, base version table data are changed, and are swept in real time
Base table list of modification is retouched, the incremental data between two sequential values of maximum in embodiment two is synchronized in base version caching, more
During new base version data, judge whether the corresponding VERSIONID of data is 0, if VERSIONID is 0, in correspondence version caching
Record is searched, if correspondence colophon can be found according to data ID, is deleted in version caching, in this way can be with standard
Really after now version issue, announced colophon can be deleted from version caching in time.
Example IV
The present embodiment is a concrete application scene of above-described embodiment.The present embodiment is compiled as with the case where state is edited
Example.
Tables 1 and 2 respectively defines base version table structure and version table structure;Wherein to editor's identification field of version table
ADDFLAG is provided with default parameters.
Table 1
Table 2
Assuming that numbering 10247 is that base version table POLE is as shown in table 3, the table reset condition has 6 records, and it is not being carried out
Before editor, its corresponding version table POLE_VER is as shown in table 4.
Table 3
Table 4
Assuming that A is respectively created with B clients and opens start context for VERSIONID=100 and VERSIONID=200
Editor's task, open newly-built task and before editing in A and B, the figure that A and B sees is run mode data, that is,
Base version data.A and B edits base version table POLE, it is assumed that A increases Record ID=7 newly, and party B-subscriber increases Record ID=8 and 9 two notes newly
Record, then insert 3 records, as shown in table 5 in version table;Because version table data change, version change table is newly-increased 3
Record, as shown in table 6.
Table 5
Table 6
A goes out figure in real time with B clients by accessing rear end rasterizing service, and mechanism is penetrated according to version, and A is in start context
Not can be only seen the equipment that oneself newly-increased ID is 7 in 200 task, can also in real time see that B is 300 in start context
Task in increase newly ID be 8 and 9 equipment, while B can also see in the task of oneself A increase newly ID be 7 equipment.
Afterwards, A changes the data of ID=5, and Fld1 is changed into Fld11, and B changes the data of ID=6, Fld2 is changed to
Fld22, as shown in table 7, as shown in table 8, version change table is as shown in table 9 for version table for base version table now.And due to base version table
The data of middle ID=5 and ID=6 are locked by the task of VERSIONID=100 and VERSIONID=200 respectively, therefore can not
By other tasks editor.
Table 7
Table 8
Table 9
Edition data is changed, real time scan version change table, incremental data is loaded into version caching, now A and B
Respective amended effect can be mutually seen in real time.
Afterwards, A deletes the data of ID=1, and B deletes the data of ID=2, and base version table now is as shown in table 10, version table
As shown in table 11, version change table is as shown in table 12.Due to being to delete base version data, therefore ADDFLAG is set to 3.
Table 10
Table 11
Table 12
Edition data is changed, real time scan version change table, incremental data is loaded into version caching, now A and B
The effect after each deleting can be mutually seen in real time.
If deleting the situation of newly-increased data, such as A deletes the data of ID=7, and B deletes the data of ID=8, version now
As shown in table 13, version change table is as shown in table 14 for this table.Due to being to delete newly-increased data, therefore modification status number, and will
ADDFLAG is updated to 4.
Table 13
Table 14
Edition data is changed, real time scan version change table, and incremental data is loaded into version caching, is now read
The incremental data for arriving is ID=7 and ID=8, and incremental data is mapped as memory object storage in corresponding version by data update module
In this caching, in the case where figure displaying scene is gone out, mark to determine whether the equipment needs exhibition by the ADDFLAG for judging memory object
Show.After A and B roaming, can with real-time online see both sides edit after effect, be can't see in A tasks and B tasks ID=7 and
The record of ID=8.
After task editor finishes, you can to carry out version issue, the main method of version issue is by judging version
ADDFLAG in table is operated accordingly:
If colophon ADDFLAG=1, colophon is increased newly a note in base version table in the way of copying
Record, and VERSIONID is set to 0.
If colophon ADDFLAG=2, and record can be found in base version table according to ID, then updated with colophon
Base version table is synchronized to, and VERSIONID is set to 0.
If colophon ADDFLAG=3, and record can be found in base version table according to ID, then delete base version table correspondence
Record.
After colophon is disposed, announced record in version table is finally deleted.
A issues the task of VERSIONID=200, and B issues the task of VERSIONID=300, after issue is finished, base version table
As shown in Table 15, as shown in table 16, version table is as shown in table 17 for base version list of modification.
Table 15
Table 16
Table 17
A and B is roamed under run mode, can in real time see the graph data after mutually issue.
In sum, a kind of online synergic editing method of power network multitask that the present invention is provided, when edit operation is carried out,
Associated with edit operation by sequentially taking out sequential value from status number sequence, because the sequential value in status number sequence is
Sort from small to large, therefore can intuitively represent the order of each edit operation;By setting version change table, Ke Yitong
Cross sequential value and judge whether base version table changes, can also be numbered by base corresponding with sequential value version table and obtain what is changed
Base version table, further according to the modification information recorded in version table, correspondence updates base version table, so as to realize that multiple client is based on difference
Editor's task collaborative editing is carried out to similar and different base version table.
Embodiments of the invention are the foregoing is only, the scope of the claims of the invention is not thereby limited, it is every to utilize this hair
The equivalents that bright specification and accompanying drawing content are made, or the technical field of correlation is directly or indirectly used in, similarly include
In scope of patent protection of the invention.