CN113360571A - Characteristic mark-based power grid monitoring system memory database relation database synchronization method - Google Patents

Characteristic mark-based power grid monitoring system memory database relation database synchronization method Download PDF

Info

Publication number
CN113360571A
CN113360571A CN202110621701.7A CN202110621701A CN113360571A CN 113360571 A CN113360571 A CN 113360571A CN 202110621701 A CN202110621701 A CN 202110621701A CN 113360571 A CN113360571 A CN 113360571A
Authority
CN
China
Prior art keywords
data
newly added
relational database
writing
added data
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.)
Pending
Application number
CN202110621701.7A
Other languages
Chinese (zh)
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.)
Guangdong Power Grid Co Ltd
Zhuhai Power Supply Bureau of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Zhuhai Power Supply Bureau of Guangdong Power Grid 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 Guangdong Power Grid Co Ltd, Zhuhai Power Supply Bureau of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202110621701.7A priority Critical patent/CN113360571A/en
Priority to PCT/CN2021/103157 priority patent/WO2022252322A1/en
Priority to DE112021007528.4T priority patent/DE112021007528T5/en
Publication of CN113360571A publication Critical patent/CN113360571A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • 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
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • 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/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply

Abstract

The application relates to a method and a device for synchronizing a database relation of a power grid monitoring system based on feature marks, computer equipment and a storage medium, wherein the method comprises the following steps: writing the newly added data into a data cache region of the memory database and marking the newly added data; writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database; and writing the newly added data temporarily stored in the cache file into the relational database according to the mark. According to the method and the device, the newly added data are marked, the newly added data temporarily stored in the cache file are written into the relational database, the problem that the data of the memory database can be synchronized only at intervals is solved, the system data can be synchronized rapidly, and the efficiency of data synchronization between the memory relational databases of the power grid monitoring system based on the characteristic marks is improved.

Description

