WO2022252322A1 - Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system - Google Patents

Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system Download PDF

Info

Publication number
WO2022252322A1
WO2022252322A1 PCT/CN2021/103157 CN2021103157W WO2022252322A1 WO 2022252322 A1 WO2022252322 A1 WO 2022252322A1 CN 2021103157 W CN2021103157 W CN 2021103157W WO 2022252322 A1 WO2022252322 A1 WO 2022252322A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
relational database
newly added
database
memory
Prior art date
Application number
PCT/CN2021/103157
Other languages
French (fr)
Chinese (zh)
Inventor
梁苑
张勇
赵瑞锋
林敏洪
卢建刚
杨叶昕
刘行健
Original Assignee
广东电网有限责任公司珠海供电局
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 广东电网有限责任公司珠海供电局 filed Critical 广东电网有限责任公司珠海供电局
Priority to DE112021007528.4T priority Critical patent/DE112021007528T5/en
Publication of WO2022252322A1 publication Critical patent/WO2022252322A1/en

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/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

Definitions

  • the present application relates to the technical field of power grid monitoring, and in particular to a method, device, computer equipment and storage medium for synchronizing memory databases and relational databases of a power grid monitoring system based on signatures.
  • In-memory databases and relational databases generally exist in power grid monitoring systems; in-memory databases are databases that store data in memory and operate directly. Features, save data in memory; relational database refers to a database that organizes, stores and manages data according to a certain data structure and model, and a database built using a relational model is called a relational database.
  • the in-memory database and the relational database generally coexist at the same time, and the new data is generally stored in the in-memory database first, and after a preset time, the new data will be transferred from the in-memory database to the relational database
  • the new data stored in the memory database is lost due to system power failure before the preset time, this will affect the transfer synchronization of the new data, resulting in the existing new data transfer efficiency Still lower.
  • a method for synchronizing a relational library in a memory library of a power grid monitoring system based on a feature mark comprising:
  • writing the new data into the data cache area of the memory database and marking the new data includes:
  • the added data is detected
  • the newly added data with the mark is written into the cache file of the relational database ,include:
  • writing the newly added data temporarily stored in the cache file into the relational database according to the mark includes:
  • the newly added data temporarily stored in the cache file is written into a corresponding section of the relational database.
  • the relational database is at least one of MySQL, Oracle and DB2.
  • the in-memory database is at least one of Redis, SQLite, and MongoDB.
  • a feature tag-based synchronization device for a power grid monitoring system memory library relationship library includes:
  • a data marking module configured to write new data into the data cache area of the memory database and mark the new data
  • a data writing module configured to write the newly added data with the tag into the cache file of the relational database according to the mapping relationship between the data cache area and the cache file of the relational database;
  • a data storage module configured to write 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 stores a computer program, and the processor implements the following steps when executing the computer program:
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the method, device, computer equipment, and storage medium for synchronizing the memory library relational library of the power grid monitoring system based on the feature mark includes: writing the newly added data into the data cache area of the memory database and marking the newly added data; according to the data cache area According to the mapping relationship with the cache file of the relational database, the newly added data with the mark is written into the cache file of the relational database; according to the mark, the newly added data temporarily stored in the cache file is written into the relational database.
  • This application marks the new data and writes the new data temporarily stored in the cache file into the relational database, which solves the problem that the memory database needs a period of time to synchronize the data, so that the system data can be quickly synchronized , which improves the efficiency of data synchronization between memory and relational databases in the power grid monitoring system based on feature marks.
  • Fig. 1 is the application environment diagram of the method for synchronizing the relational database in the power grid monitoring system based on the signature in one embodiment
  • Fig. 2 is a schematic flow diagram of a method for synchronizing a relational library in a power grid monitoring system based on a signature in an embodiment
  • Fig. 3 is a schematic flow chart of the steps of writing new data into the data cache area of the memory database and marking the new data in one embodiment
  • Fig. 4 is a schematic flow chart of the steps of writing new data with a mark into a cache file of a relational database in one embodiment
  • FIG. 5 is a schematic flow diagram of a method for synchronizing a relational library in a power grid monitoring system based on a signature in another embodiment
  • Fig. 6 is a structural block diagram of a power grid monitoring system memory library relational library synchronization device based on a feature mark in an embodiment
  • Figure 7 is an internal block diagram of a computer device in one embodiment.
  • the signature-based method for synchronizing the memory database and relational database of the power grid monitoring system can be applied to the application environment shown in FIG. 1 .
  • the terminal 11 communicates with the server 12 through the network.
  • the server 12 receives the data sent by the terminal 11 as new data, and the server 12 writes the new data into the data cache area of the memory database and marks the new data;
  • the mapping relationship is to write the newly added data with the tag into 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 tag; the server 12 returns the new data to the terminal 11.
  • the result of adding data processing is to write the newly added data with the tag into the cache file of the relational database.
  • the terminal 11 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices
  • the server 12 can be realized by an independent server or a server cluster composed of multiple servers.
  • a method for synchronizing a relational library in a power grid monitoring system memory library based on a signature is provided.
  • the application of the method to the server 12 in FIG. 1 is used as an example for illustration, including the following steps:
  • Step 21 write the newly added data into the data cache area of the memory database and mark the newly added data.
  • the memory database refers to the database that puts the data in the memory and directly operates it. It uses the characteristics of the read and write speed of the memory faster than the disk, and the random access of the memory while the sequential access of the disk, and stores the data in the memory.
  • the table structure and index structure are imitated in memory and optimized for memory characteristics. Compared with accessing from disk, memory database access is faster.
  • the data processed by the memory database is usually "short-lived", that is, it has a certain effective time.
  • the newly added data may be data received by the server and transmitted from an external device, and the data may be expressed as text information, image information or notification information, which is not limited here.
  • the external device may be a router, a switch, a server, a cloud platform or other data transmission communication devices.
  • the added data may be generated by human operations or sensors, for example, data generated by operating instructions input by a user or trigger signals generated by sensors due to changes in the external environment.
  • marking the newly added data may be an ID for adding data identification, so as to make it unique.
  • the initial new data is marked as "A001”
  • the subsequent new data received can be marked as "B002”
  • Storage sorting can be performed according to tags, making data storage more organized.
  • the memory database can use Redis (Remote Dictionary Server, remote dictionary service), SQLite (a light database), MongoDB (a database based on distributed file storage).
  • Redis Remote Dictionary Server, remote dictionary service
  • SQLite a light database
  • MongoDB a database based on distributed file storage
  • the new data carries identification information
  • the identification information can be the data type of the new data, or the tag information of the data when the data is generated
  • the server can determine the memory database corresponding to the new data according to the identification information And the specific data cache area within the memory database that can be used for storage; after that, the server will mark the new data, and the marking action can be performed at the same time as the storage, or before or after the storage.
  • Step 22 according to the mapping relationship between the data cache area and the cache file of the relational database, write the newly added data with the mark into 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.
  • a database built using a relational model is called a relational database.
  • Relational databases are built on the basis of set algebra and apply mathematical methods to process data in the database. Relational databases deal with permanent, stable data.
  • mapping relationship between the data cache area and the cache file of the relational database can be established according to the mapping function; using the mapping relationship, the new data stored in the memory database can be quickly transferred to the cache file of the relational database.
  • the relational database can use MySQL (a relational database management system), Oracle (also known as Oracle RDBMS, a relational database management system with a distributed database as the core), DB2 (a relational database management system mainly used in large-scale application systems) database management system).
  • MySQL a relational database management system
  • Oracle also known as Oracle RDBMS, a relational database management system with a distributed database as the core
  • DB2 a relational database management system mainly used in large-scale application systems
  • the server obtains a preset mapping relationship, and identifies, according to the identifier of the data cache area, the cache file matching the identifier as the cache file of the relational database for writing the newly added data.
  • Step 23 write the newly added data temporarily stored in the cache file into the relational database according to the mark.
  • 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 new data can be realized through the relational database, and the data can be independent of the application program, which provides convenience for the use, adjustment, optimization and further expansion of the data.
  • Relational databases are structured according to a certain structure. The newly added data are related to each other within the record and between record types. Data can be accessed through different paths, and the speed of data acquisition and processing is relatively fast.
  • the newly added data is first written into the data cache area of the memory database, and the newly added data is marked; then according to the memory database According to the mapping relationship between the data cache area and the cache file of the relational database, the newly marked new data is first written into the cache file of the relational database; then according to the mark, the newly added data temporarily stored in the cache file is written to Into the relational database, there is no need to temporarily store the data in the memory database as before, and it will be transferred and synchronized to the relational database after a period of time.
  • the data can be quickly synchronized, which improves the efficiency of data synchronization between the memory database and the relational database of the power grid monitoring system based on the feature mark.
  • writing the newly added data into the data cache area of the memory database and marking the newly added data includes:
  • Step 31 detecting new data
  • Step 32 write the newly added data into the data cache area of the memory database
  • Step 33 mark the newly added data stored in the data cache area.
  • the server detects the newly added data; if the newly added data is detected, the newly added data is written into the preset data cache area in the memory database; the server performs the new data stored in the data cache area mark.
  • the server regularly checks the incoming of newly added data; the newly added data also includes new files obtained after the original file has been modified, and the server can judge whether the original file has passed the Modified update.
  • the detection of newly added data can be set as a regular detection method, and the set detection time interval can be 0.5 ms or 1 ms, which can be set by the user according to needs.
  • the server can store the newly added data into the data cache area as soon as possible according to the input characteristics of the newly added data and mark them by timing or real-time detection of the newly added data, so as to improve the memory of the power grid monitoring system based on feature marks.
  • the above step 22 according to the mapping relationship between the data cache area and the cache file of the relational database, writes the newly added data with the mark into the cache file of the relational database, include:
  • Step 41 establish a mapping relationship between the data cache area and the cache file of the relational database according to the memory mapping technology
  • Step 42 write the newly added data with the mark into the cache file of the relational database.
  • the memory mapping technology may be in the form of a mapping function, using the mapping function to establish a one-to-one mapping relationship between the data cache area and the cache file.
  • the server uses memory mapping technology to establish a mapping relationship between the data cache area and the cache file of the relational database, and can use a mapping function to establish a one-to-one mapping relationship between the data cache area and the cache file;
  • the mapping relationship writes the newly added data with tags into the cache file of the relational database.
  • the server of this embodiment uses the memory mapping technology to establish a connection between the cache file of the relational database and the data cache area, so as to transfer the newly added data in a targeted manner and store it in the cache file of the target, which improves the power grid based on the feature mark. Monitor the efficiency of data synchronization between system memory database relational databases.
  • the above step 23, according to the tag writes the newly added data temporarily stored in the cache file into the relational database, including: comparing and matching the tag of the newly added data with the tag already stored in the relational database , to obtain the tag comparison and matching result; according to the tag comparison and matching result, write the newly added data temporarily stored in the cache file to the corresponding interval of the relational database.
  • the data already stored in the relational database is also tagged, and the tags in the newly added data are compared and matched with the tags already stored in the relational database to obtain the tag comparison and matching result; then according to the tag comparison and matching result, the The newly added data temporarily stored in the cache file is written into the corresponding interval of the relational database. For example, if the new data is marked as "003", when it is compared and matched with the mark of the stored data in the relational database, the data marked as "002" will be searched, and then the newly added data will be stored in the data marked as " 002" data storage interval, making data storage more organized.
  • the server obtains the tag comparison and matching result by comparing and matching the tag of the newly added data with the tag stored in the relational database; according to the tag comparison and matching result, the newly added data temporarily stored in the cache file is written to
  • new data can be stored in the relational database in the order of marking, so that the new data is displayed in the relational database in the order of input, which improves the ease of use and extraction of subsequent data.
  • the above step 23, after writing the newly added data temporarily stored in the cache file into the relational database according to the mark, includes: deleting the newly added data in the cache file.
  • the server after the server writes the new data into the relational database, it can delete the new data in the cache file, so that the cache file can be fully utilized, and the new data is only temporarily stored each time as the previous data stored in the relational database. transition.
  • cache files can maintain a high memory capacity after each deletion, and subsequent new data can be directly transferred in, which improves the turnover efficiency of new data.
  • the server deletes the newly added data in the cache file after writing the newly added data temporarily stored in the cache file into the relational database, so that the cache file can maintain a larger available memory for subsequent storage of newly added data.
  • FIG. 5 there is provided another method for synchronizing a relational database in a power grid monitoring system memory database based on a signature, and the method is applied to the server 12 in FIG. 1 as an example for illustration, including the following steps:
  • Step 51 writing the newly added data into the data cache area of the memory database and marking the newly added data
  • Step 52 according to the mapping relationship between the data cache area and the cache file of the relational database, write the newly added data with the mark into the cache file of the relational database;
  • Step 53 write the newly added data temporarily stored in the cache file into the relational database according to the mark;
  • Step 54 delete the newly added data in the cache file.
  • the server after the server writes the new data into the relational database, it also deletes the new data stored in the cache file of the relational database, so that the storage space can be well cleaned up, so that the storage space does not appear unnecessary. Wasteful, does not increase the storage overhead of a relational database.
  • the server writes the newly added data into the data cache area of the memory database and marks the newly added data; according to the mapping relationship between the data cache area and the cache file of the relational database, writes the newly added data with the mark into the cache file of the relational database; according to the mark, write the new data temporarily stored in the cache file into the relational database; delete the new data in the cache file, so that the data can be saved from the cache file after being stored in the relational database It improves the overall operating efficiency of data synchronization between memory databases and relational databases in the power grid monitoring system based on feature marks.
  • a device for synchronizing a database relational database in a power grid monitoring system based on a signature including: a data marking module 61, a data writing module 62 and a data storage module 63, wherein:
  • Data marking module 61 for writing new data into the data cache area of the memory database and marking the new data
  • the data writing module 62 is used for writing the newly added data with the mark into the cache file of the relational database according to the mapping relationship between the data cache area and the cache file of the relational database;
  • 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 mark.
  • the data marking module 61 is further configured to detect new data; write the new data into the data cache area of the memory database; and mark the new data stored in the data cache area.
  • the data writing module 62 is also used to establish a mapping relationship between the data cache area and the cache file of the relational database according to the memory mapping technology; according to the mapping relationship, write the newly added data with the mark into In the cache file of the relational database.
  • the data storage module 63 is also used to compare and match the tags of the newly added data with the stored tags in the relational database to obtain a tag comparison and matching result; The newly added data in the file is written to the corresponding section of the relational database.
  • the data storage module 63 is also used to delete newly added data in the cache file.
  • All or part of the various modules in the above-mentioned signature-based power grid monitoring system memory library relation library synchronization device can be realized by software, hardware and combinations thereof.
  • the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure may be as shown in FIG. 7 .
  • the computer device includes a processor, memory and a network interface connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer programs and databases.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the computer device's database is used to store synchronization data.
  • the network interface of the computer device is used to communicate with an external terminal via a network connection.
  • FIG. 7 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation to the computer equipment on which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • a computer device including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • the memory database is at least one of Redis, SQLite, and MongoDB;
  • the relational database is at least one of MySQL, Oracle and DB2;
  • the following steps are also implemented when the processor executes the computer program: detecting newly added data; writing the newly added data into the data cache area of the memory database; mark.
  • the processor executes the computer program, the following steps are also implemented: according to the memory mapping technology, a mapping relationship is established between the data cache area and the cache file of the relational database; into the cache file of the relational database.
  • the processor executes the computer program, the following steps are also implemented: comparing and matching the tags of the newly added data with the tags already stored in the relational database to obtain the tag comparison and matching result; according to the tag comparison and matching result, the temporarily The newly added data stored in the cache file is written into the corresponding section of the relational database.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the memory database is at least one of Redis, SQLite, and MongoDB;
  • the relational database is at least one of MySQL, Oracle and DB2;
  • the following steps are also implemented: detecting newly added data; writing the newly added data into the data cache area of the memory database; to mark.
  • the following steps are also implemented: according to the memory mapping technology, a mapping relationship is established between the data cache area and the cache file of the relational database; Write to the cache file of the relational database.
  • the following steps are also implemented: comparing and matching the tags of the newly added data with the tags already stored in the relational database to obtain a tag comparison and matching result; according to the tag comparison and matching result, the The newly added data temporarily stored in the cache file is written to the corresponding section of the relational database.
  • any references to memory, storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile memory and volatile memory.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc.
  • Volatile memory can include Random Access Memory (RAM) or external cache memory.
  • RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Marketing (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Primary Health Care (AREA)
  • Water Supply & Treatment (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method and apparatus for synchronizing a memory database and a relational database of a feature tag-based power grid monitoring system, a computer device, and a storage medium. The method comprises: writing new data into a data cache area of a memory database and tagging the new data (21); writing the new data having a tag into a cache file of a relational database according to a mapping relationship between the data cache area and the cache file of the relational database (22); and writing, according to the tag, the new data temporarily stored in the cache file into the relational database (23). According to the method, the new data is tagged, and the new data temporarily stored in the cache file is written into the relational database, such that the problem that the memory database needs to synchronize the data after a period of time is solved; the system data can be synchronized quickly; and the efficiency of data synchronization between the memory database and the relational database of the feature tag-based power grid monitoring system is improved.

Description

基于特征标记的电网监控系统内存库关系库同步方法Synchronization method of memory database and relational database in power grid monitoring system based on feature mark 技术领域technical field
本申请涉及电网监控技术领域,特别是涉及一种基于特征标记的电网监控系统内存库关系库同步方法、装置、计算机设备和存储介质。The present application relates to the technical field of power grid monitoring, and in particular to a method, device, computer equipment and storage medium for synchronizing memory databases and relational databases of a power grid monitoring system based on signatures.
背景技术Background technique
电网监控系统中一般存在着内存数据库和关系数据库;内存数据库就是将数据放在内存中直接操作的数据库,它利用内存的读写速度比磁盘快、内存是随机访问而磁盘是顺序访问这两个特点,将数据保存在内存中;关系数据库是指按照一定数据结构和模型来组织、存储和管理数据的数据库,采用关系模型建立起来的数据库叫做关系数据库。In-memory databases and relational databases generally exist in power grid monitoring systems; in-memory databases are databases that store data in memory and operate directly. Features, save data in memory; relational database refers to a database that organizes, stores and manages data according to a certain data structure and model, and a database built using a relational model is called a relational database.
在一个系统中,内存数据库和关系数据库一般都是同时并存的,而新增数据一般都会先存储到内存数据库中,在经过预设时间后,新增数据就会由内存数据库转存到关系数据库中进行永久存储;但是如果存储在内存数据库中的新增数据在预设时间之前因为系统断电而丢失,这样就会影响新增数据的转存同步,导致现有的新增数据转存效率还较低。In a system, the in-memory database and the relational database generally coexist at the same time, and the new data is generally stored in the in-memory database first, and after a preset time, the new data will be transferred from the in-memory database to the relational database However, if the new data stored in the memory database is lost due to system power failure before the preset time, this will affect the transfer synchronization of the new data, resulting in the existing new data transfer efficiency Still lower.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种基于特征标记的电网监控系统内存库关系库同步方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a method, device, computer equipment, and storage medium for synchronizing a power grid monitoring system's memory library and relational library based on signatures in order to address the above technical problems.
一种基于特征标记的电网监控系统内存库关系库同步方法,包括:A method for synchronizing a relational library in a memory library of a power grid monitoring system based on a feature mark, comprising:
将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记;Writing the newly added data into the data cache area of the memory database and marking the newly added data;
根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中;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 area 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.
在其中一个实施例中,所述将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记,包括:In one of the embodiments, writing the new data into the data cache area of the memory database and marking the new data includes:
检测到所述新增数据;The added data is detected;
将所述新增数据写入到所述内存数据库的所述数据缓存区域中;writing the newly added data into the data cache area of the memory database;
对存储于所述数据缓存区域中的所述新增数据进行标记。Marking the newly added data stored in the data cache area.
在其中一个实施例中,所述根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中,包括:In one of the embodiments, according to the mapping relationship between the data cache area and the cache file of the relational database, the newly added data with the mark is written into the cache file of the relational database ,include:
根据内存映射技术将所述数据缓存区域和所述关系数据库的所述缓存文件之间建立映射关系;Establishing a mapping relationship between the data cache area and the cache file of the relational database according to memory mapping technology;
根据所述映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的所述缓存文件中。Writing the newly added data with the tag into the cache file of the relational database according to the mapping relationship.
在其中一个实施例中,所述根据所述标记,将暂存于所述缓存文件中的所述新增数据写入所述关系数据库中,包括:In one of the embodiments, writing the newly added data temporarily stored in the cache file into the relational database according to the mark includes:
将所述新增数据的所述标记与所述关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;comparing and matching the tags of the newly added data with the stored tags in the relational database to obtain a tag comparison and matching result;
根据所述标记对比匹配结果,将暂存于所述缓存文件中的所述新增数据写入到所述关系数据库的相应区间处。According to the tag comparison and matching result, the newly added data temporarily stored in the cache file is written into a corresponding section of the relational database.
在其中一个实施例中,在根据所述标记,将暂存于所述缓存文件中的所述新增数据写入所述关系数据库中之后,包括:In one of the embodiments, after writing the newly added data temporarily stored in the cache file into the relational database according to the mark, it includes:
删除所述缓存文件中的所述新增数据。Deleting the newly added data in the cache file.
在其中一个实施例中,所述关系数据库为MySQL、Oracle及DB2中的至少一种。In one of the embodiments, the relational database is at least one of MySQL, Oracle and DB2.
在其中一个实施例中,所述内存数据库为Redis、SQLite、及MongoDB中的至少一种。In one of the embodiments, the in-memory database is at least one of Redis, SQLite, and MongoDB.
一种基于特征标记的电网监控系统内存库关系库同步装置,所述装置包括:A feature tag-based synchronization device for a power grid monitoring system memory library relationship library, the device includes:
数据标记模块,用于将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记;A data marking module, configured to write new data into the data cache area of the memory database and mark the new data;
数据写入模块,用于根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中;A data writing module, configured to write the newly added data with the tag into the cache file of the relational database according to the mapping relationship between the data cache area and the cache file of the relational database;
数据存储模块,用于根据所述标记,将暂存于所述缓存文件中的所述新增数据写入所述关系数据库中。A data storage module, configured to write 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 stores a computer program, and the processor implements the following steps when executing the computer program:
将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记;Writing the newly added data into the data cache area of the memory database and marking the newly added data;
根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中;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 area 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.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记;Writing the newly added data into the data cache area of the memory database and marking the newly added data;
根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中;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 area 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.
上述基于特征标记的电网监控系统内存库关系库同步方法、装置、计算机设备和存储介质,方法包括:将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记;根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;根据标记,将暂存于缓存文件中的新增数据写入关系数据库中。本申请通过对新增数据进行标记,将暂存在缓存文件中的新增数据写入到关系数据库中,解决了内存数据库需要间隔一段时间才会将数据进行同步的问题,使得系统数据能够快速同步, 提高了基于特征标记的电网监控系统内存库关系库之间数据同步的效率。The method, device, computer equipment, and storage medium for synchronizing the memory library relational library of the power grid monitoring system based on the feature mark, the method includes: writing the newly added data into the data cache area of the memory database and marking the newly added data; according to the data cache area According to the mapping relationship with the cache file of the relational database, the newly added data with the mark is written into the cache file of the relational database; according to the mark, the newly added data temporarily stored in the cache file is written into the relational database. This application marks the new data and writes the new data temporarily stored in the cache file into the relational database, which solves the problem that the memory database needs a period of time to synchronize the data, so that the system data can be quickly synchronized , which improves the efficiency of data synchronization between memory and relational databases in the power grid monitoring system based on feature marks.
附图说明Description of drawings
图1为一个实施例中基于特征标记的电网监控系统内存库关系库同步方法的应用环境图;Fig. 1 is the application environment diagram of the method for synchronizing the relational database in the power grid monitoring system based on the signature in one embodiment;
图2为一个实施例中基于特征标记的电网监控系统内存库关系库同步方法的流程示意图;Fig. 2 is a schematic flow diagram of a method for synchronizing a relational library in a power grid monitoring system based on a signature in an embodiment;
图3为一个实施例中将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记步骤的流程示意图;Fig. 3 is a schematic flow chart of the steps of writing new data into the data cache area of the memory database and marking the new data in one embodiment;
图4为一个实施例中将带有标记的新增数据写入到关系数据库的缓存文件中步骤的流程示意图;Fig. 4 is a schematic flow chart of the steps of writing new data with a mark into a cache file of a relational database in one embodiment;
图5为又一个实施例中基于特征标记的电网监控系统内存库关系库同步方法的流程示意图;FIG. 5 is a schematic flow diagram of a method for synchronizing a relational library in a power grid monitoring system based on a signature in another embodiment;
图6为一个实施例中基于特征标记的电网监控系统内存库关系库同步装置的结构框图;Fig. 6 is a structural block diagram of a power grid monitoring system memory library relational library synchronization device based on a feature mark in an embodiment;
图7为一个实施例中计算机设备的内部结构图。Figure 7 is an internal block diagram of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
本申请提供的基于特征标记的电网监控系统内存库关系库同步方法,可以应用于如图1所示的应用环境中。其中,终端11通过网络与服务器12进行通信。服务器12接收终端11发送的数据作为新增数据,服务器12将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记;服务器12根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;服务器12根据标记,将暂存于缓存文件中的新增数据写入关系数据库中;服务器12向终端11返回新增数据的处理结果。The signature-based method for synchronizing the memory database and relational database of the power grid monitoring system provided by the present application can be applied to the application environment shown in FIG. 1 . Wherein, the terminal 11 communicates with the server 12 through the network. The server 12 receives the data sent by the terminal 11 as new data, and the server 12 writes the new data into the data cache area of the memory database and marks the new data; The mapping relationship is to write the newly added data with the tag into 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 tag; the server 12 returns the new data to the terminal 11. The result of adding data processing.
其中,终端11可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,服务器12可以用独立的服务器或者是多个服务器组成的服务器集群来实现。Wherein, the terminal 11 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server 12 can be realized by an independent server or a server cluster composed of multiple servers.
在一个实施例中,如图2所示,提供了一种基于特征标记的电网监控系统内存库关系库同步方法,以该方法应用于图1中的服务器12为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a method for synchronizing a relational library in a power grid monitoring system memory library based on a signature is provided. The application of the method to the server 12 in FIG. 1 is used as an example for illustration, including the following steps:
步骤21,将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记。 Step 21, write the newly added data into the data cache area of the memory database and mark the newly added data.
其中,内存数据库是指将数据放在内存中直接操作的数据库,它利用内存的读写速度比磁盘快、内存是随机访问而磁盘是顺序访问这两个特点,将数据保存在内存中,在内存中模仿建立表结构和索引结构并针对内存特性进行优化,相比从磁盘上访问,内存数据库访问较快。内存数据库所处理的数据通常是“短暂”的,即有一定的有效时间。Among them, the memory database refers to the database that puts the data in the memory and directly operates it. It uses the characteristics of the read and write speed of the memory faster than the disk, and the random access of the memory while the sequential access of the disk, and stores the data in the memory. The table structure and index structure are imitated in memory and optimized for memory characteristics. Compared with accessing from disk, memory database access is faster. The data processed by the memory database is usually "short-lived", that is, it has a certain effective time.
其中,新增数据可以为服务器接收到的由外部设备传送过来的数据,该数据可以表示为文字信息、图像信息或者通知信息,此处不作限定。而外部设备可以为路由器、交换机、服务器、云平台或者其他数据传输通信设备。新增数据可以由人为操作产生或者由传感器产生,例如用户输入的操作指令而产生的数据或者传感器由于外界环境的变化而产生的触发信号。Wherein, the newly added data may be data received by the server and transmitted from an external device, and the data may be expressed as text information, image information or notification information, which is not limited here. The external device may be a router, a switch, a server, a cloud platform or other data transmission communication devices. The added data may be generated by human operations or sensors, for example, data generated by operating instructions input by a user or trigger signals generated by sensors due to changes in the external environment.
其中,对新增数据进行标记可以为添加数据标识的ID,以此使其具有唯一性。例如,将初始的新增数据标记为“A001”,而后续接收到的新增数据就可以标记为“B002”,以此类推,并且在后续的关系数据库中对新增数据进行存储的时候,可以根据标记而进行存储排序,使得数据存储更具条理性。Wherein, marking the newly added data may be an ID for adding data identification, so as to make it unique. For example, the initial new data is marked as "A001", and the subsequent new data received can be marked as "B002", and so on, and when the new data is stored in the subsequent relational database, Storage sorting can be performed according to tags, making data storage more organized.
其中,内存数据库可以采用Redis(Remote Dictionary Server,远程字典服务),SQLite(一种轻型数据库),MongoDB(一个基于分布式文件存储的数据库)。Among them, the memory database can use Redis (Remote Dictionary Server, remote dictionary service), SQLite (a light database), MongoDB (a database based on distributed file storage).
具体地,新增数据携带有标识信息,标识信息可以是新增数据的数据类型,或者该数据生成时对该数据的标记信息;服务器可以根据该标识信息确定与该新增数据对应的内存数据库以及内存数据库内部的具体可用于存储的数据缓存 区域;之后,服务器会对新增数据进行标记,标记的动作可以和存储同时进行,也可以在存储的之前或之后进行。Specifically, the new data carries identification information, and the identification information can be the data type of the new data, or the tag information of the data when the data is generated; the server can determine the memory database corresponding to the new data according to the identification information And the specific data cache area within the memory database that can be used for storage; after that, the server will mark the new data, and the marking action can be performed at the same time as the storage, or before or after the storage.
步骤22,根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中。 Step 22, according to the mapping relationship between the data cache area and the cache file of the relational database, write the newly added data with the mark into the cache file of the relational database.
其中,关系数据库是指按照一定数据结构和模型来组织、存储和管理数据的数据库。采用关系模型建立起来的数据库叫做关系数据库。关系数据库是建立在集合代数基础上,应用数学方法来处理数据库中的数据。关系数据库是处理永久的、稳定的数据。Among them, a relational database refers to a database that organizes, stores and manages data according to a certain data structure and model. A database built using a relational model is called a relational database. Relational databases are built on the basis of set algebra and apply mathematical methods to process data in the database. Relational databases deal with permanent, stable data.
其中,数据缓存区域与关系数据库的缓存文件之间的映射关系可以根据映射函数而建立;利用映射关系,使得存储在内存数据库中的新增数据能够快速转存到关系数据库的缓存文件中。Wherein, the mapping relationship between the data cache area and the cache file of the relational database can be established according to the mapping function; using the mapping relationship, the new data stored in the memory database can be quickly transferred to the cache file of the relational database.
其中,关系数据库可以采用MySQL(一种关系型数据库管理系统),Oracle(又名Oracle RDBMS,一种以分布式数据库为核心的关系数据库管理系统),DB2(主要应用于大型应用系统的关系型数据库管理系统)。Among them, the relational database can use MySQL (a relational database management system), Oracle (also known as Oracle RDBMS, a relational database management system with a distributed database as the core), DB2 (a relational database management system mainly used in large-scale application systems) database management system).
具体地,服务器获取预先设置的映射关系,从中根据数据缓存区域的标识识别出与该标识匹配的缓存文件作为将新增数据写入的关系数据库的缓存文件。Specifically, the server obtains a preset mapping relationship, and identifies, according to the identifier of the data cache area, the cache file matching the identifier as the cache file of the relational database for writing the newly added data.
步骤23,根据标记,将暂存于缓存文件中的新增数据写入关系数据库中。 Step 23, write 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 new data can be realized through the relational database, and the data can be independent of the application program, which provides convenience for the use, adjustment, optimization and further expansion of the data. Relational databases are structured according to a certain structure. The newly added data are related to each other within the record and between record types. Data can be accessed through different paths, and the speed of data acquisition and processing is relatively fast.
进一步地,本发明实施例的基于特征标记的电网监控系统内存库关系库同步方法首先将新增数据写入到内存数据库的数据缓存区域中,并且对新增数据进行标记处理;然后根据内存数据库的数据缓存区域和关系数据库的缓存文件之间的映射关系,将已经标记了的新增数据首先写入到关系数据库的缓存文件 中;接着根据标记,将暂存在缓存文件中的新增数据写入到关系数据库中,不需要像以往那样暂存在内存数据库的数据需要等待一段时间后才会转存同步到关系数据库中,很好地解决内存数据库需要间隔一段时间才会将数据同步,使得系统数据能够快速同步,提高了基于特征标记的电网监控系统内存库关系库之间数据同步的效率。Further, in the method for synchronizing the memory database relational database of the power grid monitoring system based on the feature mark in the embodiment of the present invention, the newly added data is first written into the data cache area of the memory database, and the newly added data is marked; then according to the memory database According to the mapping relationship between the data cache area and the cache file of the relational database, the newly marked new data is first written into the cache file of the relational database; then according to the mark, the newly added data temporarily stored in the cache file is written to Into the relational database, there is no need to temporarily store the data in the memory database as before, and it will be transferred and synchronized to the relational database after a period of time. The data can be quickly synchronized, which improves the efficiency of data synchronization between the memory database and the relational database of the power grid monitoring system based on the feature mark.
上述基于特征标记的电网监控系统内存库关系库同步方法中,通过将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记;根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;根据标记,将暂存于缓存文件中的新增数据写入关系数据库中。本申请通过对新增数据进行标记,将暂存在缓存文件中的新增数据写入到关系数据库中,解决了内存数据库需要间隔一段时间才会将数据同步,使得系统数据能够快速同步,提高了基于特征标记的电网监控系统内存库关系库之间数据同步的效率。In the method for synchronizing the relational database in the memory database of the power grid monitoring system based on the feature mark, by writing the newly added data into the data cache area of the memory database and marking the newly added data; According to the mapping relationship, the newly added data with the mark is written into the cache file of the relational database; according to the mark, the newly added data temporarily stored in the cache file is written into the relational database. This application marks the newly added data and writes the newly added data temporarily stored in the cache file into the relational database, which solves the problem that the memory database needs a period of time to synchronize the data, so that the system data can be quickly synchronized, improving the Efficiency of data synchronization between relational databases in power grid monitoring system based on feature marks.
在一个实施例中,如图3所示,上述步骤21,将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记,包括:In one embodiment, as shown in FIG. 3, the above step 21, writing the newly added data into the data cache area of the memory database and marking the newly added data includes:
步骤31,检测到新增数据; Step 31, detecting new data;
步骤32,将新增数据写入到内存数据库的数据缓存区域中; Step 32, write the newly added data into the data cache area of the memory database;
步骤33,对存储于数据缓存区域中的新增数据进行标记。 Step 33, mark the newly added data stored in the data cache area.
具体地,服务器对新增数据进行检测;若检测到新增数据,则将新增数据写入到内存数据库中预先设置的数据缓存区域中;服务器对存储于数据缓存区域中的新增数据进行标记。Specifically, the server detects the newly added data; if the newly added data is detected, the newly added data is written into the preset data cache area in the memory database; the server performs the new data stored in the data cache area mark.
具体地,服务器对新增数据的传入进行定期或实施检测;新增数据还包括原始文件被修改后得到的新文件,服务器可以通过对比MD5、修改时间、具体修改内容等判断原始文件是否经过修改更新。Specifically, the server regularly checks the incoming of newly added data; the newly added data also includes new files obtained after the original file has been modified, and the server can judge whether the original file has passed the Modified update.
需要说明的是,对新增数据进行检测可以设定为定期检测的方式,而设定的检测时间间隔可以为0.5ms或者1ms,用户可以根据需要而进行设定。It should be noted that the detection of newly added data can be set as a regular detection method, and the set detection time interval can be 0.5 ms or 1 ms, which can be set by the user according to needs.
本实施例中,服务器通过对新增数据的定时或实时检测,能够根据新增数 据的输入特点将新增数据尽快存入数据缓存区域并进行标记,达到提高了基于特征标记的电网监控系统内存库关系库之间数据同步的效率的效果。In this embodiment, the server can store the newly added data into the data cache area as soon as possible according to the input characteristics of the newly added data and mark them by timing or real-time detection of the newly added data, so as to improve the memory of the power grid monitoring system based on feature marks. The effect of data synchronization efficiency between library relational libraries.
在一个实施例中,如图4所示,上述步骤22,根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中,包括:In one embodiment, as shown in FIG. 4, the above step 22, according to the mapping relationship between the data cache area and the cache file of the relational database, writes the newly added data with the mark into the cache file of the relational database, include:
步骤41,根据内存映射技术将数据缓存区域和关系数据库的缓存文件之间建立映射关系; Step 41, establish a mapping relationship between the data cache area and the cache file of the relational database according to the memory mapping technology;
步骤42,根据映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中。 Step 42, according to the mapping relationship, write the newly added data with the mark into the cache file of the relational database.
其中,内存映射技术可以为映射函数方式,利用映射函数,将数据缓存区域和缓存文件之间建立一一对应的映射关系。Wherein, the memory mapping technology may be in the form of a mapping function, using the mapping function to establish a one-to-one mapping relationship between the data cache area and the cache file.
具体地,服务器利用内存映射技术将数据缓存区域和关系数据库的缓存文件之间建立映射关系,可以利用映射函数的方式而将数据缓存区域和缓存文件建立一一对应的映射关系;然后根据建立的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中。Specifically, the server uses memory mapping technology to establish a mapping relationship between the data cache area and the cache file of the relational database, and can use a mapping function to establish a one-to-one mapping relationship between the data cache area and the cache file; The mapping relationship writes the newly added data with tags into the cache file of the relational database.
本实施例服务器通过内存映射技术,使得关系数据库的缓存文件与数据缓存区域之间建立联结,以便将新增数据定向进行转移,使其存入目标的缓存文件中,提高了基于特征标记的电网监控系统内存库关系库之间数据同步的效率。The server of this embodiment uses the memory mapping technology to establish a connection between the cache file of the relational database and the data cache area, so as to transfer the newly added data in a targeted manner and store it in the cache file of the target, which improves the power grid based on the feature mark. Monitor the efficiency of data synchronization between system memory database relational databases.
在一个实施例中,上述步骤23,根据标记,将暂存于缓存文件中的新增数据写入关系数据库中,包括:将新增数据的标记与关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;根据标记对比匹配结果,将暂存于缓存文件中的新增数据写入到关系数据库的相应区间处。In one embodiment, the above step 23, according to the tag, writes the newly added data temporarily stored in the cache file into the relational database, including: comparing and matching the tag of the newly added data with the tag already stored in the relational database , to obtain the tag comparison and matching result; according to the tag comparison and matching result, write the newly added data temporarily stored in the cache file to the corresponding interval of the relational database.
其中,已经存储在关系数据库中的数据也是带有标记的,将新增数据中的标记和已经存储在关系数据库中的标记进行对比匹配,得到标记对比匹配结果;然后根据标记对比匹配结果,将暂存在缓存文件中的新增数据写入到关系数据库的相应区间中。例如,新增数据的标记为“003”,在与关系数据库中的已经 存储的数据的标记进行对比匹配时,就会查找标记为“002”的数据,然后将新增数据存储到标记为“002”的数据的存储区间后,使得数据存储更具条理性。Among them, the data already stored in the relational database is also tagged, and the tags in the newly added data are compared and matched with the tags already stored in the relational database to obtain the tag comparison and matching result; then according to the tag comparison and matching result, the The newly added data temporarily stored in the cache file is written into the corresponding interval of the relational database. For example, if the new data is marked as "003", when it is compared and matched with the mark of the stored data in the relational database, the data marked as "002" will be searched, and then the newly added data will be stored in the data marked as " 002" data storage interval, making data storage more organized.
本实施例服务器通过将新增数据的标记与关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;根据标记对比匹配结果,将暂存于缓存文件中的新增数据写入到关系数据库的相应区间处,能够新增数据按照标记的顺序存储于关系数据库中,使得新增数据按照传入的顺序在关系数据库中所陈列,提高了后续数据使用、提取等的易用性。In this embodiment, the server obtains the tag comparison and matching result by comparing and matching the tag of the newly added data with the tag stored in the relational database; according to the tag comparison and matching result, the newly added data temporarily stored in the cache file is written to In the corresponding section of the relational database, new data can be stored in the relational database in the order of marking, so that the new data is displayed in the relational database in the order of input, which improves the ease of use and extraction of subsequent data.
在一个实施例中,上述步骤23,在根据标记,将暂存于缓存文件中的新增数据写入关系数据库中之后,包括:删除缓存文件中的新增数据。In one embodiment, the above step 23, after writing the newly added data temporarily stored in the cache file into the relational database according to the mark, includes: deleting the newly added data in the cache file.
具体地,服务器在将新增数据写入关系数据库之后,可以执行缓存文件中新增数据的删除工作,使得缓存文件得以被充分利用,每次仅短暂存储新增数据作为存入关系数据库之前的过渡。同时缓存文件能够在每次删除后保持较高的内存容量,后续新增数据可以直接转入,提高了新增数据的周转效率。Specifically, after the server writes the new data into the relational database, it can delete the new data in the cache file, so that the cache file can be fully utilized, and the new data is only temporarily stored each time as the previous data stored in the relational database. transition. At the same time, cache files can maintain a high memory capacity after each deletion, and subsequent new data can be directly transferred in, which improves the turnover efficiency of new data.
本实施例服务器通过将暂存于缓存文件中的新增数据写入关系数据库中之后,删除缓存文件中的新增数据,使得缓存文件能够保持较大的可用内存,以便后续新增数据的存储。In this embodiment, the server deletes the newly added data in the cache file after writing the newly added data temporarily stored in the cache file into the relational database, so that the cache file can maintain a larger available memory for subsequent storage of newly added data. .
在一个实施例中,如图5所示,提供了又一种基于特征标记的电网监控系统内存库关系库同步方法,该方法应用于图1中的服务器12为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 5 , there is provided another method for synchronizing a relational database in a power grid monitoring system memory database based on a signature, and the method is applied to the server 12 in FIG. 1 as an example for illustration, including the following steps:
步骤51,将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记; Step 51, writing the newly added data into the data cache area of the memory database and marking the newly added data;
步骤52,根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中; Step 52, according to the mapping relationship between the data cache area and the cache file of the relational database, write the newly added data with the mark into the cache file of the relational database;
步骤53,根据标记,将暂存于缓存文件中的新增数据写入关系数据库中; Step 53, write the newly added data temporarily stored in the cache file into the relational database according to the mark;
步骤54,删除缓存文件中的新增数据。 Step 54, delete the newly added data in the cache file.
具体地,服务器将新增数据写入到关系数据库中后,还将关系数据库的缓 存文件中存储的新增数据进行删除,从而可以很好地清理存储空间,使得存储空间不会出现不必要的浪费,不会增加关系数据库的存储开销。Specifically, after the server writes the new data into the relational database, it also deletes the new data stored in the cache file of the relational database, so that the storage space can be well cleaned up, so that the storage space does not appear unnecessary. Wasteful, does not increase the storage overhead of a relational database.
本实施例服务器通过将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记;根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;根据标记,将暂存于缓存文件中的新增数据写入关系数据库中;删除缓存文件中的新增数据,使得数据能够在存入关系数据库后从缓存文件中清除,提高了基于特征标记的电网监控系统内存库关系库之间数据同步的整体运行效率。In this embodiment, the server writes the newly added data into the data cache area of the memory database and marks the newly added data; according to the mapping relationship between the data cache area and the cache file of the relational database, writes the newly added data with the mark into the cache file of the relational database; according to the mark, write the new data temporarily stored in the cache file into the relational database; delete the new data in the cache file, so that the data can be saved from the cache file after being stored in the relational database It improves the overall operating efficiency of data synchronization between memory databases and relational databases in the power grid monitoring system based on feature marks.
应该理解的是,虽然图2-5的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-5中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow charts of FIGS. 2-5 are shown sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figures 2-5 may include multiple steps or stages, these steps or stages are not necessarily executed at the same moment, but may be executed at different moments, the execution of these steps or stages The sequence is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of steps or stages in other steps.
在一个实施例中,如图6所示,提供了一种基于特征标记的电网监控系统内存库关系库同步装置,包括:数据标记模块61、数据写入模块62和数据存储模块63,其中:In one embodiment, as shown in FIG. 6 , a device for synchronizing a database relational database in a power grid monitoring system based on a signature is provided, including: a data marking module 61, a data writing module 62 and a data storage module 63, wherein:
数据标记模块61,用于将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记; Data marking module 61, for writing new data into the data cache area of the memory database and marking the new data;
数据写入模块62,用于根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;The data writing module 62 is used for writing the newly added data with the mark into the cache file of the relational database according to the mapping relationship between the data cache area and the cache file of the relational database;
数据存储模块63,用于根据标记,将暂存于缓存文件中的新增数据写入关系数据库中。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 mark.
在一个实施例中,数据标记模块61,还用于检测到新增数据;将新增数据写入到内存数据库的数据缓存区域中;对存储于数据缓存区域中的新增数据进 行标记。In one embodiment, the data marking module 61 is further configured to detect new data; write the new data into the data cache area of the memory database; and mark the new data stored in the data cache area.
在一个实施例中,数据写入模块62,还用于根据内存映射技术将数据缓存区域和关系数据库的缓存文件之间建立映射关系;根据映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中。In one embodiment, the data writing module 62 is also used to establish a mapping relationship between the data cache area and the cache file of the relational database according to the memory mapping technology; according to the mapping relationship, write the newly added data with the mark into In the cache file of the relational database.
在一个实施例中,数据存储模块63,还用于将新增数据的标记与关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;根据标记对比匹配结果,将暂存于缓存文件中的新增数据写入到关系数据库的相应区间处。In one embodiment, the data storage module 63 is also used to compare and match the tags of the newly added data with the stored tags in the relational database to obtain a tag comparison and matching result; The newly added data in the file is written to the corresponding section of the relational database.
在一个实施例中,数据存储模块63,还用于删除缓存文件中的新增数据。In one embodiment, the data storage module 63 is also used to delete newly added data in the cache file.
关于基于特征标记的电网监控系统内存库关系库同步装置的具体限定可以参见上文中对于基于特征标记的电网监控系统内存库关系库同步方法的限定,在此不再赘述。上述基于特征标记的电网监控系统内存库关系库同步装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitations of the device for synchronizing the relational library in the memory database of the power grid monitoring system based on signatures, please refer to the above-mentioned definition of the method for synchronizing the relational databases in the memory database of the power grid monitoring system based on signatures, and details will not be repeated here. All or part of the various modules in the above-mentioned signature-based power grid monitoring system memory library relation library synchronization device can be realized by software, hardware and combinations thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储同步数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于特征标记的电网监控系统内存库关系库同步方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure may be as shown in FIG. 7 . The computer device includes a processor, memory and a network interface connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The computer device's database is used to store synchronization data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by a processor, a method for synchronizing a power grid monitoring system's internal memory library and relational library is realized.
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 7 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation to the computer equipment on which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记;内存数据库为Redis、SQLite、及MongoDB中的至少一种;Write the new data into the data cache area of the memory database and mark the new data; the memory database is at least one of Redis, SQLite, and MongoDB;
根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;关系数据库为MySQL、Oracle及DB2中的至少一种;According to the mapping relationship between the data cache area and the cache file of the relational database, the newly added data with the mark is written into the cache file of the relational database; the relational database is at least one of MySQL, Oracle and DB2;
根据标记,将暂存于缓存文件中的新增数据写入关系数据库中。Write the newly added data temporarily stored in the cache file into the relational database according to the mark.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:检测到新增数据;将新增数据写入到内存数据库的数据缓存区域中;对存储于数据缓存区域中的新增数据进行标记。In one embodiment, the following steps are also implemented when the processor executes the computer program: detecting newly added data; writing the newly added data into the data cache area of the memory database; mark.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:根据内存映射技术将数据缓存区域和关系数据库的缓存文件之间建立映射关系;根据映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中。In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the memory mapping technology, a mapping relationship is established between the data cache area and the cache file of the relational database; into the cache file of the relational database.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:将新增数据的标记与关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;根据标记对比匹配结果,将暂存于缓存文件中的新增数据写入到关系数据库的相应区间处。In one embodiment, when the processor executes the computer program, the following steps are also implemented: comparing and matching the tags of the newly added data with the tags already stored in the relational database to obtain the tag comparison and matching result; according to the tag comparison and matching result, the temporarily The newly added data stored in the cache file is written into the corresponding section of the relational database.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
将新增数据写入内存数据库的数据缓存区域并且对新增数据进行标记;内存数据库为Redis、SQLite、及MongoDB中的至少一种;Write the new data into the data cache area of the memory database and mark the new data; the memory database is at least one of Redis, SQLite, and MongoDB;
根据数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中;关系数据库为MySQL、Oracle及DB2中的至少一种;According to the mapping relationship between the data cache area and the cache file of the relational database, the newly added data with the mark is written into the cache file of the relational database; the relational database is at least one of MySQL, Oracle and DB2;
根据标记,将暂存于缓存文件中的新增数据写入关系数据库中。Write the newly added data temporarily stored in the cache file into the relational database according to the mark.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:检测到新增数据;将新增数据写入到内存数据库的数据缓存区域中;对存储于数据缓存区域中的新增数据进行标记。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: detecting newly added data; writing the newly added data into the data cache area of the memory database; to mark.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:根据内存映射技术将数据缓存区域和关系数据库的缓存文件之间建立映射关系;根据映射关系,将带有标记的新增数据写入到关系数据库的缓存文件中。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the memory mapping technology, a mapping relationship is established between the data cache area and the cache file of the relational database; Write to the cache file of the relational database.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:将新增数据的标记与关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;根据标记对比匹配结果,将暂存于缓存文件中的新增数据写入到关系数据库的相应区间处。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: comparing and matching the tags of the newly added data with the tags already stored in the relational database to obtain a tag comparison and matching result; according to the tag comparison and matching result, the The newly added data temporarily stored in the cache file is written to the corresponding section of the relational database.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,上述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the above computer programs can be stored in a non-volatile computer-readable storage medium In this case, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile memory and volatile memory. Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. 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).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上各个实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权 利要求为准。The above embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (10)

  1. 一种基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,包括:A method for synchronizing a relational library in a power grid monitoring system memory library based on a feature mark, characterized in that it includes:
    将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记;Writing the newly added data into the data cache area of the memory database and marking the newly added data;
    根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中;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 area 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.
  2. 根据权利要求1所述的基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,所述将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记,包括:The method for synchronizing a relational database in a power grid monitoring system based on a feature mark according to claim 1, wherein the writing of newly added data into the data cache area of the memory database and marking the newly added data includes :
    检测到所述新增数据;The added data is detected;
    将所述新增数据写入到所述内存数据库的所述数据缓存区域中;writing the newly added data into the data cache area of the memory database;
    对存储于所述数据缓存区域中的所述新增数据进行标记。Marking the newly added data stored in the data cache area.
  3. 根据权利要求1所述的基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,所述根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中,包括:The method for synchronizing a relational database in a power grid monitoring system based on a feature mark according to claim 1, wherein, according to the mapping relationship between the cache file of the data cache area and the relational database, there will be a The newly added data marked is written into the cache file of the relational database, including:
    根据内存映射技术将所述数据缓存区域和所述关系数据库的所述缓存文件之间建立映射关系;Establishing a mapping relationship between the data cache area and the cache file of the relational database according to memory mapping technology;
    根据所述映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的所述缓存文件中。Writing the newly added data with the tag into the cache file of the relational database according to the mapping relationship.
  4. 根据权利要求1所述的基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,所述根据所述标记,将暂存于所述缓存文件中的所述新增数据写入所述关系数据库中,包括:The method for synchronizing a relational library in a power grid monitoring system based on a feature tag according to claim 1, wherein, according to the tag, the newly added data temporarily stored in the cache file is written into the Among the relational databases mentioned above, including:
    将所述新增数据的所述标记与所述关系数据库中的已经存储的标记进行对比匹配,得到标记对比匹配结果;comparing and matching the tags of the newly added data with the stored tags in the relational database to obtain a tag comparison and matching result;
    根据所述标记对比匹配结果,将暂存于所述缓存文件中的所述新增数据写 入到所述关系数据库的相应区间处。According to the tag comparison and matching result, the newly added data temporarily stored in the cache file is written to the corresponding section of the relational database.
  5. 根据权利要求4所述的基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,在根据所述标记,将暂存于所述缓存文件中的所述新增数据写入所述关系数据库中之后,包括:According to claim 4, the method for synchronizing the relational library of the power grid monitoring system memory library based on the feature mark is characterized in that, according to the mark, the described new data temporarily stored in the cache file is written into the After the relational database, including:
    删除所述缓存文件中的所述新增数据。Deleting the newly added data in the cache file.
  6. 根据权利要求1至5任一项所述的基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,所述关系数据库为MySQL、Oracle及DB2中的至少一种。The method for synchronizing a relational database in a power grid monitoring system based on a signature according to any one of claims 1 to 5, wherein the relational database is at least one of MySQL, Oracle and DB2.
  7. 根据权利要求1至5任一项所述的基于特征标记的电网监控系统内存库关系库同步方法,其特征在于,所述内存数据库为Redis、SQLite、及MongoDB中的至少一种。According to any one of claims 1 to 5, the signature-based method for synchronizing the memory database relational database of the power grid monitoring system, wherein the memory database is at least one of Redis, SQLite, and MongoDB.
  8. 一种基于特征标记的电网监控系统内存库关系库同步装置,其特征在于,所述装置包括:A power grid monitoring system memory library relational library synchronization device based on feature marks, characterized in that the device includes:
    数据标记模块,用于将新增数据写入内存数据库的数据缓存区域并且对所述新增数据进行标记;A data marking module, configured to write new data into the data cache area of the memory database and mark the new data;
    数据写入模块,用于根据所述数据缓存区域与关系数据库的缓存文件之间的映射关系,将带有所述标记的所述新增数据写入到所述关系数据库的缓存文件中;A data writing module, configured to write the newly added data with the tag into the cache file of the relational database according to the mapping relationship between the data cache area and the cache file of the relational database;
    数据存储模块,用于根据所述标记,将暂存于所述缓存文件中的所述新增数据写入所述关系数据库中。A data storage module, configured to write the newly added data temporarily stored in the cache file into the relational database according to the mark.
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述的方法的步骤。A computer device, comprising a memory and a processor, the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are realized.
PCT/CN2021/103157 2021-06-03 2021-06-29 Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system WO2022252322A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
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 (2)

