WO2021051512A1 - Polymorphic storage mechanism-based snapshot generation method, apparatus and computer device - Google Patents

Polymorphic storage mechanism-based snapshot generation method, apparatus and computer device Download PDF

Info

Publication number
WO2021051512A1
WO2021051512A1 PCT/CN2019/116713 CN2019116713W WO2021051512A1 WO 2021051512 A1 WO2021051512 A1 WO 2021051512A1 CN 2019116713 W CN2019116713 W CN 2019116713W WO 2021051512 A1 WO2021051512 A1 WO 2021051512A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage
difference data
preset
storage mechanism
Prior art date
Application number
PCT/CN2019/116713
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 平安科技(深圳)有限公司
Publication of WO2021051512A1 publication Critical patent/WO2021051512A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process

Definitions

  • This application relates to the computer field, in particular to a snapshot generation method, device, computer equipment, and storage medium based on a polymorphic storage mechanism.
  • a snapshot is a fully usable copy of a specified data set.
  • the copy includes an image of the corresponding data at a certain point in time (the point in time when the copy starts), that is, a record of the state of data storage at a certain time, which can be used for data recovery, etc. use.
  • snapshots have been widely used, but the current snapshot technology has the following problems:
  • Snapshot technology is based on a single storage system. For distributed storage, that is, when some data involves multiple storage systems, only multiple snapshots can be generated separately;
  • the storage system that adopts the polymorphic storage mechanism has great application potential because of its higher data storage density, but it is different from the storage system of the ordinary binary storage mechanism, and the snapshot used must also use the polymorphic storage mechanism. Cause incompatibility between snapshots.
  • the conventional technology lacks a scheme for generating snapshots involving multiple storage systems and further involving a multi-state storage mechanism.
  • the main purpose of this application is to provide a snapshot generation method, device, computer equipment, and storage medium based on a polymorphic storage mechanism, aiming to realize snapshots of multiple storage systems involving a polymorphic storage mechanism, and improve the applicability of snapshots .
  • this application proposes a snapshot generation method based on a polymorphic storage mechanism, which is applied to middleware, and the middleware is located between multiple storage systems, including:
  • the difference data of the current stored data that is different from the pre-stored initial data and the difference data are obtained according to the preset difference data acquisition method.
  • Determining whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems among the plurality of storage systems except the designated storage system;
  • difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
  • a preset snapshot generation technology is used to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
  • the snapshot generation method, device, computer equipment, and storage medium based on the polymorphic storage mechanism of the present application receive instructions for generating snapshots for multiple storage systems; obtain the storage mechanism of the storage system; if the multiple storage systems are If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism, the difference data and the difference physical location where the difference data is stored are obtained; if the difference data also includes the second difference data, binary conversion processing is performed to obtain the specified binary Data; store the designated binary data and the second difference data to a preset first physical location; generate a first snapshot indication volume, the first snapshot indication volume including a first logical address and the difference physical location , The first logical address points to the first physical address. In this way, snapshots of multiple storage systems involving polymorphic storage mechanisms are realized, and the applicability of snapshots is improved.
  • FIG. 1 is a schematic flowchart of a snapshot generation method based on a polymorphic storage mechanism according to an embodiment of the application
  • FIG. 2 is a schematic block diagram of the structure of a snapshot generation device based on a polymorphic storage mechanism according to an embodiment of the application;
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a snapshot generation method based on a polymorphic storage mechanism, which is applied to middleware, the middleware is located between multiple storage systems, and the method includes:
  • S4. Determine whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems in the plurality of storage systems except the designated storage system;
  • difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
  • S7 Use a preset snapshot generation technology to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
  • step S1 an instruction to generate snapshots for multiple storage systems is received.
  • this application is applied to middleware, and the middleware is located between multiple storage systems. Therefore, the snapshot generation of this application is no longer based on each storage system itself. Instead, the middleware implements unified snapshot processing to solve multiple storage systems. The storage system cannot jointly generate the same and unified snapshot.
  • the middleware is an independent service program used to interface with multiple storage systems, wherein the middleware can be located in any location, preferably in a server.
  • the storage mechanism of the storage system is acquired through the preset storage mechanism identification method, and it is determined whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems.
  • Ordinary binary storage mechanisms such as storage in the form of magnetic domains, refer to the use of two states in which the magnetization direction of the magnetic domain is positive or negative to store information.
  • the multi-state storage mechanism which is different from the binary storage mechanism, refers to the storage of information in more than two states, such as the use of the different electrical characteristics of the storage medium under the magnetoelectric effect, such as the BiFeO3-based magnetoelectric material with a perovskite structure Implemented polymorphic storage mechanism.
  • the different electrical characteristics of the storage medium under the magnetoelectric effect are, for example, those with magnetoelectric effect under different magnetic fields (for example, a forward magnetic field and a reverse magnetic field) and different electric fields (for example, a forward electric field and a reverse electric field).
  • the value of the dielectric constant of the storage medium will change significantly (for example, due to mechanisms such as phase change), so the value of the dielectric constant can be used as the basis for data storage.
  • the preset storage mechanism identification method is, for example, using preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain the storage test primitives in different locations.
  • step S3 if there is a designated storage system whose storage mechanism is a polymorphic storage mechanism in the multiple storage systems, the difference between the current stored data and the pre-stored initial data is obtained according to the preset difference data acquisition method
  • Snapshot technology reads and writes faster than ordinary backup technology, because it only needs to record different data, without copying all the data. Therefore, the present application obtains the difference data of the current stored data that is different from the pre-stored initial data and the difference physical location where the difference data is stored according to the preset difference data acquisition method.
  • the preset difference data acquisition method is, for example: acquiring the designated data modification record after the generation time of the initial data from the system log; performing classification processing on the designated data modification record by physical address, thereby Divide the specified data modification records into multiple data record sets; mark the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and obtain the difference data.
  • step S4 it is determined whether the difference data further includes second difference data, and the second difference data is stored in other storage systems of the plurality of storage systems except the designated storage system. data. If the difference data only includes the first difference data, there is no need to perform binary conversion, and the difference data can be copied directly using a polymorphic storage mechanism.
  • the difference data further includes the second difference data
  • the first difference data is subjected to binary conversion processing to obtain designated binary data.
  • the process of binary conversion processing is, for example: obtaining the specified electrical data of the storage element corresponding to the first difference data, the storage element being the smallest storage unit of the first difference data; dividing the storage element Are the first storage element, the second storage element, the third storage element, and the fourth storage element, wherein the value of the specified electrical data of the first storage element is within the first numerical range, and the first storage element
  • the value of the specified electrical data of the second storage element is within the second numerical range
  • the value of the specified electrical data of the third storage element is within the third numerical range
  • the specified electrical data of the fourth storage element The value of is within the fourth value range; a third mapping element pair and a fourth mapping element pair are established, and the third mapping element pair consists of a storage element whose electrical data value is within the second data range And a sequence of storage primitives whose values of electrical data are within the first data range, and
  • the mapping read operation uses a third mapping primitive pair to replace the third storage primitive when reading the third storage primitive, and when reading the third storage primitive, In the case of four storage primitives, a fourth mapping primitive pair is used to replace the fourth storage primitive, thereby obtaining designated binary data.
  • the designated binary data and the second difference data are stored in a preset first physical location.
  • a preset encryption technique may be used to encrypt to obtain a ciphertext, and then the ciphertext is stored in a preset first physical location, so as to ensure the security of the information.
  • the preset snapshot generation technology is used to generate a first snapshot indicating volume.
  • the first snapshot indicating volume includes a first logical address and the differential physical location, and the first logical address points to the The first physical location.
  • the snapshot generation technology can be any technology, for example, a snapshot-redirection-on-write technology, or a snapshot-replication technology-on-write technology, preferably the technology of redirecting a snapshot-on-write snapshot.
  • the first snapshot indicates that the first logical address in the volume provides the location of the differential data, and the differential physical location provides the location of the differential data in the initial data. Therefore, when you need to read the snapshot, you only need to indicate the volume according to the first snapshot. And the initial data can realize the snapshot read.
  • the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect
  • the storage system has a storage test primitive for testing the storage mechanism
  • the storage number of the storage test primitive is 1
  • the step S2 of obtaining the storage mechanism of the storage system through the preset storage mechanism identification method includes:
  • S201 Use preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain multiple electrical data of the storage test primitives under different magnetic fields and different electric fields ;
  • S202 Determine whether the multiple electrical data are within three or more preset numerical ranges
  • the storage mechanism of the storage system can be obtained through the preset storage mechanism identification method.
  • the storage system of the present application has a storage test primitive for testing the storage mechanism. Since the storage bit of the storage test primitive is 1, there is almost no additional storage pressure, and the storage test primitive is passed The test can accurately obtain the storage mechanism of the storage system without the need to call the stored data, thereby reducing the number of reads and writes of the stored data, and also avoids possible mistakes in erasing and writing.
  • the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect. Therefore, under different magnetic fields and different electric fields, the storage test primitives of the multi-state storage mechanism will exhibit multiple states, that is, multiple states are in three states. Electrical data within the range of more than one value.
  • the storage mechanism of the storage system is a polymorphic storage mechanism by judging whether the plurality of electrical data are within three or more preset numerical ranges.
  • the electrical data is related to the magnetoelectric effect and the storage test element. For example, if the storage test element stores data through different states of dielectric constant, the corresponding electrical data is the dielectric constant.
  • the data modification records of the multiple storage systems are all saved in the system log, and the step S3 of acquiring the difference data of the current stored data that is different from the prestored initial data according to the preset difference data acquisition method ,include:
  • S302 Perform classification processing on the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
  • the difference data of the currently stored data different from the pre-stored initial data is obtained. Since the data modification records of the multiple storage systems are all stored in the system log, there is no need to use a common data comparison method to sequentially compare the difference between the current stored data and the initial data, thereby reducing the data processing pressure. In addition, since there may be multiple modifications to the data stored in the same location when data is modified, this application uses the specified data modification record to be classified according to physical address, so as to classify the designated data modification record. Divide into multiple data record sets; record the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and use the latest data as the difference data to obtain the difference data.
  • the judging whether the difference data further includes second difference data, and the second difference data is stored in a storage system other than the designated storage system among the plurality of storage systems
  • the data after step S4 includes:
  • difference data does not include the second difference data, store the first difference data in a second physical location preset in the designated storage system;
  • S42 Use a preset snapshot generation technology to generate a second snapshot indication volume, where the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
  • the generation of the second snapshot indication volume is achieved. If the difference data does not include the second difference data, it indicates that the difference data comes from a storage system whose storage mechanism is a polymorphic storage mechanism. At this time, the value of binary conversion is not high, so it is directly preset in the designated storage system It suffices to store the first difference data in the second physical location of. Then, a preset snapshot generation technology is used to generate a second snapshot indication volume, the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
  • snapshot reading can be realized based on the second snapshot indicating volume and initial data, and when reading, it is first determined that the second physical location is in the designated storage system, then the storage of the non-polymorphic storage mechanism is performed when the snapshot is read.
  • the data of the system can be read quickly without judging whether it has been modified, thereby improving the speed of snapshot reading.
  • the multi-state storage mechanism is a four-state storage mechanism based on the magnetoelectric effect
  • the step S5 of performing binary conversion processing on the first difference data to obtain designated binary data includes:
  • mapping element pair consists of a storage element whose value of electrical data is in the second data range and a value of electrical data that is in the first data range.
  • a sequence of storage primitives within a data range is constituted, and the fourth mapping primitive pair is constituted by a sequence of storage primitives in which the values of two electrical data are both within the second data range;
  • mapping read operation uses a third mapping primitive pair to replace the third storage primitive when reading the third storage primitive, and when reading the third storage primitive, When the fourth storage element is taken, a fourth mapping element pair is used to replace the fourth storage element, thereby obtaining designated binary data.
  • the binary conversion processing of the first difference data is implemented to obtain designated binary data.
  • two storage states are saved and only the other two storage states are mapped, which doubles the processing efficiency of the binary conversion in this application.
  • the data stored in the first storage element is equivalent to 0 in binary data
  • the data stored in the second storage element is equivalent to 1 in binary data
  • the data stored in the third storage element is equivalent to binary data.
  • the data stored in the fourth storage element is equivalent to 11 in the binary data. Since the classification process is adopted, only the third storage primitive-third mapping primitive pair and the fourth storage primitive-fourth mapping primitive pair mapping can be established.
  • the mapping read operation the reading of the first storage element and the second storage element does not change, and when the third storage element and the fourth storage element are read, it becomes read Take the corresponding third mapping primitive pair and fourth mapping primitive pair to obtain accurate designated binary data.
  • the step S6 of storing the designated binary data and the second difference data to a preset first physical location includes:
  • S601 Perform a hash calculation on the designated binary data according to a preset hash algorithm to obtain a first hash value
  • S602. Perform a hash calculation on the second difference data according to a preset hash algorithm to obtain a second hash value.
  • S604 Use the second hash value as an encryption key to encrypt the designated binary data to obtain a ciphertext of the designated binary data;
  • the designated binary data and the second difference data are stored in the preset first physical location.
  • This application adopts a cross-encryption method to improve information security. Wherein, since the encryption keys are respectively derived from the crossed designated binary data and the second difference data, and the encryption object is the crossed second difference data and the designated binary data, the information security can be guaranteed, and Reduce the key storage space required in common encryption technology (no need to store the key in advance).
  • the preset snapshot generation technology is used to generate a first snapshot indication volume
  • the first snapshot indication volume includes a first logical address and the differential physical location
  • the first logical address points to all After the step S7 of the first physical location, it includes:
  • S71 Receive a snapshot read instruction, where the snapshot read instruction carries a verification image used to verify identity;
  • snapshot reading is realized.
  • This application uses the calculation of the similarity value between the verification image and the pre-stored planar image, and determines whether the similarity value is greater than a preset similarity threshold to verify the identity.
  • the three-dimensional virtual figure is a three-dimensional figure in a virtual three-dimensional space, so the plane projection images in different designated directions are different, which is used as a basis for identity verification.
  • the designated projection direction is agreed in advance to generate a flat projection image, and then the flat projection image is sent to the user. If the verification image provided by the user is the same or similar to the plane projection image, it is determined that the identity authentication is correct, and the initial data is redirected.
  • the redirection refers to the difference in the initial data.
  • the physical location redirection is the first logical address; the initial data after the redirection process is read to implement snapshot reading.
  • an embodiment of the present application provides a snapshot generation device based on a polymorphic storage mechanism, which is applied to middleware, the middleware is located between multiple storage systems, and the device includes:
  • the snapshot generation instruction receiving unit 10 is configured to receive a snapshot generation instruction for multiple storage systems
  • the storage mechanism acquisition unit 20 is configured to acquire the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
  • the difference data obtaining unit 30 is configured to, if there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, according to a preset difference data obtaining method, obtain the difference between the current stored data and the pre-stored initial data The difference data and the difference physical location where the difference data is stored, wherein the difference data includes the first difference data stored in a polymorphic storage system;
  • the second difference data judging unit 40 is configured to judge whether the difference data further includes second difference data, and the second difference data is stored in the plurality of storage systems other than the designated storage system Data in the system;
  • the designated binary data acquiring unit 50 is configured to, if the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
  • the first physical location storage unit 60 is configured to store the designated binary data and the second difference data to a preset first physical location
  • the first snapshot indication volume generating unit 70 is configured to generate a first snapshot indication volume using a preset snapshot generation technology, where the first snapshot indication volume includes a first logical address and the difference physical location, and the first logical The address points to the first physical location.
  • the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect
  • the storage system has a storage test primitive for testing the storage mechanism
  • the storage number of the storage test primitive is 1
  • the storage mechanism acquisition unit 20 includes:
  • the electrical data acquisition subunit is used to use preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain the storage test primitives in different magnetic fields and different electric fields. Multiple electrical data under;
  • the numerical value range judgment subunit is used to judge whether the plurality of electrical data are respectively within three or more preset numerical value ranges
  • the polymorphic storage mechanism determination subunit is configured to determine that the storage mechanism of the storage system is a polymorphic storage mechanism if the plurality of electrical data are within three or more preset value ranges.
  • the data modification records of the multiple storage systems are all saved in the system log, and the difference data obtaining unit 30 includes:
  • the designated data modification record obtaining subunit is configured to obtain the designated data modification record after the generation time of the initial data from the system log;
  • the classification processing subunit is used to classify the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
  • the difference data obtaining subunit is used to record the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and to obtain the difference data.
  • the device includes:
  • a first difference data storage unit configured to store the first difference data in a second physical location preset in the designated storage system if the difference data does not include the second difference data;
  • the second snapshot indication volume generation unit is configured to generate a second snapshot indication volume using a preset snapshot generation technology, the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
  • the multi-state storage mechanism is a four-state storage mechanism based on the magnetoelectric effect
  • the designated binary data acquisition unit 50 includes:
  • a designated electrical data acquisition subunit for acquiring designated electrical data of a storage element corresponding to the first difference data, the storage element being the smallest storage unit of the first difference data;
  • the storage element division subunit is used to divide the storage element into a first storage element, a second storage element, a third storage element, and a fourth storage element, wherein the first storage element
  • the value of the specified electrical data is within the first value range
  • the value of the specified electrical data of the second storage element is within the second value range
  • the value of the specified electrical data of the third storage element is within the third value range.
  • the numerical value of the designated electrical data of the fourth storage element is within the fourth numerical range;
  • the mapping primitive pair establishment subunit is used to establish a third mapping primitive pair and a fourth mapping primitive pair.
  • the third mapping primitive pair is a storage primitive whose value of electrical data is within the second data range.
  • the fourth mapping primitive pair is composed of a sequence of storage primitives whose values of two electrical data are both within the second data range;
  • the mapping read subunit is configured to perform a mapping read operation on the first difference data, where the mapping read operation uses a third mapping primitive pair to replace the third storage when reading a third storage primitive Primitives, and when reading the fourth storage primitives, a fourth mapping primitive pair is used to replace the fourth storage primitives, so as to obtain designated binary data.
  • the first physical location storage unit 60 includes:
  • the first hash value obtaining subunit is configured to perform a hash calculation on the designated binary data according to a preset hash algorithm to obtain the first hash value;
  • the second hash value obtaining subunit is configured to perform a hash calculation on the second difference data according to a preset hash algorithm to obtain a second hash value
  • the second difference data ciphertext obtaining subunit is configured to use the first hash value as an encryption key to encrypt the second difference data to obtain the second difference data ciphertext;
  • the designated binary data ciphertext obtaining subunit is configured to use the second hash value as an encryption key to encrypt the designated binary data to obtain the designated binary data ciphertext;
  • the first physical location storage subunit is configured to store the designated binary data ciphertext and the second difference data ciphertext to a preset first physical location.
  • the device includes:
  • a snapshot read instruction receiving unit configured to receive a snapshot read instruction, the snapshot read instruction carries a verification image used to verify identity
  • the similarity calculation unit is configured to calculate the similarity value between the verification image and the pre-stored planar image according to a preset similarity calculation method, and determine whether the similarity value is greater than a preset similarity threshold, wherein
  • the plane image is the plane projection image of the pre-stored three-dimensional virtual graphics in the specified direction;
  • the redirection unit is configured to perform redirection processing on the initial data if the similarity value is greater than a preset similarity threshold value, where the redirection processing refers to redirecting a different physical location in the initial data to The first logical address;
  • the reading unit is used to read the initial data after redirection processing.
  • an embodiment of the present invention also provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in the figure.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor designed by the computer 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, a computer program, and a database.
  • the memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store the data used in the snapshot generation method based on the polymorphic storage mechanism.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a snapshot generation method based on a polymorphic storage mechanism.
  • the above-mentioned processor executes the above-mentioned snapshot generation method based on the polymorphic storage mechanism, wherein the steps included in the method respectively correspond one-to-one with the steps of executing the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment, and will not be repeated here.
  • An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored.
  • a computer program is executed by a processor, a method for generating a snapshot based on a polymorphic storage mechanism is realized, wherein the steps included in the method are respectively executed
  • the steps of the snapshot generation method based on the polymorphic storage mechanism in the foregoing embodiment correspond one-to-one, and are not repeated here.

