The online synergic editing method of power grid multitask
Technical field
The present invention relates to electric network information field of communication technology more particularly to a kind of online collaborative editing sides of power grid multitask
Method.
Background technique
In order to effectively support units at different levels and department comprehensively to effective management of power network resources information, need to build covering state
Family 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 service personnel and dispatcher will update relevant equipment figure and machine account information, realize power grid
The figures of installations and facilities, topology, Unit account of plant board service, realize full company's power grid horizontal and vertical " one throws the net ".
O&M service personnel needs to safeguard all devices information of O&M maintenance portion's operation management, realizes the mutual of Unit account of plant and assets
Connection supports assets life-cycle management, realizes that power grid and customer information interconnect, and the synthesis such as support breakdown repair, line loss fining is answered
With.
Existing version way to manage majority is based on single machine 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 locally editor, is submitting
Database is written after merging by complicated edition data in link.In this manner, with the growth of electric network data, local text
Part is excessive and causes data query performance lower and lower, and graphic panning performance Caton phenomenon is serious, in multitask submission, data
Merge that link is excessively complicated, and the data for frequently resulting in submission can just see at second day, and task is entirely isolated, Wu Fashi
Existing multi-person synergy editor, displaying and publication, reduce working efficiency.
In the Chinese patent open file of Publication No. CN104717239A, the collaboration for proposing a kind of shared file is compiled
Collect method, server and user terminal, which comprises according to shared file source, distribute for a plurality of clients to shared text
The editing authority of part;Establish a stack table;The shared file editor's information for obtaining the multiple user terminal, by the shared file
Editor's information is stored in one by one in the stack table.But in the program, for other users end, only part editing authority,
The total data of shared file can not be edited, there are limitations.
Summary of the invention
The technical problems to be solved by the present invention are: a kind of online synergic editing method of power grid multitask is provided, it can be achieved that
The Real-Time Sharing of edited result.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention are as follows: a kind of power grid multitask cooperates with volume online
The method of collecting, comprising:
Creation state numbered sequence, the sequential value in the status number sequence successively sort 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 editing state, the data of editor are recorded corresponding with the 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 the sequential value is written in the version table;
The sequential value and base version table numbering to be edited are associated, and version change table is written;
According to the version change table, judge whether a base version table changes;
It is corresponding to update the base version table according to the corresponding version table of the base version table if changing;
Meanwhile operation is updated and next sequential value of status number sequence is associated for described, and by next sequence
Train value is written in base version table;
Next sequential value and the base version table numbering of update are associated, and base version list of modification is written;
Issue the base version table.
The beneficial effects of the present invention are: when carrying out edit operation, by sequentially taking out sequence from status number sequence
Train value is associated with edit operation, can intuitive earth's surface since the sequential value in status number sequence sorts from small to large
The sequence of each edit operation is shown;By the way that version change table is arranged, it can judge whether base version table becomes by sequential value
More, also the base version table changed can be obtained by base version table numbering corresponding with sequential value, further according to what is recorded in version table
Modification information, it is corresponding to update base version table, to realize multiple client based on different editor's tasks to similar and different base
Version table carries out collaborative editing.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the online synergic editing method of multitask of the present invention;
Fig. 2 is the method flow diagram of the embodiment of the present invention one;
Fig. 3 is the flow chart of the step S6 of the embodiment of the present invention two.
Specific embodiment
To explain the technical content, the achieved purpose and the effect of the present invention in detail, below in conjunction with embodiment and cooperate attached
Figure is explained in detail.
The most critical design of the present invention is: the sequence of edit operation is indicated by the sequential value of status number sequence, and
All tasks share a status number sequence, when being edited, it can be seen that the real-time results of other tasks editor.
Referring to Fig. 1, a kind of online synergic editing method of power grid multitask, comprising:
Creation state numbered sequence, the sequential value in the status number sequence successively sort 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 editing state, the data of editor are recorded corresponding with the 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 the sequential value is written in the version table;
The sequential value and base version table numbering to be edited are associated, and version change table is written;
According to the version change table, judge whether a base version table changes;
It is corresponding to update the base version table according to the corresponding version table of the base version table if changing;
Meanwhile operation is updated and next sequential value of status number sequence is associated for described, and by next sequence
Train value is written in base version table;
Next sequential value and the base version table numbering of update are associated, and base version list of modification is written;
Issue the base version table.
As can be seen from the above description, the beneficial effects of the present invention are: in the case where editing state base version table is edited, not directly
The data of base version table are edited, but are first recorded in version table, it just will be in version table when version publication to be carried out
Data are corresponding to be updated into base version table.
Further, after described " according to editor's task, carrying out edit operation to base version table ", further comprise:
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 the sequential value is written in the base version table;
The sequential value and base version table numbering to be edited are associated, and base version list of modification is written.
Seen from the above description, base version table is edited 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 a base version table changes " specifically:
Obtain maximum sequential value in version change table;
Obtain maximum sequential value 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 obtained between two maximum sequential values is corresponding
Base version table numbering;
Judge whether the corresponding base version table numbering includes the base version table numbering;
If comprising determining that the base version table changes.
Seen from the above description, it by representing the sequential value of the time tandem of edit operation, intuitively represents pair
Whether the sequence that each data are edited can easily learn relative to a time point, be edited later, from
And judge whether to change.
Further, described " if changing, according to the corresponding version table of the base version table, to correspond to described in updating
One base version table " specifically:
If the corresponding editor of a data is identified as preset newly-increased Data Identification in the corresponding version table of the base version table,
Then a data are increased in the base version table, and in the base version table are set to corresponding start context default
Initial number;
If the corresponding editor of a data is identified as preset modification Data Identification in the corresponding version table of the base version table,
An original data are then searched in the base version table, a data edited in the version table are synchronous
Extremely in the base version table, and corresponding start context is set to preset initial number in the base version table;
If the corresponding editor of a data is identified as preset deletion base version data in the corresponding version table of the base version table
Mark, then delete a data in the base version table.
Seen from the above description, it is updated in a manner of incremental data, only retains last edited result, without considering
Editing process.
Further, described " if changing, according to the corresponding version table of the base version table, to correspond to described in updating
After one base version table ", further comprise:
Delete the data in the corresponding version table.
Seen from the above description, the data being updated are deleted from version table in time, to guarantee to have sent out
The colophon of cloth can be deleted from version caching in time.
Further, before described " according to editor's task, carrying out edit operation to base version table ", further comprise:
The base version table of grid equipment and its corresponding version table are loaded into memory, and are mapped as memory object organization and administration.
Seen from the above description, it storing spatial data table in the form of object-oriented in memory, can save
About memory headroom.
Further, the data in the base version table can only be edited in editor's task.
Seen from the above description, by version locking mechanism, conflict is avoided to edit.
Embodiment one
The embodiment of the present invention one are as follows: a kind of online synergic editing method of power grid multitask, the method are based on version pipe
Reason technology, version management technology are to safeguard processing technique using a kind of figure of the Long routine arrived in figure maintenance, editor.It is logical
It crosses it different graphics version layers may be implemented and carry out maintenance and the editor of respective task, and be independent of each other.In systems, it is used for
Realization run mode power grid is isolated with editor's state power grid.The editing of version task is all carried out in the case where editing state, in run mode
Under can't see the data of editor's state, only to task publication after, editor's state data are merged into run mode just can be with.By each
Grid equipment O&M job order records the variation of power grid G I S data as a version;When version through audit publication after, then
Terminate the life cycle of version;The audit publication of version success or whole failures as a Long routine or all.
In the present embodiment, the reset condition of table is known as base version table in database, and there are multiple base versions in a database
Table, therefore it is provided with number for each base version table, each base version table has and its one-to-one version table;Meanwhile in order to
The editing mode in version is saved, and improves edition data search efficiency, it is shape respectively that each base version table, which increases by two fields,
State numbers (STATEID) and start context (VERSIONID), and status number indicated before and after the time that data are carried out with edit operation
Sequentially, start context, that is, corresponding number of editor's task.Version table increases editor's identification field with respect to base version table
(ADDFLAG), editing type (the newly-increased, modification, deletion, wherein deleting new including deleting base version data and deletion of data are described
Increase data), facilitate the inquiry of version editor's increment.
Referring to figure 2., described method includes following steps:
S1: creation state numbered sequence, the sequential value in the status number sequence successively sort from small to large;It is preferred that
Ground, can sequence incremented by successively from small to large, such as 0,1,2,3 ... and so on.
S2: according to editor's task, edit operation is carried out to base version table;At this point, judging the edit operation whether in editor's state
Lower progress, if so, executing step S3, if not, then it represents that the edit operation is carried out under run mode, and step S11 is executed.
Further, marketing, communication system usage scenario are directly in the enterprising edlin of run mode, and transporting check system cannot compile in run mode
Volume, it is necessary to by creating a task work order, edited in task, after submitting audit, audit to pass through later, publication is compiled
Editor's data in task can be written in base version table at this time for data after volume.Editor's data under run mode write direct base
In version table, the editor's data edited under state are write direct in version table.
S3: the data of editor are recorded in version table corresponding with the base version table, and record editor's task pair
The corresponding editor's mark of the start context and the edit operation answered.When being edited under editing state to base version table, not directly
Connect and modify on base version table, but by data to be edited be recorded in the one-to-one version table of base version table, at this point,
Ordinary user 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 the sequential value is written in the version table;All editor's tasks all correspond to a status number
Sequence.
S5: the sequential value and base version table numbering to be edited are associated, and version change table is written;That is version
List of modification record is the number for indicating the sequential value and corresponding base version table to be edited of status number.
S6: according to the version change table, judging whether a base version table changes, if so, executing step S7.
S7: corresponding to update the base version table according to the corresponding version table of the base version table.Further, according to institute
State editor's identification field (ADDFLAG) Lai Jinhang corresponding operation in version table.
Specifically, if the corresponding editor of a data is identified as preset newly-increased number in the corresponding version table of the base version table
According to mark, then a data are increased in the base version table, and by corresponding start context in the base version table
It is set to preset initial number, it is preferable that preset initial number is 0;
If the corresponding editor of a data is identified as preset modification Data Identification in the corresponding version table of the base version table,
An original data are then searched in the base version table, a data edited in the version table are synchronous
Extremely in the base version table, and corresponding start context is set to preset initial number in the base version table;
If the corresponding editor of a data is identified as preset deletion base version data in the corresponding version table of the 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 the base version table is identified as and preset deletes newly-increased number
According to mark, then the base version table is not operated.
S8: meanwhile, next sequential value of the update operation and status number sequence is associated, and will be described next
Sequential value is written in base version table;Continue to take out sequential value from status number sequence in sequence, at this point, working as operation is updated
The edit operation of an entirety is done, therefore only with a sequential value as status number.
S9: next sequential value and the base version table numbering of update are associated, and base version list of modification is written.
S10: the publication one 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 editing under run mode to base version table, then it is not related to version table, but directly updates base version table, ordinary user is running
Edited result can be seen under state in real time.
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 the sequential value is written in the base version table.
S13: the sequential value and base version table numbering to be edited are associated, and base version list of modification is written.
In step s3, the corresponding start context of record editor's task is that conflict is edited in order to prevent, by using version
Locking mechanism guarantees that any one data in base version table can only be edited in editor's task.For example, an if visitor
A data are edited in editor's task that start context is 100 in family end, if another client will also carry out the data
When editor, need to compare the corresponding start context of the data with itself performed by editor's task start context it is whether consistent, if
Unanimously, then allow to edit, if inconsistent, if such as editor's task performed by another client start context be 200, no
The data can be edited.
The present embodiment is when carrying out edit operation, by sequentially taking out sequential value and edit operation from status number sequence
Association can intuitively represent each editor behaviour since the sequential value in status number sequence sorts from small to large
The sequence of work;By be arranged version change table, can judge whether base version table changes by sequential value, can also by with sequence
The corresponding base version table numbering of train value obtains the base version table changed, further according to the modification information recorded in version table, corresponds to more
New base version table, to realize that multiple client carries out collaboration volume to similar and different base version table based on different editor's tasks
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: maximum sequential value in version change table is obtained.
S602: maximum sequential value in all base version tables and version table is obtained;I.e. obtain memory in all base version tables and its
Maximum sequential value in corresponding version table.
S603: judging whether two maximum sequential values are consistent, if so, indicating not to any one base version table
It is edited, if not, then it represents that have and base version table is edited, execute step S604.
S604: according to version change table, the corresponding base version of sequential value between two maximum sequential values is obtained
Table numbering.
S605: judging whether the corresponding base version table numbering includes the base version table numbering, if so, executing step
S606。
S606: determine that the base version table changes.
Due to the time tandem for the edit operation that sequential value represents, base version table can be determined according to sequential value
Whether change, is then learnt specifically according to the base version table numbering to be edited that version change table records to which base version
Table is edited.When update, only data corresponding to the sequential value between two maximum sequential values are updated.
Optionally, the data integrally edited can be updated in publication, it can also be before publication to the base in editor's state
Version table carries out real-time update, at this point, two can be obtained according to preset period timing scan base version list of modification and version change table
Maximum sequential value in table, the maximum-sequence-value then obtained with a upper period are compared, if inconsistent, show to have occurred
Change inquires base version list of modification or version change table using the section of two maximum sequential values as querying condition, searches
There is base version table to be edited into the period, is 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 memory, and be mapped as
Power grid base version and version space data are loaded into memory, and are encapsulated using corresponding data structure by memory object organization and administration
Spatial database data, spatial data include point, line, surface and annotation etc., form data abstraction using Object-Oriented Design thought
Type is packaged data, while being encapsulated to spatial table using respective data structures, main management space record object, right
As indexing and providing data read-write operation.
When being edited, rear end manages spatial data concentratedly by method of service, penetrates mechanism using version, that is, is compiling
The edited result of other tasks can be mutually seen in the task of collecting in real time, realizes multiple tasks " one throws the net " formula management.Version is worn
Saturating mechanism is mainly overlapped mutually realization by multiple edition datas and base version data.
When being updated, using data real-time update technology, pass through periodic scanning base version list of modification and version change table
Reading data in real-time and incremental data is loaded into memory in a manner of increment, is used for real-time update internal storage data, embodies client
The data consistency of access.The publication of multitask edition data is realized by incremental data real-time update technology and version management technology
Management.
Further, it additionally uses version and caches 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 clear up version automatically,
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) is 0, and grid service can be automatically in version caching according to the data in base version table
ID searches corresponding edition data, if it is found, then deleting.After edition data publication, base version table data are changed, and sweep in real time
Base table list of modification is retouched, the incremental data in embodiment two between two maximum sequential values is synchronized in base version caching, more
When new base version data, judge whether the corresponding VERSIONID of data is 0, if VERSIONID is 0, in corresponding version caching
Record is searched, if corresponding colophon can be found according to data ID, is deleted in version caching, it in this way can be quasi-
Really after now version publication, 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 in the case where editing state to be compiled as
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 number 10247 is that base version table POLE is as shown in table 3, which has 6 records, is not carrying out to it
Before editor, corresponding version table POLE_VER is as shown in table 4.
Table 3
Table 4
Assuming that it is VERSIONID=100 and VERSIONID=200 that A and B client, which are respectively created and open start context,
Editor's task, open newly-built task and before editing in A and B, the figure that A and B see is run mode data, that is,
Base version data.A and B edit 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 is then inserted into 3 records, as shown in table 5 in version table;Since version table data change, version change table is 3 newly-increased
Record, as shown in table 6.
Table 5
Table 6
A and B client go out to scheme in real time by the service of access rear end rasterizing, penetrate mechanism according to version, A is in start context
Not can be only seen the equipment that oneself newly-increased ID is 7 in 200 task, it can also see that B in start context is 300 in real time
Task in the ID that increases newly be 8 and 9 equipment, while B can also see in the task of oneself the newly-increased ID of A for 7 equipment.
Later, A modifies the data of ID=5, Fld1 is changed to Fld11, B modifies the data of ID=6, Fld2 is changed to
Fld22, base version table at this time is as shown in table 7, and version table is as shown in table 8, and version change table is as shown in table 9.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 cannot
By other tasks editor.
Table 7
Table 8
Table 9
Edition data changes, real time scan version change table, incremental data is loaded into version caching, at this time A and B
Respective modified effect can be mutually seen in real time.
Later, A deletes the data of ID=1, and B deletes the data of ID=2, and base version table at this time 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, ADDFLAG is set as 3.
Table 10
Table 11
Table 12
Edition data changes, real time scan version change table, incremental data is loaded into version caching, at this time A and B
The effect after respectively deleting can be mutually seen in real time.
The case where if newly-increased data are deleted, such as A delete the data of ID=7, and B deletes the data of ID=8, version at this time
This table is as shown in table 13, and version change table is as shown in table 14.Due to being to delete newly-increased data, status number is modified, and will
ADDFLAG is updated to 4.
Table 13
Table 14
Edition data changes, real time scan version change table, and incremental data is loaded into version caching, is read at this time
The incremental data arrived is ID=7 and ID=8, and incremental data is mapped as memory object and is stored in corresponding version by data update module
In this caching, in the case where going out figure and showing scene, determine whether the equipment needs to open up by judging the ADDFLAG label of memory object
Show.After A and B roaming, can see the edited effect of both sides with real-time online, can't see in A task and B task ID=7 with
The record of ID=8.
After task editor finishes, it can carry out version publication, the main method of version publication is by judging version
ADDFLAG in table carries out corresponding operation:
If colophon ADDFLAG=1 newly, colophon is increased to a note in a manner of copying in base version table
Record, and VERSIONID is set to 0.
If colophon ADDFLAG=2, and record can be found in base version table according to ID, then it is updated with colophon
It is synchronized to base version table, and VERSIONID is set to 0.
If colophon ADDFLAG=3, and record can be found in base version table according to ID, then it is corresponding to delete base version table
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 publication, base version table
As shown in Table 15, base version list of modification is as shown in table 16, and version table is as shown in table 17.
Table 15
Table 16
Table 17
A and B is roamed under run mode, the graph data after capable of seeing mutually publication in real time.
In conclusion a kind of online synergic editing method of power grid multitask provided by the invention, when carrying out edit operation,
It is associated with by sequentially taking out sequential value from status number sequence with edit operation, since the sequential value in status number sequence is
It sorts from small to large, therefore can intuitively represent the sequence of each edit operation;By the way that version change table, Ke Yitong is arranged
It crosses sequential value and judges whether base version table changes, can also be changed by base version table numbering corresponding with sequential value acquisition
Base version table, it is corresponding to update base version table further according to the modification information recorded in version table, to realize that multiple client is based on difference
Editor's task collaborative editing is carried out to similar and different base version table.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalents made by bright specification and accompanying drawing content are applied directly or indirectly in relevant technical field, similarly include
In scope of patent protection of the invention.