Application Number Priority Date Filing Date Title
CN202110621701.7 2021-06-03
CN202110621701.7A CN113360571B (en) 2021-06-03 2021-06-03 Method for synchronizing memory library relation library of power grid monitoring system based on feature markers

Publications (1)

Publication Number Publication Date
WO2022252322A1 true WO2022252322A1 (en) 2022-12-08

Family

ID=77531997

Family Applications (1)

Application Number Title Priority Date Filing Date
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

Country Status (3)

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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116244486A (en) * 2023-03-06 2023-06-09 深圳开源互联网安全技术有限公司 Crawling data processing method and system based on data stream
CN115952204B (en) * 2023-03-14 2023-05-16 中国西安卫星测控中心 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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6457021B1 (en) * 1998-08-18 2002-09-24 Microsoft Corporation In-memory database system
CN101876996A (en) * 2009-12-01 2010-11-03 广州从兴电子开发有限公司 Method and system for synchronizing data from main memory data bank to file data bank
CN110109927A (en) * 2019-04-25 2019-08-09 上海新炬网络技术有限公司 Oracle database data processing method based on LSM tree

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

Also Published As

Publication number Publication date
DE112021007528T5 (en) 2024-02-15
CN113360571A (en) 2021-09-07
CN113360571B (en) 2024-08-16