Abstract

A polymorphic storage mechanism-based snapshot generation method, an apparatus, a computer device, and a storage medium. The method comprising: receiving a command to generate snapshots for multiple storage systems; acquiring storage mechanisms of the storage systems; if a designated storage system the storage mechanism of which is a polymorphic storage mechanism is present among the multiple storage systems, acquiring discrepant data and the discrepant physical location at which the discrepant data is stored; if the discrepant data also comprises second discrepant data, performing binary conversion to obtain designated binary data; storing the designated binary data and the second discrepant data at a preset first physical location; generating a first snapshot indication volume, the first snapshot indication volume comprising a first logical address and the discrepant physical location, and the first logical address pointing to a first physical address. Thus, snapshots of multiple storage systems relating to a polymorphic storage mechanism are achieved, and the applicability of snapshots is improved.

Description

基于多态存储机制的快照生成方法、装置和计算机设备Snapshot generation method, device and computer equipment based on polymorphic storage mechanism
本申请要求于2019年9月19日提交中国专利局、申请号为201910887181.7,发明名称为“基于多态存储机制的快照生成方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on September 19, 2019, the application number is 201910887181.7, and the invention title is "Snapshot generation method, device and computer equipment based on polymorphic storage mechanism", and its entire content Incorporated in this application by reference.
技术领域Technical field
本申请涉及到计算机领域,特别是涉及到一种基于多态存储机制的快照生成方法、装置、计算机设备和存储介质。This application relates to the computer field, in particular to a snapshot generation method, device, computer equipment, and storage medium based on a polymorphic storage mechanism.
背景技术Background technique
快照是关于指定数据集合的一个完全可用拷贝,该拷贝包括相应数据在某个时间点(拷贝开始的时间点)的映像,即是数据存储的某一时刻的状态记录,可作数据恢复等之用。在目前的数据存储领域中,快照已被大范围应用,但当前的快照技术存在以下问题:A snapshot is a fully usable copy of a specified data set. The copy includes an image of the corresponding data at a certain point in time (the point in time when the copy starts), that is, a record of the state of data storage at a certain time, which can be used for data recovery, etc. use. In the current data storage field, snapshots have been widely used, but the current snapshot technology has the following problems:
1、快照技术基于某个单独存储系统,对于分布式存储,即当某些数据涉及多个存储系统时,只能分别生成多个快照;1. Snapshot technology is based on a single storage system. For distributed storage, that is, when some data involves multiple storage systems, only multiple snapshots can be generated separately;
2、采用多态存储机制的存储系统由于具有更高的数据存储密度,有很大的应用潜力,但区别于普通的二进制存储机制的存储系统,其采用的快照也必须使用多态存储机制,造成快照间的不兼容。2. The storage system that adopts the polymorphic storage mechanism has great application potential because of its higher data storage density, but it is different from the storage system of the ordinary binary storage mechanism, and the snapshot used must also use the polymorphic storage mechanism. Cause incompatibility between snapshots.
因此,传统技术缺少实现涉及多个存储系统的快照,以及进一步涉及多态存储机制的快照的生成方案。Therefore, the conventional technology lacks a scheme for generating snapshots involving multiple storage systems and further involving a multi-state storage mechanism.
技术问题technical problem
本申请的主要目的为提供一种基于多态存储机制的快照生成方法、装置、计算机设备和存储介质,旨在实现了涉及多态存储机制的多个存储系统的快照,提高了快照的适用性。The main purpose of this application is to provide a snapshot generation method, device, computer equipment, and storage medium based on a polymorphic storage mechanism, aiming to realize snapshots of multiple storage systems involving a polymorphic storage mechanism, and improve the applicability of snapshots .
技术解决方案Technical solutions
为了实现上述发明目的,本申请提出一种基于多态存储机制的快照生成方法,应用于中间件,所述中间件位于多个存储系统之间,包括:In order to achieve the above-mentioned purpose of the invention, this application proposes a snapshot generation method based on a polymorphic storage mechanism, which is applied to middleware, and the middleware is located between multiple storage systems, including:
接收对多个存储系统进行快照生成的指令;Receive instructions for generating snapshots of multiple storage systems;
通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;Obtain the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, the difference data of the current stored data that is different from the pre-stored initial data and the difference data are obtained according to the preset difference data acquisition method. The stored difference physical location, wherein the difference data includes the first difference data stored in a polymorphic storage system;
判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;Determining whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems among the plurality of storage systems except the designated storage system;
若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;If the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;Storing the designated binary data and the second difference data in a preset first physical location;
采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。A preset snapshot generation technology is used to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
有益效果Beneficial effect
本申请的基于多态存储机制的快照生成方法、装置、计算机设备和存储介质,接收对多个存储系统进行快照生成的指令;获取所述存储系统的存储机制;若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则获取差异数据和所述差异数据被存储的差异物理位置;若所述差异数据还包括第二差异数据,则进行二进制转换处理,得到指定二进制数据;将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理地址。从而实现了涉及多态存储机制的多个存储系统的快照,提高了快照的适用性。The snapshot generation method, device, computer equipment, and storage medium based on the polymorphic storage mechanism of the present application receive instructions for generating snapshots for multiple storage systems; obtain the storage mechanism of the storage system; if the multiple storage systems are If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism, the difference data and the difference physical location where the difference data is stored are obtained; if the difference data also includes the second difference data, binary conversion processing is performed to obtain the specified binary Data; store the designated binary data and the second difference data to a preset first physical location; generate a first snapshot indication volume, the first snapshot indication volume including a first logical address and the difference physical location , The first logical address points to the first physical address. In this way, snapshots of multiple storage systems involving polymorphic storage mechanisms are realized, and the applicability of snapshots is improved.
附图说明Description of the drawings
图1 为本申请一实施例的基于多态存储机制的快照生成方法的流程示意图;FIG. 1 is a schematic flowchart of a snapshot generation method based on a polymorphic storage mechanism according to an embodiment of the application;
图2 为本申请一实施例的基于多态存储机制的快照生成装置的结构示意框图;2 is a schematic block diagram of the structure of a snapshot generation device based on a polymorphic storage mechanism according to an embodiment of the application;
图3 为本申请一实施例的计算机设备的结构示意框图。FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
本发明的最佳实施方式The best mode of the present invention
参照图1,本申请实施例提供一种基于多态存储机制的快照生成方法,应用于中间件,所述中间件位于多个存储系统之间,所述方法包括:1, an embodiment of the present application provides a snapshot generation method based on a polymorphic storage mechanism, which is applied to middleware, the middleware is located between multiple storage systems, and the method includes:
S1、接收对多个存储系统进行快照生成的指令;S1. Receive an instruction to generate snapshots of multiple storage systems;
S2、通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;S2. Obtain the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
S3、若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;S3. If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, obtain the difference data and the difference between the current stored data and the prestored initial data according to the preset difference data acquisition method The difference physical location where the data is stored, wherein the difference data includes the first difference data stored in a polymorphic storage system;
S4、判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;S4. Determine whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems in the plurality of storage systems except the designated storage system;
S5、若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;S5. If the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
S6、将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;S6. Store the designated binary data and the second difference data in a preset first physical location;
S7、采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。S7. Use a preset snapshot generation technology to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
如上述步骤S1所述,接收对多个存储系统进行快照生成的指令。其中,本申请应用于中间件,所述中间件位于多个存储系统之间,因此本申请的快照生成不再基于各个存储系统自身,而是由中间件实现统一的快照处理,以解决多个存储系统无法共同生成同一且统一的快照的问题。其中,中间件是一种独立的服务程序,用以对接多个存储系统,其中所述中间件可位于任意位置,优选处于服务器中。As described in step S1 above, an instruction to generate snapshots for multiple storage systems is received. Among them, this application is applied to middleware, and the middleware is located between multiple storage systems. Therefore, the snapshot generation of this application is no longer based on each storage system itself. Instead, the middleware implements unified snapshot processing to solve multiple storage systems. The storage system cannot jointly generate the same and unified snapshot. Among them, the middleware is an independent service program used to interface with multiple storage systems, wherein the middleware can be located in any location, preferably in a server.
如上述步骤S2所述,通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统。普通的二进制存储机制,例如以磁畴形式存储,指利用磁畴的磁化方向为正或者为负的两个状态来存储信息。而区别于二进制存储机制的多态存储机制,是指以多于两个状态来存储信息,例如利用磁电效应下存储介质的不同电学特性,其中例如采用钙钛矿结构的BiFeO3基磁电材料实现的多态存储机制。所述磁电效应下存储介质的不同电学特性例如为:在不同磁场(例如正向磁场与反向磁场)与不同电场(例如正向电场与反向电场)的条件下,具有磁电效应的存储介质的介电常数的数值会有明显的变化(例如因为相变等机制造成),因此通过介电常数的数值即可作为数据存储的依据。具体地,预设的存储机制识别方法例如为:利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。As described in step S2 above, the storage mechanism of the storage system is acquired through the preset storage mechanism identification method, and it is determined whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems. Ordinary binary storage mechanisms, such as storage in the form of magnetic domains, refer to the use of two states in which the magnetization direction of the magnetic domain is positive or negative to store information. The multi-state storage mechanism, which is different from the binary storage mechanism, refers to the storage of information in more than two states, such as the use of the different electrical characteristics of the storage medium under the magnetoelectric effect, such as the BiFeO3-based magnetoelectric material with a perovskite structure Implemented polymorphic storage mechanism. The different electrical characteristics of the storage medium under the magnetoelectric effect are, for example, those with magnetoelectric effect under different magnetic fields (for example, a forward magnetic field and a reverse magnetic field) and different electric fields (for example, a forward electric field and a reverse electric field). The value of the dielectric constant of the storage medium will change significantly (for example, due to mechanisms such as phase change), so the value of the dielectric constant can be used as the basis for data storage. Specifically, the preset storage mechanism identification method is, for example, using preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain the storage test primitives in different locations. Multiple electrical data under a magnetic field and different electric fields; judging whether the multiple electrical data are within three or more preset value ranges; if the multiple electrical data are within three or more preset values Within the numerical range, it is determined that the storage mechanism of the storage system is a polymorphic storage mechanism.
如上述步骤S3所述,若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据。快照技术读和写的速度均快于普通的备份技术,原因在于它只需记录区别数据即可,无需复制所有的数据。因此本申请根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置。具体地,预设的差异数据获取方法例如为:从系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。As described in step S3 above, if there is a designated storage system whose storage mechanism is a polymorphic storage mechanism in the multiple storage systems, the difference between the current stored data and the pre-stored initial data is obtained according to the preset difference data acquisition method The difference physical location where the data and the difference data are stored, wherein the difference data includes the first difference data stored in a polymorphic storage system. Snapshot technology reads and writes faster than ordinary backup technology, because it only needs to record different data, without copying all the data. Therefore, the present application obtains the difference data of the current stored data that is different from the pre-stored initial data and the difference physical location where the difference data is stored according to the preset difference data acquisition method. Specifically, the preset difference data acquisition method is, for example: acquiring the designated data modification record after the generation time of the initial data from the system log; performing classification processing on the designated data modification record by physical address, thereby Divide the specified data modification records into multiple data record sets; mark the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and obtain the difference data.
如上述步骤S4所述,判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据。若所述差异数据仅包括第一差异数据,则无需进行二进制转换,而直接利用多态存储机制复制差异数据即可。As described in step S4 above, it is determined whether the difference data further includes second difference data, and the second difference data is stored in other storage systems of the plurality of storage systems except the designated storage system. data. If the difference data only includes the first difference data, there is no need to perform binary conversion, and the difference data can be copied directly using a polymorphic storage mechanism.
如上述步骤S5所述,若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据。其中二进制转换处理的过程例如为:获取所述第一差异数据对应的存储基元的指定电学数据,所述存储基元为所述第一差异数据的最小存储单位;将所述存储基元分为第一存储基元、第二存储基元、第三存储基元和第四存储基元,其中所述第一存储基元的指定电学数据的数值处于第一数值范围之内,所述第二存储基元的指定电学数据的数值处于第二数值范围之内,所述第三存储基元的指定电学数据的数值处于第三数值范围之内,所述第四存储基元的指定电学数据的数值处于第四数值范围之内;建立第三映射基元对与第四映射基元对,所述第三映射基元对由一个电学数据的数值处于第二数据范围之内的存储基元和一个电学数据的数值处于第一数据范围之内的存储基元顺序构成,所述第四映射基元对由两个电学数据的数值均处于第二数据范围之内的存储基元顺序构成;执行对所述第一差异数据的映射读取操作,所述映射读取操作在读取第三存储基元时采用第三映射基元对替代所述第三存储基元,并在读取第四存储基元时采用第四映射基元对替代所述第四存储基元,从而得到指定二进制数据。As described in step S5 above, if the difference data further includes the second difference data, the first difference data is subjected to binary conversion processing to obtain designated binary data. The process of binary conversion processing is, for example: obtaining the specified electrical data of the storage element corresponding to the first difference data, the storage element being the smallest storage unit of the first difference data; dividing the storage element Are the first storage element, the second storage element, the third storage element, and the fourth storage element, wherein the value of the specified electrical data of the first storage element is within the first numerical range, and the first storage element The value of the specified electrical data of the second storage element is within the second numerical range, the value of the specified electrical data of the third storage element is within the third numerical range, and the specified electrical data of the fourth storage element The value of is within the fourth value range; a third mapping element pair and a fourth mapping element pair are established, and the third mapping element pair consists of a storage element whose electrical data value is within the second data range And a sequence of storage primitives whose values of electrical data are within the first data range, and the fourth mapping primitive pair is composed of a sequence of storage primitives whose values of two electrical data are both within the second data range; Perform a mapping read operation on the first difference data. The mapping read operation uses a third mapping primitive pair to replace the third storage primitive when reading the third storage primitive, and when reading the third storage primitive, In the case of four storage primitives, a fourth mapping primitive pair is used to replace the fourth storage primitive, thereby obtaining designated binary data.
如上述步骤S6所述,将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置。进一步地,在存储数据之时,还可以使用预设的加密技术进行加密从而得到密文,再将密文存储至预设的第一物理位置,从而保证信息的安全性。As described in step S6 above, the designated binary data and the second difference data are stored in a preset first physical location. Further, when storing data, a preset encryption technique may be used to encrypt to obtain a ciphertext, and then the ciphertext is stored in a preset first physical location, so as to ensure the security of the information.
如上述步骤S7所述,采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。快照生成技术可为任意技术,例如为写时重定向快照技术,或者写时复制快照技术,优选写时重定向快照技术。其中,所述第一快照指示卷中的第一逻辑地址提供了差异数据的位置,差异物理位置提供了初始数据中差异数据的位置,因此需要读取快照时,只需根据第一快照指示卷和初始数据即可实现快照读取。As described in step S7 above, the preset snapshot generation technology is used to generate a first snapshot indicating volume. The first snapshot indicating volume includes a first logical address and the differential physical location, and the first logical address points to the The first physical location. The snapshot generation technology can be any technology, for example, a snapshot-redirection-on-write technology, or a snapshot-replication technology-on-write technology, preferably the technology of redirecting a snapshot-on-write snapshot. Wherein, the first snapshot indicates that the first logical address in the volume provides the location of the differential data, and the differential physical location provides the location of the differential data in the initial data. Therefore, when you need to read the snapshot, you only need to indicate the volume according to the first snapshot. And the initial data can realize the snapshot read.
在一个实施方式中,所述多态存储机制是基于磁电效应的存储机制,所述存储系统具有用于测试存储机制的存储测试基元,所述存储测试基元的存储位数为1,所述通过预设的存储机制识别方法,获取所述存储系统的存储机制的步骤S2,包括:In one embodiment, the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect, the storage system has a storage test primitive for testing the storage mechanism, and the storage number of the storage test primitive is 1, The step S2 of obtaining the storage mechanism of the storage system through the preset storage mechanism identification method includes:
S201、利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;S201. Use preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain multiple electrical data of the storage test primitives under different magnetic fields and different electric fields ;
S202、判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;S202: Determine whether the multiple electrical data are within three or more preset numerical ranges;
S203、若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。S203: If the multiple electrical data are within three or more preset numerical ranges, determine that the storage mechanism of the storage system is a polymorphic storage mechanism.
如上所述,实现了通过预设的存储机制识别方法,获取所述存储系统的存储机制。本申请的存储系统中具有用于测试存储机制的存储测试基元,由于所述存储测试基元的存储位数为1,因此几乎不会存在额外的存储压力,并且通过对该存储测试基元的测试,可以准确获取存储系统的存储机制,而不需要调用已存数据,从而减少已存数据的读写次数,还避免可能的误擦写错误。其中所述多态存储机制是基于磁电效应的存储机制,因此在不同的磁场与不同的电场下,多态存储机制的存储测试基元将表现出多种状态,也即是多个处于三个以上的数值范围之内的电学数据。据此,通过判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内,从而判断所述存储系统的存储机制是否为多态存储机制。其中所述电学数据与所述磁电效应和存储测试基元相关,例如若所述存储测试基元是通过介电常数的不同状态来存储数据,则相应的电学数据为介电常数。As described above, the storage mechanism of the storage system can be obtained through the preset storage mechanism identification method. The storage system of the present application has a storage test primitive for testing the storage mechanism. Since the storage bit of the storage test primitive is 1, there is almost no additional storage pressure, and the storage test primitive is passed The test can accurately obtain the storage mechanism of the storage system without the need to call the stored data, thereby reducing the number of reads and writes of the stored data, and also avoids possible mistakes in erasing and writing. The multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect. Therefore, under different magnetic fields and different electric fields, the storage test primitives of the multi-state storage mechanism will exhibit multiple states, that is, multiple states are in three states. Electrical data within the range of more than one value. Accordingly, it is determined whether the storage mechanism of the storage system is a polymorphic storage mechanism by judging whether the plurality of electrical data are within three or more preset numerical ranges. The electrical data is related to the magnetoelectric effect and the storage test element. For example, if the storage test element stores data through different states of dielectric constant, the corresponding electrical data is the dielectric constant.
在一个实施方式中,所述多个存储系统的数据修改记录均保存在系统日志中,所述根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据的步骤S3,包括:In one embodiment, the data modification records of the multiple storage systems are all saved in the system log, and the step S3 of acquiring the difference data of the current stored data that is different from the prestored initial data according to the preset difference data acquisition method ,include:
S301、从所述系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;S301. Obtain a specified data modification record after the generation time of the initial data from the system log;
S302、对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;S302: Perform classification processing on the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
S303、将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。S303. Record the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and obtain the difference data.
如上所述,实现了根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据。由于所述多个存储系统的数据修改记录均保存在系统日志,因此无需采用普通的数据对比方法去依次对比当前存储数据与初始数据的区别,从而减少了数据处理压力。并且,由于数据修改时可能存在对存储于同一位置的数据进行多次修改的可能,因此本申请采用对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据的方式,将最新的数据作为差异数据。As described above, it is realized that according to the preset difference data obtaining method, the difference data of the currently stored data different from the pre-stored initial data is obtained. Since the data modification records of the multiple storage systems are all stored in the system log, there is no need to use a common data comparison method to sequentially compare the difference between the current stored data and the initial data, thereby reducing the data processing pressure. In addition, since there may be multiple modifications to the data stored in the same location when data is modified, this application uses the specified data modification record to be classified according to physical address, so as to classify the designated data modification record. Divide into multiple data record sets; record the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and use the latest data as the difference data to obtain the difference data.
在一个实施方式中,所述判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据的步骤S4之后,包括:In one embodiment, the judging whether the difference data further includes second difference data, and the second difference data is stored in a storage system other than the designated storage system among the plurality of storage systems The data after step S4 includes:
S41、若所述差异数据不包括第二差异数据,则在所述指定存储系统中预设的第二物理位置存储所述第一差异数据;S41. If the difference data does not include the second difference data, store the first difference data in a second physical location preset in the designated storage system;
S42、采用预设的快照生成技术,生成第二快照指示卷,所述第二快照指示卷包括第二逻辑地址,所述第二逻辑地址指向所述第二物理地址。S42. Use a preset snapshot generation technology to generate a second snapshot indication volume, where the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
如上所述,实现了生成第二快照指示卷。若所述差异数据不包括第二差异数据,表明差异数据均来自存储机制为多态存储机制的存储系统,此时若再进行二进制转换价值不高,因此直接在所述指定存储系统中预设的第二物理位置存储所述第一差异数据即可。再采用预设的快照生成技术,生成第二快照指示卷,所述第二快照指示卷包括第二逻辑地址,所述第二逻辑地址指向所述第二物理地址。从而基于第二快照指示卷与初始数据即可实现快照读取,并且在读取时先确定所述第二物理位置处于指定存储系统中,则在读取快照时对非多态存储机制的存储系统的数据可快速读取,无需判断是否进行过修改,从而提高了快照读取速度。As described above, the generation of the second snapshot indication volume is achieved. If the difference data does not include the second difference data, it indicates that the difference data comes from a storage system whose storage mechanism is a polymorphic storage mechanism. At this time, the value of binary conversion is not high, so it is directly preset in the designated storage system It suffices to store the first difference data in the second physical location of. Then, a preset snapshot generation technology is used to generate a second snapshot indication volume, the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address. Therefore, snapshot reading can be realized based on the second snapshot indicating volume and initial data, and when reading, it is first determined that the second physical location is in the designated storage system, then the storage of the non-polymorphic storage mechanism is performed when the snapshot is read. The data of the system can be read quickly without judging whether it has been modified, thereby improving the speed of snapshot reading.
在一个实施方式中,所述多态存储机制是基于磁电效应的四态存储机制,所述将所述第一差异数据进行二进制转换处理,得到指定二进制数据的步骤S5,包括:In one embodiment, the multi-state storage mechanism is a four-state storage mechanism based on the magnetoelectric effect, and the step S5 of performing binary conversion processing on the first difference data to obtain designated binary data includes:
S501、获取所述第一差异数据对应的存储基元的指定电学数据,所述存储基元为所述第一差异数据的最小存储单位;S501. Acquire designated electrical data of a storage element corresponding to the first difference data, where the storage element is the smallest storage unit of the first difference data;
S502、将所述存储基元分为第一存储基元、第二存储基元、第三存储基元和第四存储基元,其中所述第一存储基元的指定电学数据的数值处于第一数值范围之内,所述第二存储基元的指定电学数据的数值处于第二数值范围之内,所述第三存储基元的指定电学数据的数值处于第三数值范围之内,所述第四存储基元的指定电学数据的数值处于第四数值范围之内;S502. Divide the storage primitives into a first storage primitive, a second storage primitive, a third storage primitive, and a fourth storage primitive, wherein the value of the specified electrical data of the first storage primitive is in the first storage primitive. Within a numerical range, the value of the specified electrical data of the second storage element is within the second numerical range, and the value of the specified electrical data of the third storage element is within the third numerical range, the The value of the designated electrical data of the fourth storage element is within the fourth value range;
S503、建立第三映射基元对与第四映射基元对,所述第三映射基元对由一个电学数据的数值处于第二数据范围之内的存储基元和一个电学数据的数值处于第一数据范围之内的存储基元顺序构成,所述第四映射基元对由两个电学数据的数值均处于第二数据范围之内的存储基元顺序构成;S503. Establish a third mapping element pair and a fourth mapping element pair, where the third mapping element pair consists of a storage element whose value of electrical data is in the second data range and a value of electrical data that is in the first data range. A sequence of storage primitives within a data range is constituted, and the fourth mapping primitive pair is constituted by a sequence of storage primitives in which the values of two electrical data are both within the second data range;
S504、执行对所述第一差异数据的映射读取操作,所述映射读取操作在读取第三存储基元时采用第三映射基元对替代所述第三存储基元,并在读取第四存储基元时采用第四映射基元对替代所述第四存储基元,从而得到指定二进制数据。S504. Perform a mapping read operation on the first difference data, where the mapping read operation uses a third mapping primitive pair to replace the third storage primitive when reading the third storage primitive, and when reading the third storage primitive, When the fourth storage element is taken, a fourth mapping element pair is used to replace the fourth storage element, thereby obtaining designated binary data.
如上所述,实现了将所述第一差异数据进行二进制转换处理,得到指定二进制数据。本申请采用保存两个存储状态,并仅对其他两个存储状态进行映射的方式,使得本申请的二进制转换的处理效率提高了一倍。其中所述第一存储基元存储的数据相当于二进制数据中的0,所述第二存储基元存储的数据相当于二进制数据中的1,所述第三存储基元存储的数据相当于二进制数据中的10,所述第四存储基元存储的数据相当于二进制数据中的11。由于采用了分类处理,因此只需建立第三存储基元-第三映射基元对,第四存储基元-第四映射基元对的映射即可。在映射读取操作时,读取所述第一存储基元和所述第二存储基元时不变,在读取所述第三存储基元和所述第四存储基元时变为读取对应的第三映射基元对和第四映射基元对,从而得到准确的指定二进制数据。As described above, the binary conversion processing of the first difference data is implemented to obtain designated binary data. In this application, two storage states are saved and only the other two storage states are mapped, which doubles the processing efficiency of the binary conversion in this application. The data stored in the first storage element is equivalent to 0 in binary data, the data stored in the second storage element is equivalent to 1 in binary data, and the data stored in the third storage element is equivalent to binary data. 10 in the data, the data stored in the fourth storage element is equivalent to 11 in the binary data. Since the classification process is adopted, only the third storage primitive-third mapping primitive pair and the fourth storage primitive-fourth mapping primitive pair mapping can be established. During the mapping read operation, the reading of the first storage element and the second storage element does not change, and when the third storage element and the fourth storage element are read, it becomes read Take the corresponding third mapping primitive pair and fourth mapping primitive pair to obtain accurate designated binary data.
在一个实施方式中,所述将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置的步骤S6,包括:In one embodiment, the step S6 of storing the designated binary data and the second difference data to a preset first physical location includes:
S601、根据预设的哈希算法,对所述指定二进制数据进行哈希计算,得到第一哈希值;S601: Perform a hash calculation on the designated binary data according to a preset hash algorithm to obtain a first hash value;
S602、根据预设的哈希算法,对所述第二差异数据进行哈希计算,得到第二哈希值;S602. Perform a hash calculation on the second difference data according to a preset hash algorithm to obtain a second hash value.
S603、使用第一哈希值作为加密密钥,对所述第二差异数据进行加密,得到第二差异数据密文;S603. Use the first hash value as an encryption key to encrypt the second difference data to obtain a ciphertext of the second difference data.
S604、使用第二哈希值作为加密密钥,对所述指定二进制数据进行加密,得到指定二进制数据密文;S604: Use the second hash value as an encryption key to encrypt the designated binary data to obtain a ciphertext of the designated binary data;
S605、将所述指定二进制数据密文和所述第二差异数据密文存储至预设的第一物理位置。S605. Store the designated binary data ciphertext and the second difference data ciphertext in a preset first physical location.
如上所述,实现了将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置。本申请采用交叉制加密的方式,提高了信息安全性。其中由于加密密钥分别来自交叉的所述指定二进制数据与所述第二差异数据,加密对象又是交叉的所述第二差异数据和所述指定二进制数据,因此信息安全性能够得以保证,并且减少了普通加密技术中需要的密钥存储空间(不需要预先存储密钥)。As described above, it is realized that the designated binary data and the second difference data are stored in the preset first physical location. This application adopts a cross-encryption method to improve information security. Wherein, since the encryption keys are respectively derived from the crossed designated binary data and the second difference data, and the encryption object is the crossed second difference data and the designated binary data, the information security can be guaranteed, and Reduce the key storage space required in common encryption technology (no need to store the key in advance).
在一个实施方式中,所述采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置的步骤S7之后,包括:In one embodiment, the preset snapshot generation technology is used to generate a first snapshot indication volume, the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to all After the step S7 of the first physical location, it includes:
S71、接收快照读取指令,所述快照读取指令携带有用于验证身份的验证图像;S71. Receive a snapshot read instruction, where the snapshot read instruction carries a verification image used to verify identity;
S72、根据预设的相似度计算方法,计算所述验证图像与预存的平面图像的相似度值,并判断所述相似度值是否大于预设的相似度阈值,其中所述平面图像是预存的立体虚拟图形在指定方向上的平面投影图像;S72. Calculate the similarity value between the verification image and the pre-stored planar image according to a preset similarity calculation method, and determine whether the similarity value is greater than a preset similarity threshold, wherein the planar image is pre-stored The plane projection image of the three-dimensional virtual graphics in the specified direction;
S73、若所述相似度值大于预设的相似度阈值,则对所述初始数据进行重定向处理,所述重定向处理指将所述初始数据中的差异物理位置重定向为所述第一逻辑地址;S73. If the similarity value is greater than a preset similarity threshold, perform redirection processing on the initial data, where the redirection processing refers to redirecting a different physical location in the initial data to the first Logical address
S74、读取重定向处理后的初始数据。S74. Read the initial data after redirection processing.
如上所述,实现了快照读取。本申请采用了计算所述验证图像与预存的平面图像的相似度值,并判断所述相似度值是否大于预设的相似度阈值,以验证身份。其中立体虚拟图形是虚拟的三维空间中的立体图形,因此在不同的指定方向上的平面投影图像均不同,据此作为身份验证的依据。预先约定了指定投影方向,从而生成平面投影图像,再将所述平面投影图像发送给用户。若用户提供的验证图像与所述平面投影图像是相同或相似的,则判定身份认证无误,从而通过对所述初始数据进行重定向处理,所述重定向处理指将所述初始数据中的差异物理位置重定向为所述第一逻辑地址;读取重定向处理后的初始数据实现快照读取。As described above, snapshot reading is realized. This application uses the calculation of the similarity value between the verification image and the pre-stored planar image, and determines whether the similarity value is greater than a preset similarity threshold to verify the identity. The three-dimensional virtual figure is a three-dimensional figure in a virtual three-dimensional space, so the plane projection images in different designated directions are different, which is used as a basis for identity verification. The designated projection direction is agreed in advance to generate a flat projection image, and then the flat projection image is sent to the user. If the verification image provided by the user is the same or similar to the plane projection image, it is determined that the identity authentication is correct, and the initial data is redirected. The redirection refers to the difference in the initial data. The physical location redirection is the first logical address; the initial data after the redirection process is read to implement snapshot reading.
参照图2,本申请实施例提供一种基于多态存储机制的快照生成装置,应用于中间件,所述中间件位于多个存储系统之间,所述装置包括:2, an embodiment of the present application provides a snapshot generation device based on a polymorphic storage mechanism, which is applied to middleware, the middleware is located between multiple storage systems, and the device includes:
快照生成指令接收单元10,用于接收对多个存储系统进行快照生成的指令;The snapshot generation instruction receiving unit 10 is configured to receive a snapshot generation instruction for multiple storage systems;
存储机制获取单元20,用于通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;The storage mechanism acquisition unit 20 is configured to acquire the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
差异数据获取单元30,用于若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;The difference data obtaining unit 30 is configured to, if there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, according to a preset difference data obtaining method, obtain the difference between the current stored data and the pre-stored initial data The difference data and the difference physical location where the difference data is stored, wherein the difference data includes the first difference data stored in a polymorphic storage system;
第二差异数据判断单元40,用于判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;The second difference data judging unit 40 is configured to judge whether the difference data further includes second difference data, and the second difference data is stored in the plurality of storage systems other than the designated storage system Data in the system;
指定二进制数据获取单元50,用于若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;The designated binary data acquiring unit 50 is configured to, if the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
第一物理位置存储单元60,用于将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;The first physical location storage unit 60 is configured to store the designated binary data and the second difference data to a preset first physical location;
第一快照指示卷生成单元70,用于采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。The first snapshot indication volume generating unit 70 is configured to generate a first snapshot indication volume using a preset snapshot generation technology, where the first snapshot indication volume includes a first logical address and the difference physical location, and the first logical The address points to the first physical location.
其中上述单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment, and are not repeated here.
在一个实施方式中,所述多态存储机制是基于磁电效应的存储机制,所述存储系统具有用于测试存储机制的存储测试基元,所述存储测试基元的存储位数为1,所述存储机制获取单元20,包括:In one embodiment, the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect, the storage system has a storage test primitive for testing the storage mechanism, and the storage number of the storage test primitive is 1, The storage mechanism acquisition unit 20 includes:
电学数据获取子单元,用于利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;The electrical data acquisition subunit is used to use preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain the storage test primitives in different magnetic fields and different electric fields. Multiple electrical data under;
数值范围判断子单元,用于判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;The numerical value range judgment subunit is used to judge whether the plurality of electrical data are respectively within three or more preset numerical value ranges;
多态存储机制判定子单元,用于若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。The polymorphic storage mechanism determination subunit is configured to determine that the storage mechanism of the storage system is a polymorphic storage mechanism if the plurality of electrical data are within three or more preset value ranges.
其中上述子单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned sub-units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment one-to-one, and will not be repeated here.
在一个实施方式中,所述多个存储系统的数据修改记录均保存在系统日志中,所述差异数据获取单元30,包括:In one embodiment, the data modification records of the multiple storage systems are all saved in the system log, and the difference data obtaining unit 30 includes:
指定数据修改记录获取子单元,用于从所述系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;The designated data modification record obtaining subunit is configured to obtain the designated data modification record after the generation time of the initial data from the system log;
归类处理子单元,用于对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;The classification processing subunit is used to classify the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
差异数据获取子单元,用于将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。The difference data obtaining subunit is used to record the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and to obtain the difference data.
其中上述子单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned sub-units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment one-to-one, and will not be repeated here.
在一个实施方式中,所述装置,包括:In one embodiment, the device includes:
第一差异数据存储单元,用于若所述差异数据不包括第二差异数据,则在所述指定存储系统中预设的第二物理位置存储所述第一差异数据;A first difference data storage unit, configured to store the first difference data in a second physical location preset in the designated storage system if the difference data does not include the second difference data;
第二快照指示卷生成单元,用于采用预设的快照生成技术,生成第二快照指示卷,所述第二快照指示卷包括第二逻辑地址,所述第二逻辑地址指向所述第二物理地址。The second snapshot indication volume generation unit is configured to generate a second snapshot indication volume using a preset snapshot generation technology, the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
其中上述单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment, and are not repeated here.
在一个实施方式中,所述多态存储机制是基于磁电效应的四态存储机制,所述指定二进制数据获取单元50,包括:In one embodiment, the multi-state storage mechanism is a four-state storage mechanism based on the magnetoelectric effect, and the designated binary data acquisition unit 50 includes:
指定电学数据获取子单元,用于获取所述第一差异数据对应的存储基元的指定电学数据,所述存储基元为所述第一差异数据的最小存储单位;A designated electrical data acquisition subunit for acquiring designated electrical data of a storage element corresponding to the first difference data, the storage element being the smallest storage unit of the first difference data;
存储基元划分子单元,用于将所述存储基元分为第一存储基元、第二存储基元、第三存储基元和第四存储基元,其中所述第一存储基元的指定电学数据的数值处于第一数值范围之内,所述第二存储基元的指定电学数据的数值处于第二数值范围之内,所述第三存储基元的指定电学数据的数值处于第三数值范围之内,所述第四存储基元的指定电学数据的数值处于第四数值范围之内;The storage element division subunit is used to divide the storage element into a first storage element, a second storage element, a third storage element, and a fourth storage element, wherein the first storage element The value of the specified electrical data is within the first value range, the value of the specified electrical data of the second storage element is within the second value range, and the value of the specified electrical data of the third storage element is within the third value range. Within the numerical range, the numerical value of the designated electrical data of the fourth storage element is within the fourth numerical range;
映射基元对建立子单元,用于建立第三映射基元对与第四映射基元对,所述第三映射基元对由一个电学数据的数值处于第二数据范围之内的存储基元和一个电学数据的数值处于第一数据范围之内的存储基元顺序构成,所述第四映射基元对由两个电学数据的数值均处于第二数据范围之内的存储基元顺序构成;The mapping primitive pair establishment subunit is used to establish a third mapping primitive pair and a fourth mapping primitive pair. The third mapping primitive pair is a storage primitive whose value of electrical data is within the second data range. And a sequence of storage primitives whose values of electrical data are within the first data range, and the fourth mapping primitive pair is composed of a sequence of storage primitives whose values of two electrical data are both within the second data range;
映射读取子单元,用于执行对所述第一差异数据的映射读取操作,所述映射读取操作在读取第三存储基元时采用第三映射基元对替代所述第三存储基元,并在读取第四存储基元时采用第四映射基元对替代所述第四存储基元,从而得到指定二进制数据。The mapping read subunit is configured to perform a mapping read operation on the first difference data, where the mapping read operation uses a third mapping primitive pair to replace the third storage when reading a third storage primitive Primitives, and when reading the fourth storage primitives, a fourth mapping primitive pair is used to replace the fourth storage primitives, so as to obtain designated binary data.
其中上述子单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned sub-units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment one-to-one, and will not be repeated here.
在一个实施方式中,所述第一物理位置存储单元60,包括:In one embodiment, the first physical location storage unit 60 includes:
第一哈希值获取子单元,用于根据预设的哈希算法,对所述指定二进制数据进行哈希计算,得到第一哈希值;The first hash value obtaining subunit is configured to perform a hash calculation on the designated binary data according to a preset hash algorithm to obtain the first hash value;
第二哈希值获取子单元,用于根据预设的哈希算法,对所述第二差异数据进行哈希计算,得到第二哈希值;The second hash value obtaining subunit is configured to perform a hash calculation on the second difference data according to a preset hash algorithm to obtain a second hash value;
第二差异数据密文获取子单元,用于使用第一哈希值作为加密密钥,对所述第二差异数据进行加密,得到第二差异数据密文;The second difference data ciphertext obtaining subunit is configured to use the first hash value as an encryption key to encrypt the second difference data to obtain the second difference data ciphertext;
指定二进制数据密文获取子单元,用于使用第二哈希值作为加密密钥,对所述指定二进制数据进行加密,得到指定二进制数据密文;The designated binary data ciphertext obtaining subunit is configured to use the second hash value as an encryption key to encrypt the designated binary data to obtain the designated binary data ciphertext;
第一物理位置存储子单元,用于将所述指定二进制数据密文和所述第二差异数据密文存储至预设的第一物理位置。The first physical location storage subunit is configured to store the designated binary data ciphertext and the second difference data ciphertext to a preset first physical location.
其中上述子单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned sub-units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment one-to-one, and will not be repeated here.
在一个实施方式中,所述装置,包括:In one embodiment, the device includes:
快照读取指令接收单元,用于接收快照读取指令,所述快照读取指令携带有用于验证身份的验证图像;A snapshot read instruction receiving unit, configured to receive a snapshot read instruction, the snapshot read instruction carries a verification image used to verify identity;
相似度计算单元,用于根据预设的相似度计算方法,计算所述验证图像与预存的平面图像的相似度值,并判断所述相似度值是否大于预设的相似度阈值,其中所述平面图像是预存的立体虚拟图形在指定方向上的平面投影图像;The similarity calculation unit is configured to calculate the similarity value between the verification image and the pre-stored planar image according to a preset similarity calculation method, and determine whether the similarity value is greater than a preset similarity threshold, wherein The plane image is the plane projection image of the pre-stored three-dimensional virtual graphics in the specified direction;
重定向单元,用于若所述相似度值大于预设的相似度阈值,则对所述初始数据进行重定向处理,所述重定向处理指将所述初始数据中的差异物理位置重定向为所述第一逻辑地址;The redirection unit is configured to perform redirection processing on the initial data if the similarity value is greater than a preset similarity threshold value, where the redirection processing refers to redirecting a different physical location in the initial data to The first logical address;
读取单元,用于读取重定向处理后的初始数据。The reading unit is used to read the initial data after redirection processing.
其中上述单元分别用于执行的操作与前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The operations performed by the above-mentioned units respectively correspond to the steps of the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment, and are not repeated here.
参照图3,本发明实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储基于多态存储机制的快照生成方法所用数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于多态存储机制的快照生成方法。Referring to FIG. 3, an embodiment of the present invention also provides a computer device. The computer device may be a server, and its internal structure may be as shown in the figure. The computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor designed by the computer 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, a computer program, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store the data used in the snapshot generation method based on the polymorphic storage mechanism. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to realize a snapshot generation method based on a polymorphic storage mechanism.
上述处理器执行上述基于多态存储机制的快照生成方法,其中所述方法包括的步骤分别与执行前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。The above-mentioned processor executes the above-mentioned snapshot generation method based on the polymorphic storage mechanism, wherein the steps included in the method respectively correspond one-to-one with the steps of executing the snapshot generation method based on the polymorphic storage mechanism of the foregoing embodiment, and will not be repeated here.
本申请一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现基于多态存储机制的快照生成方法,其中所述方法包括的步骤分别与执行前述实施方式的基于多态存储机制的快照生成方法的步骤一一对应,在此不再赘述。An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, a method for generating a snapshot based on a polymorphic storage mechanism is realized, wherein the steps included in the method are respectively executed The steps of the snapshot generation method based on the polymorphic storage mechanism in the foregoing embodiment correspond one-to-one, and are not repeated here.
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the specification and drawings of this application, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of this application.