Characteristic mark-based power grid monitoring system memory database relation database synchronization method
Technical Field
The present application relates to the field of power grid monitoring technologies, and in particular, to a method and an apparatus for synchronizing a database relationship of a power grid monitoring system based on a feature tag, a computer device, and a storage medium.
Background
A memory database and a relational database generally exist in a power grid monitoring system; the memory database is a database which directly operates by placing data in a memory, and stores the data in the memory by utilizing the characteristics that the read-write speed of the memory is higher than that of a magnetic disk, the memory is randomly accessed and the magnetic disk is sequentially accessed; the relational database is a database which organizes, stores and manages data according to a certain data structure and model, and the database built by adopting the relational model is called the relational database.
In a system, a memory database and a relational database are generally coexisted, newly added data are generally stored in the memory database at first, and after a preset time, the newly added data are transferred from the memory database to the relational database for permanent storage; however, if the newly added data stored in the memory database is lost before the preset time due to the power failure of the system, the unloading synchronization of the newly added data is affected, and the unloading efficiency of the existing newly added data is low.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, an apparatus, a computer device, and a storage medium for synchronizing a database relation of a power grid monitoring system based on a signature.
A power grid monitoring system memory relation database synchronization method based on feature labels comprises the following steps:
writing the newly added data into a data cache region of a memory database and marking the newly added data;
writing the newly added data with the marks into a cache file of a relational database according to the mapping relation between the data cache region and the cache file of the relational database;
and writing the newly-added data temporarily stored in the cache file into the relational database according to the mark.
In one embodiment, the writing the new data into the data cache region of the in-memory database and marking the new data includes:
detecting the newly added data;
writing the newly added data into the data cache region of the memory database;
and marking the newly added data stored in the data cache region.
In one embodiment, the writing the newly added data with the tag into a cache file of a relational database according to a mapping relationship between the data cache region and the cache file of the relational database includes:
establishing a mapping relation between the data cache region and the cache file of the relational database according to a memory mapping technology;
and writing the newly added data with the marks into the cache file of the relational database according to the mapping relation.
In one embodiment, the writing, according to the flag, the new data temporarily stored in the cache file into the relational database includes:
comparing and matching the marks of the newly added data with the marks stored in the relational database to obtain a mark comparison and matching result;
and writing the newly-added data temporarily stored in the cache file into a corresponding interval of the relational database according to the mark comparison matching result.
In one embodiment, after writing the new data temporarily stored in the cache file into the relational database according to the flag, the method includes:
and deleting the newly added data in the cache file.
In one embodiment, the relational database is at least one of MySQL, Oracle and DB 2.
In one embodiment, the in-memory database is at least one of Redis, SQLite, and MongoDB.
A power grid monitoring system memory relational database synchronization device based on feature labels, the device comprises:
the data marking module is used for writing the newly added data into a data cache region of the memory database and marking the newly added data;
the data writing module is used for writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database;
and the data storage module is used for writing the newly-added data temporarily stored in the cache file into the relational database according to the mark.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
writing the newly added data into a data cache region of a memory database and marking the newly added data;
writing the newly added data with the marks into a cache file of a relational database according to the mapping relation between the data cache region and the cache file of the relational database;
and writing the newly-added data temporarily stored in the cache file into the relational database according to the mark.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
writing the newly added data into a data cache region of a memory database and marking the newly added data;
writing the newly added data with the marks into a cache file of a relational database according to the mapping relation between the data cache region and the cache file of the relational database;
and writing the newly-added data temporarily stored in the cache file into the relational database according to the mark.
The method, the device, the computer equipment and the storage medium for synchronizing the database relation library of the power grid monitoring system based on the feature tag comprise the following steps: writing the newly added data into a data cache region of the memory database and marking the newly added data; writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database; and writing the newly added data temporarily stored in the cache file into the relational database according to the mark. According to the method and the device, the newly added data are marked, and the newly added data temporarily stored in the cache file are written into the relational database, so that the problem that the data can be synchronized by the memory database at intervals is solved, the system data can be quickly synchronized, and the efficiency of data synchronization between the memory relational databases of the power grid monitoring system based on the characteristic marks is improved.
Drawings
Fig. 1 is an application environment diagram of a method for synchronizing a database relation of a power grid monitoring system based on a feature tag in an embodiment;
fig. 2 is a schematic flowchart of a method for synchronizing a database relation of a power grid monitoring system based on a feature tag in an embodiment;
FIG. 3 is a flowchart illustrating steps of writing new data into a data cache region of a memory database and marking the new data according to an embodiment;
FIG. 4 is a flowchart illustrating steps in writing new data with tags into a cache file of a relational database according to an embodiment;
fig. 5 is a schematic flowchart of a method for synchronizing a database relation of a power grid monitoring system based on a signature in another embodiment;
fig. 6 is a block diagram illustrating a structure of a database-relational database synchronization apparatus of a power grid monitoring system based on a signature in an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for synchronizing the databases in the power grid monitoring system based on the feature labels can be applied to the application environment shown in fig. 1. Wherein the terminal 11 communicates with the server 12 via a network. The server 12 receives data sent by the terminal 11 as new data, and the server 12 writes the new data into a data cache region of the memory database and marks the new data; the server 12 writes the newly added data with the tag into the cache file of the relational database according to the mapping relationship between the data cache region and the cache file of the relational database; the server 12 writes the newly added data temporarily stored in the cache file into the relational database according to the mark; the server 12 returns the processing result of the new data to the terminal 11.
The terminal 11 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 12 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, a method for synchronizing databases in a power grid monitoring system based on a signature is provided, which is described by taking the method as an example applied to the server 12 in fig. 1, and includes the following steps:
and step 21, writing the newly added data into a data cache region of the memory database and marking the newly added data.
The memory database is a database which is directly operated by putting data in a memory, the data is stored in the memory by utilizing the characteristics that the read-write speed of the memory is higher than that of a disk, the memory is randomly accessed and the disk is sequentially accessed, a table structure and an index structure are simulated and established in the memory and the memory characteristics are optimized, and the memory database is accessed more quickly than the memory database accessed from the disk. The data processed by the in-memory database is typically "transient," i.e., has a certain validity time.
The new data may be data received by the server and transmitted by the external device, and the data may be represented by text information, image information, or notification information, which is not limited herein. And the external device may be a router, switch, server, cloud platform, or other data transfer communication device. The new data may be generated by a human operation or generated by a sensor, such as data generated by an operation instruction input by a user or a trigger signal generated by the sensor due to a change in external environment.
The new data can be marked by ID of the added data identification, so that the new data has uniqueness. For example, the initial newly added data is marked as "a 001", the subsequently received newly added data can be marked as "B002", and so on, and when the newly added data is stored in the subsequent relational database, the storage ordering can be performed according to the mark, so that the data storage is more organized.
The in-memory database may be a Remote Dictionary service (Redis), a lightweight database (SQLite), or a MongoDB (a database based on distributed file storage).
Specifically, the newly added data carries identification information, and the identification information may be a data type of the newly added data or mark information of the data when the data is generated; the server can determine a memory database corresponding to the newly added data and a specific data cache area which can be used for storage in the memory database according to the identification information; and then, the server marks the newly added data, and the marking action can be carried out simultaneously with the storage, or can be carried out before or after the storage.
And step 22, writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database.
A relational database refers to a database that organizes, stores, and manages data according to a certain data structure and model. The database built by adopting the relational model is called a relational database. The relational database is established on the basis of set algebra, and data in the database is processed by applying a mathematical method. Relational databases are processing permanent, stable data.
The mapping relation between the data cache region and the cache files of the relational database can be established according to a mapping function; and by utilizing the mapping relation, the newly added data stored in the memory database can be quickly transferred to the cache file of the relational database.
The relational database may be MySQL (a relational database management system), Oracle (also known as Oracle RDBMS, a relational database management system with a distributed database as a core), and DB2 (a relational database management system mainly applied to large-scale application systems).
Specifically, the server acquires a preset mapping relationship, and identifies a cache file matched with the identifier according to the identifier of the data cache region as a cache file of the relational database in which the newly added data is written.
And step 23, writing the newly added data temporarily stored in the cache file into the relational database according to the mark.
Specifically, the server transfers the newly added data from the cache file of the relational database to the relational database, so that the newly added data is stored in the relational database from the memory database. The centralized control of the newly added data can be realized through the relational database, and the data can be independent of an application program, so that convenience is provided for the use, adjustment, optimization and further expansion of the data. The relational database is formed according to a certain structural form, newly-added data are mutually related between the record interior and the record type, the data can be accessed through different paths, and the data acquisition and processing speed is high.
Further, in the method for synchronizing the internal memory relational database of the power grid monitoring system based on the feature tag, the newly added data is written into the data cache region of the internal memory database, and the newly added data is tagged; then, according to the mapping relation between the data cache region of the memory database and the cache file of the relational database, the marked new data is firstly written into the cache file of the relational database; and then, the newly added data temporarily stored in the cache file is written into the relational database according to the mark, the data temporarily stored in the memory database does not need to be transferred and synchronized into the relational database after waiting for a period of time as in the prior art, the problem that the memory database needs to synchronize the data at intervals of a period of time is well solved, the system data can be quickly synchronized, and the efficiency of data synchronization between the memory databases of the power grid monitoring system based on the characteristic mark is improved.
In the method for synchronizing the internal memory relational database of the power grid monitoring system based on the characteristic mark, newly added data are written into a data cache region of an internal memory database and marked; writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database; and writing the newly added data temporarily stored in the cache file into the relational database according to the mark. According to the method and the device, the newly added data are marked, the newly added data temporarily stored in the cache file are written into the relational database, the problem that the data of the memory database can be synchronized only at intervals is solved, the system data can be synchronized rapidly, and the efficiency of data synchronization between the memory relational databases of the power grid monitoring system based on the characteristic marks is improved.
In an embodiment, as shown in fig. 3, the step 21 of writing the new data into the data cache region of the in-memory database and marking the new data includes:
step 31, detecting new data;
step 32, writing the newly added data into a data cache region of the memory database;
and step 33, marking the newly added data stored in the data buffer area.
Specifically, the server detects the newly added data; if the new data is detected, writing the new data into a preset data cache region in the memory database; and the server marks the newly added data stored in the data cache region.
Specifically, the server periodically or implements detection on the incoming of the new data; the new added data also comprises a new file obtained after the original file is modified, and the server can judge whether the original file is modified and updated by comparing MD5, modification time, specific modification content and the like.
The new data may be detected periodically, and the set detection time interval may be 0.5ms or 1ms, which may be set by the user as needed.
In this embodiment, the server can store the newly added data into the data cache region as soon as possible according to the input characteristics of the newly added data and perform marking by performing timing or real-time detection on the newly added data, so as to achieve the effect of improving the efficiency of data synchronization between the databases in the power grid monitoring system based on the characteristic marking.
In an embodiment, as shown in fig. 4, the step 22 of writing the newly added data with the tag into the cache file of the relational database according to the mapping relationship between the data cache region and the cache file of the relational database includes:
step 41, establishing a mapping relation between the data cache region and a cache file of a relational database according to a memory mapping technology;
and 42, writing the newly added data with the marks into a cache file of the relational database according to the mapping relation.
The memory mapping technology can be a mapping function mode, and a one-to-one mapping relation is established between the data cache region and the cache file by using the mapping function.
Specifically, the server establishes a mapping relationship between the data cache region and the cache files of the relational database by using a memory mapping technology, and can establish a one-to-one mapping relationship between the data cache region and the cache files by using a mapping function; and then writing the newly added data with the marks into a cache file of the relational database according to the established mapping relation.
In the embodiment, the server establishes connection between the cache file of the relational database and the data cache region through a memory mapping technology, so that the newly added data can be directionally transferred and stored in the target cache file, and the efficiency of data synchronization between the databases of the power grid monitoring system based on the characteristic marks is improved.
In an embodiment, in step 23, writing, according to the flag, the new data temporarily stored in the cache file into the relational database, includes: comparing and matching the mark of the newly added data with the stored mark in the relational database to obtain a mark comparison and matching result; and writing the newly added data temporarily stored in the cache file into the corresponding interval of the relational database according to the mark comparison matching result.
The data stored in the relational database is marked, and the marks in the newly added data and the marks stored in the relational database are compared and matched to obtain a mark comparison and matching result; and then, writing the newly added data temporarily stored in the cache file into a corresponding interval of the relational database according to the mark comparison matching result. For example, the newly added data is marked as "003", when the newly added data is compared and matched with the mark of the already stored data in the relational database, the data marked as "002" is searched, and then the newly added data is stored in the storage interval of the data marked as "002", so that the data storage is more organized.
The server of the embodiment compares and matches the marks of the newly added data with the stored marks in the relational database to obtain a mark comparison and matching result; according to the mark comparison and matching result, the newly added data temporarily stored in the cache file are written into the corresponding interval of the relational database, and the newly added data can be stored in the relational database according to the mark sequence, so that the newly added data are displayed in the relational database according to the transmitted sequence, and the usability of subsequent data use, extraction and the like is improved.
In an embodiment, the step 23, after writing the new data temporarily stored in the cache file into the relational database according to the flag, includes: and deleting the newly added data in the cache file.
Specifically, after the server writes the new data into the relational database, the server may perform the deletion of the new data in the cache file, so that the cache file is fully utilized, and only the new data is temporarily stored each time as a transition before being stored into the relational database. Meanwhile, the cache file can keep higher memory capacity after being deleted every time, and subsequently newly added data can be directly transferred, so that the turnover efficiency of the newly added data is improved.
In the embodiment, after the newly added data temporarily stored in the cache file is written into the relational database, the newly added data in the cache file is deleted, so that the cache file can keep a larger available memory, and the subsequently added data can be stored conveniently.
In an embodiment, as shown in fig. 5, a further method for synchronizing databases of a grid monitoring system based on feature labels is provided, and the method is described by taking the server 12 in fig. 1 as an example, and includes the following steps:
step 51, writing the newly added data into a data cache region of the memory database and marking the newly added data;
step 52, writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database;
step 53, writing the newly added data temporarily stored in the cache file into the relational database according to the mark;
and step 54, deleting the newly added data in the cache file.
Specifically, after the server writes the new data into the relational database, the server also deletes the new data stored in the cache file of the relational database, so that the storage space can be well cleaned, unnecessary waste of the storage space can be avoided, and the storage overhead of the relational database can not be increased.
The server writes the newly added data into a data cache region of the memory database and marks the newly added data; writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database; writing the newly added data temporarily stored in the cache file into the relational database according to the mark; and deleting the newly added data in the cache file, so that the data can be cleared from the cache file after being stored in the relational database, and the overall operation efficiency of data synchronization between the database relational databases in the power grid monitoring system based on the characteristic marks is improved.
It should be understood that although the various steps in the flow charts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 6, there is provided a signature-based synchronization apparatus for a database of a power grid monitoring system, including: a data marking module 61, a data writing module 62 and a data storage module 63, wherein:
the data marking module 61 is configured to write the newly added data into a data cache region of the memory database and mark the newly added data;
a data writing module 62, configured to write the newly added data with the tag into the cache file of the relational database according to a mapping relationship between the data cache region and the cache file of the relational database;
and the data storage module 63 is configured to write the newly added data temporarily stored in the cache file into the relational database according to the flag.
In one embodiment, the data marking module 61 is further configured to detect new data; writing the newly added data into a data cache region of the memory database; and marking the newly added data stored in the data buffer area.
In an embodiment, the data writing module 62 is further configured to establish a mapping relationship between the data cache region and a cache file of the relational database according to a memory mapping technique; and writing the newly added data with the marks into a cache file of the relational database according to the mapping relation.
In an embodiment, the data storage module 63 is further configured to compare and match the tag of the newly added data with the stored tag in the relational database, so as to obtain a tag comparison and matching result; and writing the newly added data temporarily stored in the cache file into the corresponding interval of the relational database according to the mark comparison matching result.
In one embodiment, the data storage module 63 is further configured to delete the newly added data in the cache file.
For specific limitations of the synchronization apparatus for the power grid monitoring system memory relational database based on the feature tag, reference may be made to the above limitations of the synchronization method for the power grid monitoring system memory relational database based on the feature tag, which are not described herein again. All modules in the characteristic mark-based power grid monitoring system memory bank relational database synchronization device can be completely or partially realized through software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing synchronization data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a signature-based synchronization method for a database of a grid monitoring system.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
writing the newly added data into a data cache region of the memory database and marking the newly added data; the memory database is at least one of Redis, SQLite and MongoDB;
writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database; the relational database is at least one of MySQL, Oracle and DB 2;
and writing the newly added data temporarily stored in the cache file into the relational database according to the mark.
In one embodiment, the processor, when executing the computer program, further performs the steps of: detecting newly added data; writing the newly added data into a data cache region of the memory database; and marking the newly added data stored in the data buffer area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: establishing a mapping relation between a data cache region and a cache file of a relational database according to a memory mapping technology; and writing the newly added data with the marks into a cache file of the relational database according to the mapping relation.
In one embodiment, the processor, when executing the computer program, further performs the steps of: comparing and matching the mark of the newly added data with the stored mark in the relational database to obtain a mark comparison and matching result; and writing the newly added data temporarily stored in the cache file into the corresponding interval of the relational database according to the mark comparison matching result.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
writing the newly added data into a data cache region of the memory database and marking the newly added data; the memory database is at least one of Redis, SQLite and MongoDB;
writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database; the relational database is at least one of MySQL, Oracle and DB 2;
and writing the newly added data temporarily stored in the cache file into the relational database according to the mark.
In one embodiment, the computer program when executed by the processor further performs the steps of: detecting newly added data; writing the newly added data into a data cache region of the memory database; and marking the newly added data stored in the data buffer area.
In one embodiment, the computer program when executed by the processor further performs the steps of: establishing a mapping relation between a data cache region and a cache file of a relational database according to a memory mapping technology; and writing the newly added data with the marks into a cache file of the relational database according to the mapping relation.
In one embodiment, the computer program when executed by the processor further performs the steps of: comparing and matching the mark of the newly added data with the stored mark in the relational database to obtain a mark comparison and matching result; and writing the newly added data temporarily stored in the cache file into the corresponding interval of the relational database according to the mark comparison matching result.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A power grid monitoring system memory relation database synchronization method based on feature labels is characterized by comprising the following steps:
writing the newly added data into a data cache region of a memory database and marking the newly added data;
writing the newly added data with the marks into a cache file of a relational database according to the mapping relation between the data cache region and the cache file of the relational database;
and writing the newly-added data temporarily stored in the cache file into the relational database according to the mark.
2. The method for synchronizing the databases of the grid monitoring system based on the signature as claimed in claim 1, wherein the writing the new data into the data cache region of the database of the memory and the signature of the new data includes:
detecting the newly added data;
writing the newly added data into the data cache region of the memory database;
and marking the newly added data stored in the data cache region.
3. The method according to claim 1, wherein the writing the newly added data with the tag into the cache file of the relational database according to the mapping relationship between the data cache region and the cache file of the relational database includes:
establishing a mapping relation between the data cache region and the cache file of the relational database according to a memory mapping technology;
and writing the newly added data with the marks into the cache file of the relational database according to the mapping relation.
4. The method according to claim 1, wherein the writing, according to the signature, the newly added data temporarily stored in the cache file into the relational database includes:
comparing and matching the marks of the newly added data with the marks stored in the relational database to obtain a mark comparison and matching result;
and writing the newly-added data temporarily stored in the cache file into a corresponding interval of the relational database according to the mark comparison matching result.
5. The method according to claim 4, wherein after writing the newly added data temporarily stored in the cache file into the relational database according to the signature, the method comprises:
and deleting the newly added data in the cache file.
6. The method for synchronizing the databases of the grid monitoring system based on the signature as claimed in any one of claims 1 to 5, wherein the relational database is at least one of MySQL, Oracle and DB 2.
7. The signature based grid monitoring system memory relational database synchronization method according to any one of claims 1 to 5, wherein the memory database is at least one of Redis, SQLite, and MongoDB.
8. A power grid monitoring system memory relation base synchronizer based on feature marks is characterized in that the device comprises:
the data marking module is used for writing the newly added data into a data cache region of the memory database and marking the newly added data;
the data writing module is used for writing the newly added data with the marks into the cache file of the relational database according to the mapping relation between the data cache region and the cache file of the relational database;
and the data storage module is used for writing the newly-added data temporarily stored in the cache file into the relational database according to the mark.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110621701.7A 2021-06-03 2021-06-03 Characteristic mark-based power grid monitoring system memory database relation database synchronization method Pending CN113360571A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202110621701.7A CN113360571A (en) 2021-06-03 2021-06-03 Characteristic mark-based power grid monitoring system memory database relation database synchronization method
PCT/CN2021/103157 WO2022252322A1 (en) 2021-06-03 2021-06-29 Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system
DE112021007528.4T DE112021007528T5 (en) 2021-06-03 2021-06-29 METHOD FOR SYNCHRONIZING STORAGE DATABASE AND RELATIONAL DATABASE OF A CHARACTERISTIC-BASED POWER NETWORK MONITORING SYSTEM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110621701.7A CN113360571A (en) 2021-06-03 2021-06-03 Characteristic mark-based power grid monitoring system memory database relation database synchronization method

