Supercharge Your Innovation With Domain-Expert AI Agents!

Memory data persistence method and device, storage medium and computer equipment

An in-memory data and persistent technology, applied in the computer field, can solve the problems of not being able to guarantee data security well, large file size, occupying storage space, etc.

Active Publication Date: 2021-04-20
HUBEI CENT CHINA TECH DEV OF ELECTRIC POWER
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

RDB snapshots save the data in the memory to the disk periodically. However, because the data is saved periodically, once a failure occurs, all the data from the last data save to the failure will be lost. You can see the RDB snapshot It cannot guarantee the security of data very well, and there is still a risk of losing some data
Incremental file AOF is to save each write operation of the Redis database to an AOF file. Since each write operation is saved in the AOF file, the security of the data can be well ensured. However, the AOF file is continuously accumulated The write operation of the Redis database, as time goes by, the AOF file will become larger and larger, taking up a lot of storage space
[0004] However, in the prior art, only one of the persistence strategies can be specified by the technician for data persistence
This leads to the loss of important data of a time node if the database fails when using the RBD strategy
When using the AOF strategy, if the data set in the database is too large, the generated file will be too large, occupy a large storage space, and take a long time to restore

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Memory data persistence method and device, storage medium and computer equipment
  • Memory data persistence method and device, storage medium and computer equipment
  • Memory data persistence method and device, storage medium and computer equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0079] When the business data persistence mode is the snapshot file mode, step 204 specifically includes:

[0080] Step 204A1, calling the fork function fork to create a child process;

[0081] Step 204A2, write the existing business data in the memory into the snapshot file through the sub-process.

[0082] In the above embodiment, use the fork function to copy a copy of the current process (child process), the parent process continues to process the client request, the fork process is responsible for synchronizing the data in the memory to the temporary file on the disk, when the child process writes the snapshot After the temporary file is finished, replace the original snapshot file with the temporary file, and then the child process exits.

Embodiment 2

[0084] When the business data persistence mode is an incremental file mode, step 204 specifically includes:

[0085] Step 204B1, when there is update data written into the internal memory, sequentially add write instructions corresponding to the update data to the incremental file.

[0086] In the above embodiment, the memory usually performs continuous update operations on the same data, each update operation corresponds to a write instruction, and the write instructions corresponding to each update operation are added to the incremental file in order, Write commands that are added to the delta file first are placed in front of write commands that are added to the delta file later.

Embodiment 3

[0088] If the business data persistence mode corresponding to the target time is a mixed mode, step 204 specifically includes:

[0089] Step 204C1, when there is updated data that needs to be written into the memory, add the write instructions corresponding to the updated data to the incremental file in sequence;

[0090] Step 204C2, when the size of the incremental file is greater than or equal to the preset threshold, add existing data in memory to the snapshot file, and clear the incremental file.

[0091] In the above-mentioned embodiment, the data persistence process corresponding to the mixed mode is as follows: First, the business data is persisted in the incremental file mode, and each time the data is updated, the write instruction corresponding to the updated data is added to the incremental file, and the write There will be more and more write instructions in the incremental file, the size of the incremental file will become larger and larger, and the storage space ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a memory data persistence method and device, a storage medium and computer equipment, and the method comprises the steps: obtaining a business data persistence mode corresponding to target time, wherein the business data persistence mode is matched with the business data features of historical reference time corresponding to the target time; and performing persistence processing on the memory data corresponding to the target time based on the service data persistence mode to obtain a persistence data file. According to the invention, statistical analysis is carried out on the data characteristics of the business data of the historical reference time, so that the business data persistence mode matched with the target time is determined; the problems that a persistence mode needs to be determined manually, a theoretical basis is lacked, and the persistence mode is not matched with service data characteristics, so that service data is lost, and a persistence data file is too large are solved. The invention also relates to a blockchain technology, and the business data features are stored in the blockchain.

Description

technical field [0001] The present application relates to the field of computer technology, and in particular to a memory data persistence method and device, storage medium, and computer equipment. Background technique [0002] With the rapid development of Internet technology, the complexity and intensity of data processing has increased sharply, which has doubled the amount of data processing, and therefore puts forward higher requirements for data processing speed. At present, the Redis database is usually used to improve the data processing efficiency. By storing the data in the memory and storing the processing results in the disk after the processing is completed, the frequent I / O operations between the memory and the disk in the data interaction process are reduced. The data processing efficiency is greatly improved. [0003] Since Redis is an in-memory database, the data in the memory is stored temporarily. When a failure occurs, it is easy to cause data loss. Ther...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/11G06F16/172G06F11/14
CPCY02D10/00
Inventor 赵祎
Owner HUBEI CENT CHINA TECH DEV OF ELECTRIC POWER
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More