Claims (20)

  1. 一种基于多态存储机制的快照生成方法,其特征在于,应用于中间件,所述中间件位于多个存储系统之间,所述方法包括:A snapshot generation method based on a polymorphic storage mechanism, characterized in that it is applied to middleware, the middleware is located between multiple storage systems, and the method includes:
    接收对多个存储系统进行快照生成的指令;Receive instructions for generating snapshots of multiple storage systems;
    通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;Obtain the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
    若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, the difference data of the current stored data that is different from the pre-stored initial data and the difference data are obtained according to the preset difference data acquisition method. The stored difference physical location, wherein the difference data includes the first difference data stored in a polymorphic storage system;
    判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;Determining whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems among the plurality of storage systems except the designated storage system;
    若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;If the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
    将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;Storing the designated binary data and the second difference data in a preset first physical location;
    采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。A preset snapshot generation technology is used to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
  2. 根据权利要求1所述的基于多态存储机制的快照生成方法,其特征在于,所述多态存储机制是基于磁电效应的存储机制,所述存储系统具有用于测试存储机制的存储测试基元,所述存储测试基元的存储位数为1,所述通过预设的存储机制识别方法,获取所述存储系统的存储机制的步骤,包括:The snapshot generation method based on a multi-state storage mechanism according to claim 1, wherein the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect, and the storage system has a storage test base for testing the storage mechanism. The storage bit number of the storage test primitive is 1, and the step of obtaining the storage mechanism of the storage system through a preset storage mechanism identification method includes:
    利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;Using preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain multiple electrical data of the storage test primitives under different magnetic fields and different electric fields;
    判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;Judging whether the plurality of electrical data are within three or more preset numerical ranges;
    若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。If the multiple electrical data are within three or more preset numerical ranges, then it is determined that the storage mechanism of the storage system is a polymorphic storage mechanism.
  3. 根据权利要求1所述的基于多态存储机制的快照生成方法,其特征在于,所述多个存储系统的数据修改记录均保存在系统日志中,所述根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据的步骤,包括:The method for generating a snapshot based on a polymorphic storage mechanism according to claim 1, wherein the data modification records of the multiple storage systems are all saved in a system log, and the data is obtained according to a preset difference data obtaining method. The steps for the difference between the current stored data and the pre-stored initial data include:
    从所述系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;Acquiring, from the system log, a specified data modification record after the generation time of the initial data;
    对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;Performing classification processing on the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
    将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。The modified data corresponding to the modification record closest to the current time in each data record set is recorded as difference data, and the difference data is obtained.
  4. 根据权利要求1所述的基于多态存储机制的快照生成方法,其特征在于,所述判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据的步骤之后,包括:The method for generating a snapshot based on a polymorphic storage mechanism according to claim 1, wherein the determining whether the difference data further includes second difference data, and the second difference data is stored in the plurality of storages. After the step of storing data in other systems other than the designated storage system in the system, it includes:
    若所述差异数据不包括第二差异数据,则在所述指定存储系统中预设的第二物理位置存储所述第一差异数据;If the difference data does not include the second difference data, storing the first difference data in a second physical location preset in the designated storage system;
    采用预设的快照生成技术,生成第二快照指示卷,所述第二快照指示卷包括第二逻辑地址,所述第二逻辑地址指向所述第二物理地址。A preset snapshot generation technology is used to generate a second snapshot indication volume, the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
  5. 根据权利要求1所述的基于多态存储机制的快照生成方法,其特征在于,所述多态存储机制是基于磁电效应的四态存储机制,所述将所述第一差异数据进行二进制转换处理,得到指定二进制数据的步骤,包括:The snapshot generation method based on a multi-state storage mechanism according to claim 1, wherein the multi-state storage mechanism is a four-state storage mechanism based on the magnetoelectric effect, and the first difference data is converted into binary Processing to obtain the specified binary data, including:
    获取所述第一差异数据对应的存储基元的指定电学数据,所述存储基元为所述第一差异数据的最小存储单位;Acquiring designated electrical data of a storage element corresponding to the first difference data, where the storage element is the smallest storage unit of the first difference data;
    将所述存储基元分为第一存储基元、第二存储基元、第三存储基元和第四存储基元,其中所述第一存储基元的指定电学数据的数值处于第一数值范围之内,所述第二存储基元的指定电学数据的数值处于第二数值范围之内,所述第三存储基元的指定电学数据的数值处于第三数值范围之内,所述第四存储基元的指定电学数据的数值处于第四数值范围之内;The storage element is divided into a first storage element, a second storage element, a third storage element, and a fourth storage element, wherein the value of the designated electrical data of the first storage element is at the first value Within the range, the value of the specified electrical data of the second storage element is within the second numerical range, the value of the specified electrical data of the third storage element is within the third numerical range, and the fourth The value of the designated electrical data of the storage primitive is within the fourth value range;
    建立第三映射基元对与第四映射基元对,所述第三映射基元对由一个电学数据的数值处于第二数据范围之内的存储基元和一个电学数据的数值处于第一数据范围之内的存储基元顺序构成,所述第四映射基元对由两个电学数据的数值均处于第二数据范围之内的存储基元顺序构成;A third mapping element pair and a fourth mapping element pair are established. The third mapping element pair consists of a storage element whose value of electrical data is in the second data range and a value of electrical data that is in the first data. The sequence of storage primitives within the range is constituted, and the fourth mapping primitive pair is constituted by the sequence of storage primitives in which the values of the two electrical data are both within the second data range;
    执行对所述第一差异数据的映射读取操作,所述映射读取操作在读取第三存储基元时采用第三映射基元对替代所述第三存储基元,并在读取第四存储基元时采用第四映射基元对替代所述第四存储基元,从而得到指定二进制数据。Perform a mapping read operation on the first difference data. The mapping read operation uses a third mapping primitive pair to replace the third storage primitive when reading the third storage primitive, and when reading the third storage primitive, In the case of four storage primitives, a fourth mapping primitive pair is used to replace the fourth storage primitive, thereby obtaining designated binary data.
  6. 根据权利要求1所述的基于多态存储机制的快照生成方法,其特征在于,所述将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置的步骤,包括:The method for generating a snapshot based on a polymorphic storage mechanism according to claim 1, wherein the step of storing the designated binary data and the second difference data in a preset first physical location comprises:
    根据预设的哈希算法,对所述指定二进制数据进行哈希计算,得到第一哈希值;Perform a hash calculation on the designated binary data according to a preset hash algorithm to obtain a first hash value;
    根据预设的哈希算法,对所述第二差异数据进行哈希计算,得到第二哈希值;Perform a hash calculation on the second difference data according to a preset hash algorithm to obtain a second hash value;
    使用第一哈希值作为加密密钥,对所述第二差异数据进行加密,得到第二差异数据密文;Use the first hash value as an encryption key to encrypt the second difference data to obtain the second difference data ciphertext;
    使用第二哈希值作为加密密钥,对所述指定二进制数据进行加密,得到指定二进制数据密文;Using the second hash value as an encryption key to encrypt the designated binary data to obtain a ciphertext of the designated binary data;
    将所述指定二进制数据密文和所述第二差异数据密文存储至预设的第一物理位置。Storing the designated binary data ciphertext and the second difference data ciphertext in a preset first physical location.
  7. 根据权利要求1所述的基于多态存储机制的快照生成方法,其特征在于,所述采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置的步骤之后,包括:The snapshot generation method based on a polymorphic storage mechanism according to claim 1, wherein the preset snapshot generation technology is used to generate a first snapshot indication volume, and the first snapshot indication volume includes a first logical address And the difference physical location, after the step of pointing the first logical address to the first physical location, the method includes:
    接收快照读取指令,所述快照读取指令携带有用于验证身份的验证图像;Receiving a snapshot read instruction, where the snapshot read instruction carries a verification image for verifying identity;
    根据预设的相似度计算方法,计算所述验证图像与预存的平面图像的相似度值,并判断所述相似度值是否大于预设的相似度阈值,其中所述平面图像是预存的立体虚拟图形在指定方向上的平面投影图像;According to the preset similarity calculation method, calculate the similarity value between the verification image and the pre-stored planar image, and determine whether the similarity value is greater than the preset similarity threshold, wherein the planar image is a pre-stored stereo virtual The plane projection image of the graphic in the specified direction;
    若所述相似度值大于预设的相似度阈值,则对所述初始数据进行重定向处理,所述重定向处理指将所述初始数据中的差异物理位置重定向为所述第一逻辑地址;If the similarity value is greater than the preset similarity threshold, perform redirection processing on the initial data, where the redirection processing refers to redirecting a different physical location in the initial data to the first logical address ;
    读取重定向处理后的初始数据。Read the initial data after redirection processing.
  8. 一种基于多态存储机制的快照生成装置,其特征在于,应用于中间件,所述中间件位于多个存储系统之间,所述装置包括:A snapshot generation device based on a polymorphic storage mechanism, characterized in that it is applied to middleware, the middleware is located between multiple storage systems, and the device includes:
    快照生成指令接收单元,用于接收对多个存储系统进行快照生成的指令;The snapshot generation instruction receiving unit is used to receive instructions for generating snapshots for multiple storage systems;
    存储机制获取单元,用于通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;A storage mechanism acquisition unit, configured to acquire the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
    差异数据获取单元,用于若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;The difference data obtaining unit is configured to obtain the difference between the current stored data and the pre-stored initial data according to the preset difference data obtaining method if there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems The difference physical location where the data and the difference data are stored, wherein the difference data includes the first difference data stored in a polymorphic storage system;
    第二差异数据判断单元,用于判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;The second difference data judging unit is configured to judge whether the difference data further includes second difference data, the second difference data being stored in the plurality of storage systems other than the designated storage system Data in;
    指定二进制数据获取单元,用于若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;A designated binary data acquisition unit, configured to, if the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
    第一物理位置存储单元,用于将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;A first physical location storage unit, configured to store the designated binary data and the second difference data to a preset first physical location;
    第一快照指示卷生成单元,用于采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。The first snapshot indication volume generation unit is configured to generate a first snapshot indication volume using a preset snapshot generation technology, the first snapshot indication volume including a first logical address and the differential physical location, the first logical address Point to the first physical location.
  9. 根据权利要求8所述的基于多态存储机制的快照生成装置,其特征在于,所述多态存储机制是基于磁电效应的存储机制,所述存储系统具有用于测试存储机制的存储测试基元,所述存储测试基元的存储位数为1,所述存储机制获取单元20,包括:The snapshot generation device based on a multi-state storage mechanism according to claim 8, wherein the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect, and the storage system has a storage test base for testing the storage mechanism. The storage bit number of the storage test primitive is 1, and the storage mechanism acquisition unit 20 includes:
    电学数据获取子单元,用于利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;The electrical data acquisition subunit is used to use preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain the storage test primitives in different magnetic fields and different electric fields. Multiple electrical data under;
    数值范围判断子单元,用于判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;The numerical value range judgment subunit is used to judge whether the plurality of electrical data are respectively within three or more preset numerical value ranges;
    多态存储机制判定子单元,用于若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。The polymorphic storage mechanism determination subunit is configured to determine that the storage mechanism of the storage system is a polymorphic storage mechanism if the plurality of electrical data are within three or more preset value ranges.
  10. 根据权利要求8所述的基于多态存储机制的快照生成装置,其特征在于,所述多个存储系统的数据修改记录均保存在系统日志中,所述差异数据获取单元30,包括:The snapshot generation device based on a polymorphic storage mechanism according to claim 8, wherein the data modification records of the multiple storage systems are all saved in a system log, and the difference data obtaining unit 30 includes:
    指定数据修改记录获取子单元,用于从所述系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;The designated data modification record obtaining subunit is configured to obtain the designated data modification record after the generation time of the initial data from the system log;
    归类处理子单元,用于对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;The classification processing subunit is used to classify the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
    差异数据获取子单元,用于将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。The difference data obtaining subunit is used to record the modified data corresponding to the modification record closest to the current time in each data record set as difference data, and to obtain the difference data.
  11. 根据权利要求8所述的基于多态存储机制的快照生成装置,其特征在于,所述装置,包括:The device for generating snapshots based on a polymorphic storage mechanism according to claim 8, wherein the device comprises:
    第一差异数据存储单元,用于若所述差异数据不包括第二差异数据,则在所述指定存储系统中预设的第二物理位置存储所述第一差异数据;A first difference data storage unit, configured to store the first difference data in a second physical location preset in the designated storage system if the difference data does not include the second difference data;
    第二快照指示卷生成单元,用于采用预设的快照生成技术,生成第二快照指示卷,所述第二快照指示卷包括第二逻辑地址,所述第二逻辑地址指向所述第二物理地址。The second snapshot indication volume generation unit is configured to generate a second snapshot indication volume using a preset snapshot generation technology, the second snapshot indication volume includes a second logical address, and the second logical address points to the second physical address.
  12. 根据权利要求8所述的基于多态存储机制的快照生成装置,其特征在于,所述多态存储机制是基于磁电效应的四态存储机制,所述指定二进制数据获取单元50,包括:The snapshot generation device based on a multi-state storage mechanism according to claim 8, wherein the multi-state storage mechanism is a four-state storage mechanism based on the magnetoelectric effect, and the designated binary data acquisition unit 50 includes:
    指定电学数据获取子单元,用于获取所述第一差异数据对应的存储基元的指定电学数据,所述存储基元为所述第一差异数据的最小存储单位;A designated electrical data acquisition subunit for acquiring designated electrical data of a storage element corresponding to the first difference data, the storage element being the smallest storage unit of the first difference data;
    存储基元划分子单元,用于将所述存储基元分为第一存储基元、第二存储基元、第三存储基元和第四存储基元,其中所述第一存储基元的指定电学数据的数值处于第一数值范围之内,所述第二存储基元的指定电学数据的数值处于第二数值范围之内,所述第三存储基元的指定电学数据的数值处于第三数值范围之内,所述第四存储基元的指定电学数据的数值处于第四数值范围之内;The storage element division subunit is used to divide the storage element into a first storage element, a second storage element, a third storage element, and a fourth storage element, wherein the first storage element The value of the specified electrical data is within the first value range, the value of the specified electrical data of the second storage element is within the second value range, and the value of the specified electrical data of the third storage element is within the third value range. Within the numerical range, the numerical value of the designated electrical data of the fourth storage element is within the fourth numerical range;
    映射基元对建立子单元,用于建立第三映射基元对与第四映射基元对,所述第三映射基元对由一个电学数据的数值处于第二数据范围之内的存储基元和一个电学数据的数值处于第一数据范围之内的存储基元顺序构成,所述第四映射基元对由两个电学数据的数值均处于第二数据范围之内的存储基元顺序构成;The mapping primitive pair establishment subunit is used to establish a third mapping primitive pair and a fourth mapping primitive pair. The third mapping primitive pair is a storage primitive whose value of electrical data is within the second data range. And a sequence of storage primitives whose values of electrical data are within the first data range, and the fourth mapping primitive pair is composed of a sequence of storage primitives whose values of two electrical data are both within the second data range;
    映射读取子单元,用于执行对所述第一差异数据的映射读取操作,所述映射读取操作在读取第三存储基元时采用第三映射基元对替代所述第三存储基元,并在读取第四存储基元时采用第四映射基元对替代所述第四存储基元,从而得到指定二进制数据。The mapping read subunit is configured to perform a mapping read operation on the first difference data, where the mapping read operation uses a third mapping primitive pair to replace the third storage when reading a third storage primitive Primitives, and when reading the fourth storage primitives, a fourth mapping primitive pair is used to replace the fourth storage primitives, so as to obtain designated binary data.
  13. 根据权利要求8所述的基于多态存储机制的快照生成装置,其特征在于,所述第一物理位置存储单元60,包括:The snapshot generation device based on a polymorphic storage mechanism according to claim 8, wherein the first physical location storage unit 60 comprises:
    第一哈希值获取子单元,用于根据预设的哈希算法,对所述指定二进制数据进行哈希计算,得到第一哈希值;The first hash value obtaining subunit is configured to perform a hash calculation on the designated binary data according to a preset hash algorithm to obtain the first hash value;
    第二哈希值获取子单元,用于根据预设的哈希算法,对所述第二差异数据进行哈希计算,得到第二哈希值;The second hash value obtaining subunit is configured to perform a hash calculation on the second difference data according to a preset hash algorithm to obtain a second hash value;
    第二差异数据密文获取子单元,用于使用第一哈希值作为加密密钥,对所述第二差异数据进行加密,得到第二差异数据密文;The second difference data ciphertext obtaining subunit is configured to use the first hash value as an encryption key to encrypt the second difference data to obtain the second difference data ciphertext;
    指定二进制数据密文获取子单元,用于使用第二哈希值作为加密密钥,对所述指定二进制数据进行加密,得到指定二进制数据密文;The designated binary data ciphertext obtaining subunit is configured to use the second hash value as an encryption key to encrypt the designated binary data to obtain the designated binary data ciphertext;
    第一物理位置存储子单元,用于将所述指定二进制数据密文和所述第二差异数据密文存储至预设的第一物理位置。The first physical location storage subunit is configured to store the designated binary data ciphertext and the second difference data ciphertext to a preset first physical location.
  14. 根据权利要求8所述的基于多态存储机制的快照生成装置,其特征在于,所述装置,包括:The device for generating snapshots based on a polymorphic storage mechanism according to claim 8, wherein the device comprises:
    快照读取指令接收单元,用于接收快照读取指令,所述快照读取指令携带有用于验证身份的验证图像;A snapshot read instruction receiving unit, configured to receive a snapshot read instruction, the snapshot read instruction carries a verification image used to verify identity;
    相似度计算单元,用于根据预设的相似度计算方法,计算所述验证图像与预存的平面图像的相似度值,并判断所述相似度值是否大于预设的相似度阈值,其中所述平面图像是预存的立体虚拟图形在指定方向上的平面投影图像;The similarity calculation unit is configured to calculate the similarity value between the verification image and the pre-stored planar image according to a preset similarity calculation method, and determine whether the similarity value is greater than a preset similarity threshold, wherein The plane image is the plane projection image of the pre-stored three-dimensional virtual graphics in the specified direction;
    重定向单元,用于若所述相似度值大于预设的相似度阈值,则对所述初始数据进行重定向处理,所述重定向处理指将所述初始数据中的差异物理位置重定向为所述第一逻辑地址;The redirection unit is configured to perform redirection processing on the initial data if the similarity value is greater than a preset similarity threshold value, where the redirection processing refers to redirecting a different physical location in the initial data to The first logical address;
    读取单元,用于读取重定向处理后的初始数据。The reading unit is used to read the initial data after redirection processing.
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现基于多态存储机制的快照生成方法,所述基于多态存储机制的快照生成方法,包括:A computer device including a memory and a processor, the memory storing a computer program, wherein the processor implements a snapshot generation method based on a polymorphic storage mechanism when the processor executes the computer program, and the polymorphic storage The snapshot generation method of the mechanism includes:
    接收对多个存储系统进行快照生成的指令;Receive instructions for generating snapshots of multiple storage systems;
    通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;Obtain the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
    若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, the difference data of the current stored data that is different from the pre-stored initial data and the difference data are obtained according to the preset difference data acquisition method. The stored difference physical location, wherein the difference data includes the first difference data stored in a polymorphic storage system;
    判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;Determining whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems among the plurality of storage systems except the designated storage system;
    若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;If the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
    将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;Storing the designated binary data and the second difference data in a preset first physical location;
    采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。A preset snapshot generation technology is used to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
  16. 根据权利要求15所述的计算机设备,其特征在于,所述多态存储机制是基于磁电效应的存储机制,所述存储系统具有用于测试存储机制的存储测试基元,所述存储测试基元的存储位数为1,所述通过预设的存储机制识别方法,获取所述存储系统的存储机制的步骤,包括:The computer device according to claim 15, wherein the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect, the storage system has a storage test primitive for testing the storage mechanism, and the storage test base The storage bit number of the meta is 1, and the step of obtaining the storage mechanism of the storage system through the preset storage mechanism identification method includes:
    利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;Using preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain multiple electrical data of the storage test primitives under different magnetic fields and different electric fields;
    判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;Judging whether the plurality of electrical data are within three or more preset numerical ranges;
    若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。If the multiple electrical data are within three or more preset numerical ranges, then it is determined that the storage mechanism of the storage system is a polymorphic storage mechanism.
  17. 根据权利要求15所述的计算机设备,其特征在于,所述多个存储系统的数据修改记录均保存在系统日志中,所述根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据的步骤,包括:The computer device according to claim 15, wherein the data modification records of the multiple storage systems are all saved in the system log, and the difference data acquisition method according to the preset method is used to obtain the current stored data that is different from the pre-stored data. The difference data steps of the initial data include:
    从所述系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;Acquiring, from the system log, a specified data modification record after the generation time of the initial data;
    对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;Performing classification processing on the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
    将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。The modified data corresponding to the modification record closest to the current time in each data record set is recorded as difference data, and the difference data is obtained.
  18. 一种非易失性的计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现基于多态存储机制的快照生成方法,所述基于多态存储机制的快照生成方法,包括:A non-volatile computer-readable storage medium with a computer program stored thereon, wherein the computer program is characterized in that when the computer program is executed by a processor, a snapshot generation method based on a polymorphic storage mechanism is implemented, and the polymorphic storage The snapshot generation method of the mechanism includes:
    接收对多个存储系统进行快照生成的指令;Receive instructions for generating snapshots of multiple storage systems;
    通过预设的存储机制识别方法,获取所述存储系统的存储机制,并判断所述多个存储系统中是否存在存储机制为多态存储机制的指定存储系统;Obtain the storage mechanism of the storage system through a preset storage mechanism identification method, and determine whether there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems;
    若所述多个存储系统中存在存储机制为多态存储机制的指定存储系统,则根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据和所述差异数据被存储的差异物理位置,其中所述差异数据包括存储在多态存储系统中的第一差异数据;If there is a designated storage system whose storage mechanism is a polymorphic storage mechanism among the multiple storage systems, the difference data of the current stored data that is different from the pre-stored initial data and the difference data are obtained according to the preset difference data acquisition method. The stored difference physical location, wherein the difference data includes the first difference data stored in a polymorphic storage system;
    判断所述差异数据是否还包括第二差异数据,所述第二差异数据为存储在所述多个存储系统中除所述指定存储系统之外的其他存储系统中的数据;Determining whether the difference data further includes second difference data, where the second difference data is data stored in other storage systems among the plurality of storage systems except the designated storage system;
    若所述差异数据还包括第二差异数据,则将所述第一差异数据进行二进制转换处理,得到指定二进制数据;If the difference data further includes second difference data, perform binary conversion processing on the first difference data to obtain designated binary data;
    将所述指定二进制数据和所述第二差异数据存储至预设的第一物理位置;Storing the designated binary data and the second difference data in a preset first physical location;
    采用预设的快照生成技术,生成第一快照指示卷,所述第一快照指示卷包括第一逻辑地址和所述差异物理位置,所述第一逻辑地址指向所述第一物理位置。A preset snapshot generation technology is used to generate a first snapshot indication volume, where the first snapshot indication volume includes a first logical address and the differential physical location, and the first logical address points to the first physical location.
  19. 根据权利要求18所述的非易失性的计算机可读存储介质,其特征在于,所述多态存储机制是基于磁电效应的存储机制,所述存储系统具有用于测试存储机制的存储测试基元,所述存储测试基元的存储位数为1,所述通过预设的存储机制识别方法,获取所述存储系统的存储机制的步骤,包括:The non-volatile computer-readable storage medium of claim 18, wherein the multi-state storage mechanism is a storage mechanism based on the magnetoelectric effect, and the storage system has a storage test for testing the storage mechanism. Primitive, the storage bit number of the storage test primitive is 1, and the step of obtaining the storage mechanism of the storage system through a preset storage mechanism identification method includes:
    利用预设的磁场与电场生成器件,对所述存储测试基元同时施加不同的磁场与不同的电场,并获取所述存储测试基元在不同磁场与不同的电场下的多个电学数据;Using preset magnetic and electric field generating devices to simultaneously apply different magnetic fields and different electric fields to the storage test primitives, and obtain multiple electrical data of the storage test primitives under different magnetic fields and different electric fields;
    判断所述多个电学数据是否分别处于预设的三个以上的数值范围之内;Judging whether the plurality of electrical data are within three or more preset numerical ranges;
    若所述多个电学数据分别处于预设的三个以上的数值范围之内,则判定所述存储系统的存储机制为多态存储机制。If the plurality of electrical data are respectively within three or more preset numerical ranges, it is determined that the storage mechanism of the storage system is a polymorphic storage mechanism.
  20. 根据权利要求18所述的非易失性的计算机可读存储介质,其特征在于,所述多个存储系统的数据修改记录均保存在系统日志中,所述根据预设的差异数据获取方法,获取当前存储数据区别于预存的初始数据的差异数据的步骤,包括:The non-volatile computer-readable storage medium according to claim 18, wherein the data modification records of the multiple storage systems are all saved in a system log, and the method for obtaining data according to the preset difference is: The steps of obtaining the difference data between the current stored data and the pre-stored initial data include:
    从所述系统日志中获取在所述初始数据的生成时间之后的指定数据修改记录;Acquiring, from the system log, a specified data modification record after the generation time of the initial data;
    对所述指定数据修改记录进行按物理地址进行归类处理,从而将所述指定数据修改记录划分为多个数据记录集;Performing classification processing on the specified data modification records according to physical addresses, thereby dividing the specified data modification records into multiple data record sets;
    将每个数据记录集中离当前时间最近的修改记录对应的修改后数据记为差异数据,并获取所述差异数据。The modified data corresponding to the modification record closest to the current time in each data record set is recorded as difference data, and the difference data is obtained.