Publications (1)

Publication Number Publication Date
CN113360571A true CN113360571A (en) 2021-09-07

Family

ID=77531997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110621701.7A Pending CN113360571A (en) 2021-06-03 2021-06-03 Characteristic mark-based power grid monitoring system memory database relation database synchronization method

Country Status (3)

Country Link
CN (1) CN113360571A (en)
DE (1) DE112021007528T5 (en)
WO (1) WO2022252322A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952204A (en) * 2023-03-14 2023-04-11 中国西安卫星测控中心 Cache type SQLite reading method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291869A (en) * 2014-04-14 2017-10-24 五八同城信息技术有限公司 A kind of method of distribution service data query
CN108009282A (en) * 2017-12-22 2018-05-08 武汉楚鼎信息技术有限公司 A kind of json data are synchronized to the method and system device of relevant database
CN109597568A (en) * 2018-09-18 2019-04-09 天津字节跳动科技有限公司 A kind of date storage method, device, terminal device and storage medium
CN111984728A (en) * 2020-08-14 2020-11-24 北京人大金仓信息技术股份有限公司 Heterogeneous database data synchronization method, device, medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291869A (en) * 2014-04-14 2017-10-24 五八同城信息技术有限公司 A kind of method of distribution service data query
CN108009282A (en) * 2017-12-22 2018-05-08 武汉楚鼎信息技术有限公司 A kind of json data are synchronized to the method and system device of relevant database
CN109597568A (en) * 2018-09-18 2019-04-09 天津字节跳动科技有限公司 A kind of date storage method, device, terminal device and storage medium
CN111984728A (en) * 2020-08-14 2020-11-24 北京人大金仓信息技术股份有限公司 Heterogeneous database data synchronization method, device, medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952204A (en) * 2023-03-14 2023-04-11 中国西安卫星测控中心 Cache type SQLite reading method
CN115952204B (en) * 2023-03-14 2023-05-16 中国西安卫星测控中心 Cache type SQLite reading method

