CN106802928B - Power grid historical data management method and system - Google Patents

Power grid historical data management method and system Download PDF

Info

Publication number
CN106802928B
CN106802928B CN201611217138.2A CN201611217138A CN106802928B CN 106802928 B CN106802928 B CN 106802928B CN 201611217138 A CN201611217138 A CN 201611217138A CN 106802928 B CN106802928 B CN 106802928B
Authority
CN
China
Prior art keywords
time
data table
data
field
editing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611217138.2A
Other languages
Chinese (zh)
Other versions
CN106802928A (en
Inventor
项卫山
刘光曹
蔡喜荣
常昌
邱鹤庆
陈升
赵光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Epgis Information Technology Co ltd
State Grid Corp of China SGCC
State Grid Information and Telecommunication Co Ltd
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
Great Power Science and Technology Co of State Grid Information and Telecommunication Co Ltd
Original Assignee
Xiamen Epgis Information Technology Co ltd
State Grid Corp of China SGCC
State Grid Information and Telecommunication Co Ltd
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
Great Power Science and Technology Co of State Grid Information and Telecommunication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Epgis Information Technology Co ltd, State Grid Corp of China SGCC, State Grid Information and Telecommunication Co Ltd, Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd, Great Power Science and Technology Co of State Grid Information and Telecommunication Co Ltd filed Critical Xiamen Epgis Information Technology Co ltd
Priority to CN201611217138.2A priority Critical patent/CN106802928B/en
Publication of CN106802928A publication Critical patent/CN106802928A/en
Application granted granted Critical
Publication of CN106802928B publication Critical patent/CN106802928B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Water Supply & Treatment (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a power grid historical data management method and a system thereof, wherein the method comprises the following steps: creating a base version data table and a historical data table thereof; adding a first time field in the base version data table, and adding a second time field and a death field in the historical data table; if the editing operation is carried out on one data in the base version data table, recording the data before editing into the historical data table, recording the time recorded in the first time field before editing into the second time field, and writing the editing time into the death field; if the corresponding base version data table at a time point is required to be inquired, acquiring data with the time recorded in the first time field being earlier than or equal to the time point from the base version data table; acquiring data, recorded in the second time field, of which the time is earlier than or equal to a time point and the time recorded in the death field is later than the time point from the historical data table; the data obtained from the two tables are combined. The historical profile data at any time point can be quickly inquired.

Description

Power grid historical data management method and system
Technical Field
The invention relates to the technical field of power grid information communication, in particular to a power grid historical data management method and a power grid historical data management system.
Background
At present, most of services need to analyze the power grid in real time by analyzing the power grid resources in an operating state. One understanding of the grid is also based on the existing operating grid in the production environment. In the power grid GIS platform, the storage of the power grid resources is only the power grid resources in the existing operation state, does not have the time dynamics for processing data, and only describes the instantaneous state of the data. When data changes, the old data is replaced by the new data, the system becomes another transient state, and the old data does not exist. In today's big data age, the discarding of these old data is undoubtedly a loss of the grid information system.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the historical data management method and the historical data management system for the power grid are provided, and historical section data at any time point can be quickly inquired.
In order to solve the technical problems, the invention adopts the technical scheme that: a power grid historical data management method comprises the following steps:
creating a base version data table and a corresponding historical data table;
adding a first time field in the base version data table, and adding a second time field and a death field in the historical data table, wherein the first time field is used for recording the time of the latest edition;
if one piece of data in the base data table is edited, recording the piece of data before editing into a historical data table corresponding to the base data table, recording time recorded in a first time field of the piece of data before editing into a second time field corresponding to the piece of data in the historical data table, and writing the editing time of the editing operation into a corresponding extinction field;
if the corresponding base version data table at a time point is required to be inquired, acquiring data of which the time recorded in the first time field is earlier than or equal to the time point from the base version data table;
acquiring data of which the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point from a historical data table;
and merging the data acquired from the base data table and the data acquired from the historical data table.
The invention also relates to a power grid historical data management system, which comprises:
the first establishing module is used for establishing a base version data table and a corresponding historical data table;
the adding module is used for adding a first time field in the base version data table, adding a second time field and a death field in the historical data table, and the first time field is used for recording the latest editing time;
the recording module is used for recording the data before editing into a historical data table corresponding to the base data table if the editing operation is carried out on the data in the base data table, recording the time recorded in a first time field of the data before editing into a second time field corresponding to the data in the historical data table, and writing the editing time of the editing operation into a corresponding extinction field;
the first obtaining module is used for obtaining data of which the time recorded in the first time field is earlier than or equal to a time point from the base version data table if the corresponding base version data table at the time point is required to be inquired;
the second acquisition module is used for acquiring data, recorded in the second time field, of which the time is earlier than or equal to the time point and the recorded in the death field is later than the time point from the historical data table;
and the merging module is used for merging the data acquired from the base version data table and the data acquired from the historical data table.
The invention has the beneficial effects that: only the deleted and modified data in the base data table are stored in the historical data table, so that the data quantity of the historical data table can be reduced, and the storage space of the historical data table is saved; the latest editing time is recorded in the base data table, the last editing time and the last editing time of the edited data are recorded in the historical data table, and the historical data are managed based on the data superposition mode of the base data table and the historical data table, so that the historical data at the appointed time point can be accurately extracted, and the effective retention of the historical data is realized.
Drawings
FIG. 1 is a flow chart of a power grid historical data management method of the present invention;
fig. 2 is a schematic diagram of a power grid data flow according to a first embodiment of the present invention;
FIG. 3 is a flowchart of a method according to a first embodiment of the present invention;
FIG. 4 is a flowchart of a method according to a second embodiment of the present invention;
FIG. 5 is a schematic diagram of a power grid historical data management system according to the present invention;
fig. 6 is a schematic structural diagram of a system according to a fourth embodiment of the present invention.
Description of reference numerals:
1. a first creation module; 2. adding a module; 3. a recording module; 4. a first acquisition module;
5. a second acquisition module; 6. a merging module; 7. a second creation module; 8. a correlation module;
31. a first recording unit; 32. a second recording unit; 33. a write unit;
41. a first acquisition unit; 42. a second acquisition unit; 43. and a third acquisition unit.
Detailed Description
In order to explain technical contents, objects and effects of the present invention in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
The most key concept of the invention is as follows: the history data is managed based on a data superposition manner of the base version data table and the history data table.
Referring to fig. 1, a method for managing historical data of a power grid includes:
creating a base version data table and a corresponding historical data table;
adding a first time field in the base version data table, and adding a second time field and a death field in the historical data table, wherein the first time field is used for recording the time of the latest edition;
if one piece of data in the base data table is edited, recording the piece of data before editing into a historical data table corresponding to the base data table, recording time recorded in a first time field of the piece of data before editing into a second time field corresponding to the piece of data in the historical data table, and writing the editing time of the editing operation into a corresponding extinction field;
if the corresponding base version data table at a time point is required to be inquired, acquiring data of which the time recorded in the first time field is earlier than or equal to the time point from the base version data table;
acquiring data of which the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point from a historical data table;
and merging the data acquired from the base data table and the data acquired from the historical data table.
From the above description, the beneficial effects of the present invention are: the data volume of the historical data table can be reduced, the storage space of the historical data table is saved, and the historical section data at any time point can be quickly inquired.
Further, before the step of creating the base version data table and the corresponding history data table, the step of:
and creating a batch number sequence, wherein the batch numbers in the batch number sequence are sequentially ordered from small to large.
Further, after "adding the first time field in the base version data table", the method further includes:
and according to the time sequence of the editing operation, associating the time under the first time field with the batch numbers sequentially taken out from the batch number sequence.
Further, if an edit operation is performed on a piece of data in the base data table, recording the piece of data before editing in a history data table corresponding to the base data table, recording time recorded in a first time field of the piece of data before editing in a second time field corresponding to the piece of data in the history data table, and writing edit time of the edit operation in a corresponding extinction field specifically:
if one data in the base data table is edited, recording the data before editing into a historical data table corresponding to the base data table;
recording the batch number recorded in the first time field of the data before editing into a second time field corresponding to the data in the historical data table;
and writing the batch number corresponding to the editing time of the editing operation into the corresponding extinction field.
Further, if the corresponding base version data table at a time point is to be queried, acquiring data recorded in the first time field from the base version data table, where the time is earlier than or equal to the time point; the specific steps of obtaining, from the historical data table, data that the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point are:
if a corresponding base plate data table at a time point needs to be inquired, acquiring a batch number corresponding to the time point;
acquiring data of a batch number recorded in a first time field, which is less than or equal to a batch number corresponding to the time point, from a base data table;
and acquiring data that the batch number recorded in the second time field is less than or equal to the batch number corresponding to the time point and the batch number recorded in the extinction field is greater than the batch number corresponding to the time point from the historical data table.
Further, after the step of obtaining the batch number corresponding to the time point, the method further includes:
and if the time point has no corresponding batch number, acquiring a batch number which is adjacent to the time point and is corresponding to the editing time earlier than the time point from the association relationship between the editing time and the batch number as the batch number corresponding to the time point.
According to the description, the batch numbers sequenced from small to large are used for replacing the editing time, so that the storage space is further saved, and the power grid management personnel can visually know the editing sequence.
Referring to fig. 5, the present invention further provides a power grid historical data management system, including:
the first establishing module is used for establishing a base version data table and a corresponding historical data table;
the adding module is used for adding a first time field in the base version data table, adding a second time field and a death field in the historical data table, and the first time field is used for recording the latest editing time;
the recording module is used for recording the data before editing into a historical data table corresponding to the base data table if the editing operation is carried out on the data in the base data table, recording the time recorded in a first time field of the data before editing into a second time field corresponding to the data in the historical data table, and writing the editing time of the editing operation into a corresponding extinction field;
the first obtaining module is used for obtaining data of which the time recorded in the first time field is earlier than or equal to a time point from the base version data table if the corresponding base version data table at the time point is required to be inquired;
the second acquisition module is used for acquiring data, recorded in the second time field, of which the time is earlier than or equal to the time point and the recorded in the death field is later than the time point from the historical data table;
and the merging module is used for merging the data acquired from the base version data table and the data acquired from the historical data table.
Further, still include:
and the second creating module is used for creating a batch number sequence, and the batch numbers in the batch number sequence are sequentially ordered from small to large.
Further, still include:
and the association module is used for associating the time under the first time field with the batch numbers sequentially taken out from the batch number sequence according to the time sequence of the editing operation.
Further, the recording module includes:
the device comprises a first recording unit, a second recording unit and a third recording unit, wherein the first recording unit is used for recording a piece of data before editing into a historical data table corresponding to a base data table if the editing operation is carried out on the piece of data in the base data table;
the second recording unit is used for recording the batch number recorded in the first time field of the data before editing into a second time field corresponding to the data in the historical data table;
and the writing unit is used for writing the batch number corresponding to the editing time of the editing operation into the corresponding extinction field.
Further, the first obtaining module comprises:
the first obtaining unit is used for obtaining a batch number corresponding to a time point if a corresponding base plate data table at the time point needs to be inquired;
the second obtaining unit is used for obtaining data of the batch number recorded in the first time field, which is less than or equal to the batch number corresponding to the time point, from the base data table;
the second obtaining module is specifically configured to obtain, from the historical data table, data in which the batch number recorded in the second time field is less than or equal to the batch number corresponding to the time point, and the batch number recorded in the extinction field is greater than the batch number corresponding to the time point.
Further, the first obtaining module further includes:
and a third obtaining unit, configured to, if there is no corresponding batch number at the time point, obtain, in the association relationship between the editing time and the batch number, a batch number that is adjacent to the time point and that corresponds to an editing time that is earlier than the time point, as the batch number corresponding to the time point.
Example one
The first embodiment of the invention is as follows: a power grid historical data management method; in the invention, the power grid resource data (including graphic data and equipment ledger data) are stored and managed in three states of an operation state, an editing state and a history state. The three states of the running state, the editing state and the historical state of the power grid resource data are stored by three sets of data tables which are respectively a base plate data table, a version data table and a historical data table.
The operation state is as follows: the current grid rack data, and the ledger data of all equipment, including equipment left in transit, return transit, and on-site.
And (3) editing state: the modification process of the graph and the equipment standing book is managed through a task management mechanism, the graph and the equipment standing book data modified in the tasks are stored in an editing state, and the running state data can be influenced only by modifying the data after the tasks are issued. The editing state plays a role in isolation from the running state, and the controllability, the order and the safety of the change process of the running state resource data are ensured.
History state: the historical state data of the power grid and the equipment account are stored, and the complete change modification process of the data of the power grid and the equipment account is recorded, so that the functions of a power grid GIS multi-temporal version and an equipment account section are realized, and browsing and checking of a historical power grid network frame and the equipment account are realized.
The power grid data flow diagram is shown in fig. 2. The equipment can be edited by the graphical modeling client under the editing state of the GIS through adding or changing the equipment in the planning and construction processes of the power grid. And the change of the equipment enters a version data table of the space-time power grid model, and is verified and released, so that the change of the equipment is transferred from the version data table to a base version data table. The base data table stores the operating state power grid data. In the operation state, the state of the equipment can be directly modified by the specialties of scheduling, marketing, communication and the like, namely the data of the base version data table is changed. Any data change occurring on the base version data table can archive the data before change to the historical data table, and the historical data can be inquired and counted later. When all the equipment data of a certain historical time point are inquired and counted, one part of data is not changed until now, the other part of data is changed in the current base version data table, the past data is stored in the historical data table, and the two parts are combined to obtain all the data of the historical time point.
As shown in fig. 3, the method comprises the steps of:
s1: and creating a base version data table and a corresponding historical data table.
S2: adding a first time field in the base version data table, and adding a second time field and a death field in the historical data table; the first time field is used for recording the time of the latest edition. The structure of the base data table is shown in table 1, and the structure of the history data table is shown in table 2.
Figure BDA0001191971280000071
TABLE 1
Figure BDA0001191971280000081
TABLE 2
S3: and if the editing operation is carried out on one data in the base data table, recording the data before editing into a historical data table corresponding to the base data table. It can be seen that the historical data table only records the deleted and modified data in the base version data table, and the historical data table does not record when data is newly added in the base version data table.
S4: recording the time recorded in the first time field of the data before editing into the second time field corresponding to the data in the historical data table, and writing the editing time of the editing operation into the corresponding extinction field. That is, the second time field in the history data table records the last editing time of the data, and the death field records the current editing time, that is, the latest editing time. If one datum in the base data table is edited for multiple times, multiple records are recorded in the historical data table.
S5: and if the corresponding base version data table at a time point is required to be inquired, acquiring the data of which the time recorded in the first time field is earlier than or equal to the time point from the base version data table.
S6: and acquiring data of which the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point from the historical data table.
S7: and combining the data acquired from the base plate data table and the data acquired from the historical data table to obtain the base plate data table corresponding to the time point, namely the historical section data of the time point.
In the embodiment, only the deleted and modified data in the base version data table are stored in the historical data table, so that the data volume of the historical data table can be reduced, and the storage space of the historical data table is saved; the latest editing time is recorded in the base data table, the last editing time and the last editing time of the edited data are recorded in the historical data table, and the historical data are managed based on the data superposition mode of the base data table and the historical data table, so that the historical data at the appointed time point can be accurately extracted, and the effective retention of the historical data is realized.
Example two
Referring to fig. 4, the present embodiment is a further development of the first embodiment. If the time is directly recorded, the recorded data is too long, a large storage space needs to be occupied, and for the power grid data, the data needs to be edited frequently, so that the occupied space is further increased, and therefore batch numbers which are ordered from small to large are adopted to replace the editing time, which is specifically described below.
The step S1 is preceded by:
s11: and creating a batch number sequence, wherein the batch numbers in the batch number sequence are sequentially ordered from small to large. Preferably, the sequence of lot numbers may be an increasing natural number sequence, such as 0, 1, 2 … …
The step S2 is followed by:
s22: according to the time sequence of the editing operation, associating the time under the first time field with the batch numbers sequentially taken out from the batch number sequence, and replacing the time recorded under the first time field with the corresponding batch numbers; that is, when editing, the editing time is associated with the sequentially taken lot numbers, and the lot numbers are stored in the association relationship, and then written in the first time field.
The step S4 specifically includes:
s44: recording the batch number recorded in the first time field of the data before editing into a second time field corresponding to the data in the historical data table; and writing the batch number corresponding to the editing time of the editing operation into the corresponding extinction field.
The steps S5-S6 are specifically:
s551: and if the corresponding base plate data table at a time point needs to be inquired, acquiring the batch number corresponding to the time point. Further, if there is no corresponding batch number at the time point, a batch number corresponding to an editing time adjacent to and earlier than the time point is obtained in the association relationship between the editing time and the batch number as the batch number corresponding to the time point.
S552: and acquiring data of the batch number recorded in the first time field, which is less than or equal to the batch number corresponding to the time point, from the base data table.
S66: and acquiring data that the batch number recorded in the second time field is less than or equal to the batch number corresponding to the time point and the batch number recorded in the extinction field is greater than the batch number corresponding to the time point from the historical data table.
According to the embodiment, the batch numbers sequenced from small to large are used for replacing the editing time, so that the storage space is further saved, and the power grid management personnel can visually know the sequence of editing.
EXAMPLE III
The present embodiment is a specific application scenario corresponding to the above embodiment.
Assuming that a base version data table a exists, six new pieces of data are added as shown in table 3, and the corresponding history data table a _ HIS is shown in table 4.
Figure BDA0001191971280000101
TABLE 3
Figure BDA0001191971280000102
TABLE 4
If the data with the ID of 3 is modified later, the Fld1 is modified into Fld 1', before the base version data table A is modified, the data with the ID of 3 is copied to the historical data table A _ HIS, the second time field is the data of the first time field before modification, and then the batch number corresponding to the modification time is written into the death field ENDTIMEID; after the copying is completed, the data with the ID of 3 in the base version data table A is modified. After the modification is completed, the base version data table is shown in table 5, and the history data table is shown in table 6.
Figure BDA0001191971280000103
Figure BDA0001191971280000111
TABLE 5
Figure BDA0001191971280000112
TABLE 6
If the data with the ID of 3 and the data with the ID of 4 are deleted later, copying the data with the ID of 3 and the data with the ID of 4 to a historical data table A _ HIS before deleting the base version data table A, and writing the batch number corresponding to the deletion time into a deletion field ENDTIMEID; after the copying is completed, the data with the ID of 3 and the ID of 4 in the base data table a is deleted. After the deletion is completed, the base version data table is shown in table 7, and the history data table is shown in table 8.
Figure BDA0001191971280000113
TABLE 7
Figure BDA0001191971280000114
TABLE 8
At this time, if data at the time point corresponding to the batch number 101 is to be searched, data with a TIMEID1 being less than or equal to 101 is searched in the base data table, data with a TIMEID2 being less than or equal to 101and a TIMEID ENDTIMEID being greater than 101 is searched in the historical data table, and the data at the time point can be obtained by superposing and merging the two pieces of data.
Specifically, the SQL statement may be: select id, name, fldname1, …, timeid, … from A where select id1< (101 units all), name, fldname1, …, stated, … from A _ HIS where select 2< (101) and end >101
Example four
Referring to fig. 6, the present embodiment is a power grid historical data management system corresponding to the foregoing embodiment, including:
the first creating module 1 is used for creating a base version data table and a corresponding historical data table;
the adding module 2 is used for adding a first time field in the base version data table, adding a second time field and a death field in the historical data table, wherein the first time field is used for recording the time of the latest edition;
the recording module 3 is configured to record, if an editing operation is performed on data in a base data table, the data before editing into a historical data table corresponding to the base data table, record time recorded in a first time field of the data before editing into a second time field corresponding to the data in the historical data table, and write editing time of the editing operation into a corresponding extinction field;
a first obtaining module 4, configured to obtain, from a base data table, data at a time point when the time recorded in a first time field is earlier than or equal to a time point if a corresponding base data table at the time point is to be queried;
a second obtaining module 5, configured to obtain, from the historical data table, data in which the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point;
and the merging module 6 is used for merging the data acquired from the base version data table and the data acquired from the historical data table.
Further, still include:
and the second creating module 7 is used for creating a batch number sequence, and the batch numbers in the batch number sequence are sequentially sorted from small to large.
Further, still include:
and the association module 8 is used for associating the time in the first time field with the batch numbers sequentially taken out from the batch number sequence according to the time sequence of the editing operation.
Further, the recording module 3 includes:
a first recording unit 31, configured to record, if an editing operation is performed on one data in a base data table, the one data before being edited into a history data table corresponding to the base data table;
a second recording unit 32, configured to record the batch number recorded in the first time field of the piece of data before editing into a second time field corresponding to the piece of data in the history data table;
a writing unit 33, configured to write the batch number corresponding to the editing time of the editing operation into the corresponding extinction field.
Further, the first obtaining module 4 includes:
a first obtaining unit 41, configured to obtain a batch number corresponding to a time point if a corresponding base version data table at the time point is to be queried;
a second obtaining unit 42, configured to obtain, from the base data table, data of a batch number recorded in the first time field, which is less than or equal to a batch number corresponding to the time point;
the second obtaining module 5 is specifically configured to obtain, from the historical data table, data in which the batch number recorded in the second time field is less than or equal to the batch number corresponding to the time point, and the batch number recorded in the extinction field is greater than the batch number corresponding to the time point.
Further, the first obtaining module 4 further includes:
a third obtaining unit 43, configured to, if there is no corresponding batch number at the time point, obtain, in the association relationship between the editing time and the batch number, a batch number corresponding to the editing time that is adjacent to and earlier than the time point as the batch number corresponding to the time point.
In summary, according to the power grid historical data management method and the power grid historical data management system, only the deleted and modified data in the base version data table are stored in the historical data table, so that the data amount of the historical data table can be reduced, and the storage space of the historical data table can be saved; the latest editing time is recorded in the base data table, the last editing time and the last editing time of the edited data are recorded in the historical data table, and the historical data are managed based on the data superposition mode of the base data table and the historical data table, so that the historical data at the appointed time point can be accurately extracted, and the effective retention of the historical data is realized. By replacing the editing time with the batch numbers sequenced from small to large, the storage space is further saved, and the power grid management personnel can intuitively know the sequence of editing.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (10)

1. A power grid historical data management method is characterized by comprising the following steps:
creating a base version data table and a corresponding historical data table;
adding a first time field in the base version data table, and adding a second time field and a death field in the historical data table, wherein the first time field is used for recording the time of the latest edition;
if editing operation is carried out on data in a base data table, recording the data before editing into a historical data table corresponding to the base data table, recording time recorded in a first time field of the data before editing into a second time field corresponding to the data in the historical data table, writing editing time of the editing operation into a corresponding extinction field, and only recording deleted and modified data in the base data table in the historical data table;
if the corresponding base version data table at a time point is required to be inquired, acquiring data of which the time recorded in the first time field is earlier than or equal to the time point from the base version data table;
acquiring data of which the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point from a historical data table;
and merging the data acquired from the base data table and the data acquired from the historical data table.
2. The power grid historical data management method according to claim 1, wherein before creating the base version data table and the corresponding historical data table, the method further comprises:
and creating a batch number sequence, wherein the batch numbers in the batch number sequence are sequentially ordered from small to large.
3. The grid historical data management method according to claim 2, wherein the step of "adding the first time field to the base version data table" further comprises:
and according to the time sequence of the editing operation, associating the time under the first time field with the batch numbers sequentially taken out from the batch number sequence.
4. The power grid historical data management method according to claim 3, wherein if an editing operation is performed on one data in a base data table, the step of recording the one data before editing in a historical data table corresponding to the base data table, the step of recording the time recorded in a first time field of the one data before editing in a second time field corresponding to the one data in the historical data table, and the step of writing the editing time of the editing operation in a corresponding extinction field specifically includes:
if one data in the base data table is edited, recording the data before editing into a historical data table corresponding to the base data table;
recording the batch number recorded in the first time field of the data before editing into a second time field corresponding to the data in the historical data table;
and writing the batch number corresponding to the editing time of the editing operation into the corresponding extinction field.
5. The power grid historical data management method according to claim 4, wherein if a corresponding base version data table at a time point is to be queried, the data recorded in the first time field is obtained from the base version data table, wherein the time is earlier than or equal to the time point; the specific steps of obtaining, from the historical data table, data that the time recorded in the second time field is earlier than or equal to the time point and the time recorded in the death field is later than the time point are:
if a corresponding base plate data table at a time point needs to be inquired, acquiring a batch number corresponding to the time point;
acquiring data of a batch number recorded in a first time field, which is less than or equal to a batch number corresponding to the time point, from a base data table;
and acquiring data that the batch number recorded in the second time field is less than or equal to the batch number corresponding to the time point and the batch number recorded in the extinction field is greater than the batch number corresponding to the time point from the historical data table.
6. The grid historical data management method according to claim 5, wherein after the step of obtaining the batch number corresponding to the time point, the method further comprises:
and if the time point has no corresponding batch number, acquiring a batch number which is adjacent to the time point and is corresponding to the editing time earlier than the time point from the association relationship between the editing time and the batch number as the batch number corresponding to the time point.
7. A power grid historical data management system, comprising:
the first establishing module is used for establishing a base version data table and a corresponding historical data table;
the adding module is used for adding a first time field in the base version data table, adding a second time field and a death field in the historical data table, and the first time field is used for recording the latest editing time;
the recording module is used for recording the data before editing into a historical data table corresponding to the base data table if the data in the base data table is edited, recording the time recorded in a first time field of the data before editing into a second time field corresponding to the data in the historical data table, and writing the editing time of the editing operation into a corresponding extinction field, wherein the historical data table only records the deleted and modified data in the base data table;
the first obtaining module is used for obtaining data of which the time recorded in the first time field is earlier than or equal to a time point from the base version data table if the corresponding base version data table at the time point is required to be inquired;
the second acquisition module is used for acquiring data, recorded in the second time field, of which the time is earlier than or equal to the time point and the recorded in the death field is later than the time point from the historical data table;
and the merging module is used for merging the data acquired from the base version data table and the data acquired from the historical data table.
8. The grid historical data management system of claim 7, further comprising:
and the second creating module is used for creating a batch number sequence, and the batch numbers in the batch number sequence are sequentially ordered from small to large.
9. The grid historical data management system of claim 8, further comprising:
and the association module is used for associating the time under the first time field with the batch numbers sequentially taken out from the batch number sequence according to the time sequence of the editing operation.
10. The grid historical data management system of claim 9, wherein the logging module comprises:
the device comprises a first recording unit, a second recording unit and a third recording unit, wherein the first recording unit is used for recording a piece of data before editing into a historical data table corresponding to a base data table if the editing operation is carried out on the piece of data in the base data table;
the second recording unit is used for recording the batch number recorded in the first time field of the data before editing into a second time field corresponding to the data in the historical data table;
and the writing unit is used for writing the batch number corresponding to the editing time of the editing operation into the corresponding extinction field.
CN201611217138.2A 2016-12-26 2016-12-26 Power grid historical data management method and system Active CN106802928B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611217138.2A CN106802928B (en) 2016-12-26 2016-12-26 Power grid historical data management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611217138.2A CN106802928B (en) 2016-12-26 2016-12-26 Power grid historical data management method and system

Publications (2)

Publication Number Publication Date
CN106802928A CN106802928A (en) 2017-06-06
CN106802928B true CN106802928B (en) 2020-10-09

Family

ID=58984936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611217138.2A Active CN106802928B (en) 2016-12-26 2016-12-26 Power grid historical data management method and system

Country Status (1)

Country Link
CN (1) CN106802928B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609038B (en) * 2017-08-14 2020-08-07 华为技术有限公司 Data cleaning method and device
CN109345371A (en) * 2018-08-30 2019-02-15 成都数联铭品科技有限公司 Personal reference report backtracking method and system
CN111694908B (en) * 2019-03-15 2024-06-14 丰图科技(深圳)有限公司 Data storage method, device and storage medium
CN111523291B (en) * 2020-04-21 2023-04-18 四川川大智胜软件股份有限公司 Low-altitude radar multi-seat airspace data editing method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010018692A1 (en) * 1999-12-21 2001-08-30 Hiroshi Suginoshita Database system, method for forming replica of database, and computer-readable recording medium that records database replica forming program
CN103049510A (en) * 2012-12-14 2013-04-17 金华电业局 Historical broadcasting method for power grid monitoring data based on file storage
CN106201780A (en) * 2016-07-08 2016-12-07 浪潮通用软件有限公司 Historical data reduction method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010018692A1 (en) * 1999-12-21 2001-08-30 Hiroshi Suginoshita Database system, method for forming replica of database, and computer-readable recording medium that records database replica forming program
CN103049510A (en) * 2012-12-14 2013-04-17 金华电业局 Historical broadcasting method for power grid monitoring data based on file storage
CN106201780A (en) * 2016-07-08 2016-12-07 浪潮通用软件有限公司 Historical data reduction method

Also Published As

Publication number Publication date
CN106802928A (en) 2017-06-06

Similar Documents

Publication Publication Date Title
Schram et al. MySQL to NoSQL: data modeling challenges in supporting scalability
DE112012005037B4 (en) Manage redundant immutable files using deduplications in storage clouds
CN103678494B (en) Client synchronization services the method and device of end data
CN106802928B (en) Power grid historical data management method and system
CN107958057A (en) A kind of code generating method and device for being used for Data Migration in heterogeneous database
CN104252452A (en) Data management method and device
CN111382956A (en) Enterprise group relationship mining method and device
CN109508355A (en) A kind of data pick-up method, system and terminal device
CN103761189A (en) Test case management method and system
CN102779037B (en) A kind of automatic generation and the unified visual programming method safeguarding java project
CN104361018A (en) Method and device for reorganizing electronic file information
CN104794048A (en) Automatic UI testing method and system
CN106708941B (en) The online synergic editing method of power grid multitask
CN108536745A (en) Tables of data extracting method, terminal, equipment and storage medium based on Shell
CN105224527A (en) Be applicable to the general ETL method of multiple object table update mode
CN110019469A (en) Distributed data base data processing method, device, storage medium and electronic device
CN114218218A (en) Data processing method, device and equipment based on data warehouse and storage medium
CN110457333A (en) Data real time updating method, device and computer readable storage medium
CN108446326A (en) A kind of isomeric data management method and system based on container
CN103473332A (en) Data archive repository with virtual test architecture
CN106155838A (en) A kind of database back-up data restoration methods and device
CN114255010A (en) Electronic file archival management and knowledge service collaborative implementation method in electronic government platform
CN110110072A (en) A kind of method, system, terminal and storage medium generating interactive electronic handbook
CN106780157B (en) Ceph-based power grid multi-temporal model storage and management system and method
CN116401407A (en) Node attribute configuration method, device, equipment and storage medium of mind map

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CB03 Change of inventor or designer information

Inventor after: Li Qiang

Inventor after: Zhao Jianwei

Inventor after: Xiang Weishan

Inventor after: Liu Guangcao

Inventor after: Cai Xirong

Inventor after: Chang Chang

Inventor after: Qiu Heqing

Inventor after: Chen Sheng

Inventor after: Zhao Guang

Inventor after: Zhao Feng

Inventor before: Xiang Weishan

Inventor before: Liu Guangcao

Inventor before: Cai Xirong

Inventor before: Chang Chang

Inventor before: Qiu Heqing

Inventor before: Chen Sheng

Inventor before: Zhao Guang

CB03 Change of inventor or designer information