PCT/CN2019/116713 2019-09-19 2019-11-08 Polymorphic storage mechanism-based snapshot generation method, apparatus and computer device WO2021051512A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910887181.7 2019-09-19
CN201910887181.7A CN110806950B (en) 2019-09-19 2019-09-19 Snapshot generation method and device based on polymorphic storage mechanism and computer equipment

Publications (1)

Publication Number Publication Date
WO2021051512A1 true WO2021051512A1 (en) 2021-03-25

Family

ID=69487632

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116713 WO2021051512A1 (en) 2019-09-19 2019-11-08 Polymorphic storage mechanism-based snapshot generation method, apparatus and computer device

Country Status (2)

Country Link
CN (1) CN110806950B (en)
WO (1) WO2021051512A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111631682B (en) * 2020-04-23 2023-06-20 深圳赛安特技术服务有限公司 Physiological characteristic integration method and device based on trending analysis and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020178335A1 (en) * 2000-06-19 2002-11-28 Storage Technology Corporation Apparatus and method for dynamically changeable virtual mapping scheme
CN107562578A (en) * 2017-09-25 2018-01-09 郑州云海信息技术有限公司 A kind of snapshot creation method of data storage, device, equipment and storage medium
CN110018983A (en) * 2017-09-27 2019-07-16 华为技术有限公司 A kind of metadata query method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106893A1 (en) * 2004-11-02 2006-05-18 Rodger Daniels Incremental backup operations in storage networks
CN102831034B (en) * 2012-08-14 2016-04-20 中国电力科学研究院 Based on multimode backup and the quick recovery method of embedded equipment Linux
CN110018996B (en) * 2018-07-23 2021-11-09 郑州云海信息技术有限公司 Snapshot rollback method and related device of distributed storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020178335A1 (en) * 2000-06-19 2002-11-28 Storage Technology Corporation Apparatus and method for dynamically changeable virtual mapping scheme
CN107562578A (en) * 2017-09-25 2018-01-09 郑州云海信息技术有限公司 A kind of snapshot creation method of data storage, device, equipment and storage medium
CN110018983A (en) * 2017-09-27 2019-07-16 华为技术有限公司 A kind of metadata query method and device