Similar Documents

Publication Publication Date Title
WO2019085471A1 (en) Database synchronization method, application server, and computer readable storage medium
US20190361913A1 (en) Data replication technique in database management system
US11314719B2 (en) Method for implementing change data capture in database management system
US10564880B2 (en) Data deduplication method and apparatus
WO2022252322A1 (en) Method for synchronizing memory database and relational database of feature tag-based power grid monitoring system
CN103595797B (en) Caching method for distributed storage system
US10838827B2 (en) System and method for time parameter based database restoration
CN101184106A (en) Associated transaction processing method of mobile database
US11176110B2 (en) Data updating method and device for a distributed database system
US9152683B2 (en) Database-transparent near online archiving and retrieval of data
CN106874281B (en) Method and device for realizing database read-write separation
US20200019474A1 (en) Consistency recovery method for seamless database duplication
WO2020093501A1 (en) File storage method and deletion method, server, and storage medium
WO2022095366A1 (en) Redis-based data reading method and apparatus, device, and readable storage medium
CN102591864B (en) Data updating method and device in comparison system
CN110795499A (en) Cluster data synchronization method, device and equipment based on big data and storage medium
JP7508541B2 (en) Blockchain data processing method, device, equipment and readable storage medium
US11544229B1 (en) Enhanced tracking of data flows
CN113806301B (en) Data synchronization method, device, server and storage medium
US20170060922A1 (en) Method and device for data search
CN104281673A (en) Cache building system and method for database
US9053100B1 (en) Systems and methods for compressing database objects
CN104702508A (en) Method and system for dynamically updating table items
CN115858471A (en) Service data change recording method, device, computer equipment and medium
WO2023070462A1 (en) File deduplication method and apparatus, and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21943679

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 112021007528

Country of ref document: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 180424)