Also Published As

Publication number Publication date
WO2022252322A1 (en) 2022-12-08
DE112021007528T5 (en) 2024-02-15

Similar Documents

Publication Publication Date Title
CN109857737B (en) Cold and hot data storage method and device and electronic equipment
US10564880B2 (en) Data deduplication method and apparatus
CN103902623B (en) Method and system for the accessing file in storage system
US8954401B2 (en) Systems and methods for providing increased scalability in deduplication storage systems
US8407186B1 (en) Systems and methods for data-selection-specific data deduplication
US11176110B2 (en) Data updating method and device for a distributed database system
WO2019085471A1 (en) Database synchronization method, application server, and computer readable storage medium
US10606806B2 (en) Method and apparatus for storing time series data
CN104077380B (en) A kind of data de-duplication method, apparatus and system
US8166261B1 (en) Systems and methods for seeding a fingerprint cache for data deduplication
WO2020140622A1 (en) Distributed storage system, storage node device and data duplicate deletion method
US20200349113A1 (en) File storage method, deletion method, server and storage medium
CN102591864B (en) Data updating method and device in comparison system
US20150286671A1 (en) Transaction system
CN103716384A (en) Method and device for realizing cloud storage data synchronization in cross-data-center manner
CN113806301A (en) Data synchronization method, device, server and storage medium
CN114138907A (en) Data processing method, computer device, storage medium, and computer program product
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN113360571A (en) Characteristic mark-based power grid monitoring system memory database relation database synchronization method
KR20150123603A (en) Method and system for managing database
CN115858471A (en) Service data change recording method, device, computer equipment and medium
CN111290700A (en) Distributed data reading and writing method and system
CN113485642A (en) Data caching method and device
US10664442B1 (en) Method and system for data consistency verification in a storage system
CN114428790A (en) Data concurrent processing method and device, electronic equipment and storage medium

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