Also Published As

Publication number Publication date
CN110806950A (en) 2020-02-18
CN110806950B (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN106201338B (en) Date storage method and device
RU2672789C2 (en) Compatibility extending offload token size
WO2020042586A1 (en) Method and apparatus for generating address of smart contract, computer device, and readable storage medium
US10567369B2 (en) Secure token passing via hash chains
US8601358B2 (en) Buffer transfer check on variable length data
US11611433B2 (en) Secure memory arrangements
CN111222176B (en) Block chain-based cloud storage possession proving method, system and medium
US10969982B1 (en) Data deduplication with collision resistant hash digest processes
CN107003893A (en) Virtual machine backup method, back-up device and host
US20160042024A1 (en) Continuous data health check
US7849355B2 (en) Distributed object sharing system and method thereof
CN105808378B (en) Metadata restorative procedure and device
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
WO2021051512A1 (en) Polymorphic storage mechanism-based snapshot generation method, apparatus and computer device
US10778769B2 (en) Elastic cloud storage on multiple locations
JP2007122446A (en) Data distribution management system
JP5600015B2 (en) Backup system and backup method
US10725877B2 (en) System, method and computer program product for performing a data protection operation
CN111198784B (en) Data storage method and device
CN109189333B (en) Hard disk adaptation method, device and system
CN114244519B (en) Password verification method, password verification device, computer equipment and storage medium
US7401255B1 (en) Mechanisms for recovering data from a backup by comparing transformed data to identify altered memory blocks
JP6201385B2 (en) Storage apparatus and storage control method
WO2017054182A1 (en) Data check method and apparatus
US9298390B2 (en) Systems and methods for copying data maintained in a dynamic storage volume and verifying the copied data

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: 19946037

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19946037

Country of ref document: EP

Kind code of ref document: A1