CN117492935B - Mirror image data synchronization method, device, terminal and storage medium - Google Patents

Mirror image data synchronization method, device, terminal and storage medium Download PDF

Info

Publication number
CN117492935B
CN117492935B CN202410004683.1A CN202410004683A CN117492935B CN 117492935 B CN117492935 B CN 117492935B CN 202410004683 A CN202410004683 A CN 202410004683A CN 117492935 B CN117492935 B CN 117492935B
Authority
CN
China
Prior art keywords
data
mirror image
information
mirror
acquiring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410004683.1A
Other languages
Chinese (zh)
Other versions
CN117492935A (en
Inventor
黄华宾
胡玉晟
陈华恩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baike Data Technology Shenzhen Co ltd
Original Assignee
Baike Data Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baike Data Technology Shenzhen Co ltd filed Critical Baike Data Technology Shenzhen Co ltd
Priority to CN202410004683.1A priority Critical patent/CN117492935B/en
Publication of CN117492935A publication Critical patent/CN117492935A/en
Application granted granted Critical
Publication of CN117492935B publication Critical patent/CN117492935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a mirror image data synchronization method, a device, a terminal and a storage medium, wherein the method comprises the following steps: receiving a data access request, and acquiring mirror image data when the data access request is determined to be a data mirror image request; carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process; and acquiring intercepted data based on the timestamp information, and synchronizing the intercepted data. According to the invention, the intercepted data can be acquired according to the analysis of the interception event occurring in the mirror image processing process and based on the timestamp information corresponding to the interception event, so that the intercepted data can be acquired to perform data synchronization, and the integrity of the data mirror image is ensured.

Description

Mirror image data synchronization method, device, terminal and storage medium
Technical Field
The present invention relates to the field of data mirroring technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for synchronizing mirrored data.
Background
One convenience of virtualization is that mirror data is used to emulate the disk of a virtual machine. The virtual machine image provides advanced characteristics such as copy-on-write (copy-on-write), duplicate removal (duplicate), encryption (encryption) and the like, and greatly simplifies the management of the virtual machine.
At present, virtualized mirroring is a common data mirroring processing technology, but in the existing data mirroring processing process, data interception often occurs, so that missing data exists when the data mirroring is synchronous, and the mirror data synchronization effect is affected.
Accordingly, there is a need for improvement and advancement in the art.
Disclosure of Invention
The invention aims to solve the technical problems that in the prior art, data interception often occurs in the data mirroring process, so that missing data exists in the data mirroring process, and the mirror data synchronizing effect is affected.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for synchronizing mirrored data, where the method includes:
receiving a data access request, and acquiring mirror image data when the data access request is determined to be a data mirror image request;
carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process;
and acquiring intercepted data based on the timestamp information, and synchronizing the intercepted data.
In one implementation, the receiving the data access request and obtaining the mirrored data when determining that the data access request is a data mirroring request includes:
acquiring data access request information, and analyzing the data access request information to obtain an access intention corresponding to the data access request information;
if the access intention is a data pushing intention, a pushing mode corresponding to the data pushing intention is obtained;
if the pushing mode is a mirror mode, determining the data access request information to be a data mirror request, and acquiring the mirror data.
In one implementation, the obtaining the mirrored data includes:
acquiring pointer information in the data access request, and determining corresponding file header information and storage path information based on the pointer information;
and determining a storage position based on the storage path information, and pulling mirror image data corresponding to the file header information from the storage position.
In one implementation manner, the determining the interception event and the timestamp information corresponding to the interception event in the mirror image processing process includes:
acquiring data information received after mirror image processing, and acquiring a first occupied memory of the data information;
acquiring a second occupied memory of the mirror image data, and comparing the first occupied memory with the second occupied memory;
if the first occupied memory is smaller than the second occupied memory, determining that an interception event occurs in the mirror image processing process, and recording timestamp information corresponding to the interception event.
In one implementation manner, the determining the interception event and the timestamp information corresponding to the interception event in the mirror image processing process includes:
in the mirror image processing process, recording the actual mirror image time length of the mirror image processing process;
obtaining the estimated mirror time length corresponding to the mirror data, and comparing the actual mirror time length with the estimated mirror time length;
if the time length difference between the actual mirror time length and the estimated mirror time length is larger than a preset value, determining that an interception event occurs in the mirror processing process, and recording timestamp information corresponding to the interception event.
In one implementation, the acquiring intercepted data based on the timestamp information includes:
positioning the occurrence time of the interception event based on the timestamp information;
and acquiring data of which the two ends are offset for a preset duration by taking the occurrence time of the interception event as a midpoint, and obtaining the intercepted data.
In one implementation, the synchronizing the intercepted data includes:
comparing the intercepted data with the data information received after the mirror image processing;
and eliminating the same data in the intercepted data and the data information, and synchronizing the rest data in the intercepted data.
In a second aspect, an embodiment of the present invention further provides a mirror data synchronization apparatus, where the apparatus includes:
the mirror image data acquisition module is used for receiving a data access request and acquiring mirror image data when the data access request is determined to be a data mirror image request;
the time stamp information determining module is used for carrying out mirror image processing on the mirror image data and determining an interception event and time stamp information corresponding to the interception event in the mirror image processing process;
and the data synchronization module is used for acquiring intercepted data based on the timestamp information and synchronizing the intercepted data.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal includes a memory, a processor, and a mirror data synchronization program stored in the memory and capable of running on the processor, and when the processor executes the mirror data synchronization program, the processor implements the steps of the mirror data synchronization method in any one of the above schemes.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a mirror data synchronization program is stored on the computer readable storage medium, where the mirror data synchronization program, when executed by a processor, implements the steps of the mirror data synchronization method according to any one of the above schemes.
The beneficial effects are that: compared with the prior art, the invention provides a mirror image data synchronization method, which comprises the steps of firstly receiving a data access request and acquiring mirror image data when the data access request is determined to be a data mirror image request. And then, carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process. And finally, acquiring intercepted data based on the timestamp information, and synchronizing the intercepted data. According to the invention, the intercepted data can be acquired according to the analysis of the interception event occurring in the mirror image processing process and based on the timestamp information corresponding to the interception event, so that the intercepted data can be acquired to perform data synchronization, and the integrity of the data mirror image is ensured.
Drawings
Fig. 1 is a flowchart of a specific implementation of a mirror data synchronization method according to an embodiment of the present invention.
Fig. 2 is a functional schematic diagram of a mirror data synchronization apparatus according to an embodiment of the present invention.
Fig. 3 is a schematic block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and more specific, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment provides a mirror image data synchronization method, which can be used for analyzing interception events occurring in the mirror image processing process and acquiring intercepted data based on timestamp information corresponding to the interception events so as to acquire the intercepted data for data synchronization and ensure the integrity of data mirror images. In a specific application, the embodiment may first receive a data access request, and acquire mirror image data when determining that the data access request is a data mirror image request. And then, carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process. And finally, acquiring intercepted data based on the timestamp information, and synchronizing the intercepted data.
The mirror image data synchronization method of the embodiment can be applied to terminal equipment, wherein the terminal equipment can be product terminals such as computers, mobile phones and intelligent televisions. In this embodiment, as shown in fig. 1, the mirror data synchronization method includes the following steps:
step S100, a data access request is received, and mirror image data is acquired when the data access request is determined to be a data mirror image request.
When data mirroring is performed, the terminal of the embodiment first receives a data access request, then analyzes the data access request, and determines an access intention of the data access request. When the data access request is determined to be a data mirror request, the terminal is required to mirror the data, so that mirror data can be obtained at the moment.
In one implementation, when obtaining mirror image data, the embodiment includes the following steps:
step S101, acquiring data access request information, and analyzing the data access request information to obtain an access intention corresponding to the data access request information;
step S102, if the access intention is a data pushing intention, a pushing mode corresponding to the data pushing intention is obtained;
step 103, if the push mode is a mirror mode, determining that the data access request information is a data mirror request, and acquiring the mirror data.
Specifically, in this embodiment, first, data access request information is acquired, and the data access request information is parsed to obtain an access intention corresponding to the data access request information, where the access intention reflects an access purpose of the data access request information. In a specific application, the embodiment may analyze the data access request information to obtain data content in the data access request information, identify the data content, and if it is identified that a specific identifier exists in the data content, the determinable access intention is a data pushing intention. Then, since it is determined that the data access request information is the data pushing intention at this time, and the data pushing intention may correspond to different pushing modes, such as a data pulling mode, a data mirroring mode, and a data issuing mode, and mirror synchronization is to be implemented in this embodiment, this embodiment may further analyze the data access request information to obtain the data content in the data access request information, and then identify the data content, so as to determine the data format (such as. Ios) of the data content, and if the data format is the mirror data format, then determine that the data mirroring is required at this time, so that it is determined that the pushing mode at this time is the mirror mode, so as to determine that the data access request information is the data mirroring request, and obtain the mirror data.
In one implementation, after determining that the data access request information is a data mirroring request, the embodiment may further obtain mirrored data. When mirror image data is acquired, the embodiment firstly acquires pointer information in the data access request, and then determines corresponding file header information and storage path information based on the pointer information. The file header information may be used to reflect the type of the image data and reflect which of the image data at that time may serve as name information of the image data. The storage path information may be used to reflect the storage location of the mirrored data. The terminal of the embodiment can determine the storage position based on the storage path, and then pull the mirror image data corresponding to the file header information from the storage position, thereby realizing the acquisition of the mirror image data.
And step 200, carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process.
After the mirror image data is obtained, the embodiment can perform mirror image processing on the mirror image data, where the mirror image processing is to synchronize the mirror image data to the terminal. In the process of mirror image processing, an interception event may occur due to a power failure or a bandwidth problem, and the interception event intercepts mirror image data, so that a part of mirror image data cannot be synchronized to a terminal, thereby affecting the integrity of the mirror image data.
In one implementation manner, when determining timestamp information corresponding to an interception event, the embodiment includes the following steps:
step S201, acquiring data information received after mirror image processing, and acquiring a first occupied memory of the data information;
step S202, a second occupied memory of the mirror image data is obtained, and the first occupied memory is compared with the second occupied memory;
step 203, if the first occupied memory is smaller than the second occupied memory, determining that an interception event occurs in the mirror image processing process, and recording timestamp information corresponding to the interception event.
Specifically, whether an interception event occurs during the process of analyzing the mirror image in this embodiment may be determined by comparing the occupied memory sizes of the data before and after the mirror image. In specific application, the embodiment first obtains the data information received after the mirror image processing, and then obtains a first occupied memory of the data information, where the first occupied memory reflects the size of the data received by the terminal after the mirror image processing. Then, the terminal acquires a second occupied memory of the mirror image data, wherein the second occupied memory reflects the data size of the original mirror image data before the mirror image occurs. When the first occupied memory and the second occupied memory are compared, the embodiment can determine the difference between the first occupied memory and the second occupied memory, and the difference reflects the data which is missing before and after the mirror image processing and is caused by the interception event. Therefore, in this embodiment, if it is determined that the first occupied memory is smaller than the second occupied memory, it may be determined that an interception event occurs in the mirroring process, so that the timestamp information corresponding to the interception event is recorded in this embodiment.
In one implementation manner, after determining the interception event, the embodiment needs to locate the interception event and determine timestamp information corresponding to the interception event. Specifically, the embodiment can monitor the mirror image processing process in real time, and when an interruption occurs in the mirror image processing process, that is, it is determined that an interception event occurs when the interruption occurs at this time, so as to record timestamp information of the interception event. In addition, in this embodiment, the original image data before the image occurs and the data information received after the image processing may be compared to analyze the missing data between the original image data and the data information, and if the missing data exists, it may be determined that the interception event occurs, so in this embodiment, the missing time of the missing data may be used as the timestamp information corresponding to the interception event. In the embodiment, when comparing the mirror image data and the data information, the comparison can be performed in a sectional comparison mode, and the missing data and the missing time of the missing data can be rapidly and accurately positioned through comparing the mirror image data and the data information section by section.
In another implementation manner, when determining timestamp information corresponding to an interception event, the embodiment includes the following steps:
step S21, recording the actual mirror time length of the mirror processing process in the mirror processing process;
s22, obtaining estimated mirror time length corresponding to the mirror data, and comparing the actual mirror time length with the estimated mirror time length;
step S23, if the time length difference between the actual mirror time length and the estimated mirror time length is larger than a preset value, determining that an interception event occurs in the mirror processing process, and recording timestamp information corresponding to the interception event.
Specifically, the embodiment can determine whether an interception event occurs by analyzing the mirror time length of the mirror process. When the method is specifically applied, the actual mirror time length of the mirror processing process can be recorded in the mirror processing process, and then the estimated mirror time length corresponding to the mirror data is obtained. Comparing the actual mirror time length with the estimated mirror time length, and if a difference exists between the actual mirror time length and the estimated mirror time length, indicating that an abnormality exists in the mirror processing process, so that the embodiment can further determine a time length difference between the actual mirror time length and the estimated mirror time length. Because the actual mirror time length is affected by the bandwidth, a certain time length difference exists between the actual mirror time length and the estimated mirror time length. The embodiment compares the time length difference value with the preset value, if the time length difference value is larger than the preset value, the time length difference value between the actual mirror time length and the estimated mirror time length is overlarge, so that the situation that the time length difference value is overlarge due to the fact that the interception event occurs in the mirror processing process can be determined, and timestamp information corresponding to the interception event can be recorded at the moment. Therefore, the embodiment can analyze the interception event based on two modes of occupying the memory and mirroring time length, and further timely locate the time stamp information when the interception event occurs.
And step S300, acquiring intercepted data based on the timestamp information and synchronizing the intercepted data.
In this embodiment, after determining the timestamp information, the intercepted data may be obtained according to the timestamp information, where the intercepted data is missing data between original image data before the image occurs and data information received after the image processing. To ensure the integrity of the mirrored data, this embodiment synchronizes the intercepted data.
In one implementation, the method includes the following steps when determining intercepted data:
step S301, positioning the occurrence time of the interception event based on the timestamp information;
and step S302, acquiring data of which the two ends are respectively offset by a preset duration time by taking the occurrence time of the interception event as a midpoint, and obtaining the intercepted data.
In this embodiment, since the time stamp information corresponds to the interception event, the present embodiment can locate the occurrence time of the interception event according to the time stamp information, which can be obtained by reading the log information. Thus, the intercepted data is the data that is lost at the time of the interception event. In order to accurately acquire intercepted data, in this embodiment, the occurrence time of the intercepting event is taken as a midpoint, and then the two ends of the midpoint are respectively offset by data of preset duration, so as to obtain the intercepted data. The intercepted data acquired by the embodiment not only is the data at the occurrence time of the interception event, but also comprises the data before and after the occurrence time, so that omission of the data is avoided, and the integrity of the data is guaranteed.
When the intercepted data is obtained, the embodiment can synchronize the intercepted data. When the method is specifically applied, the embodiment can compare the intercepted data with the data information received after the mirror image processing to determine whether the same data exists, if so, the same data in the intercepted data and the data information is removed, and the rest data in the intercepted data is synchronized, so that the integrity of the mirror image data is ensured. If the same data does not exist, the embodiment completely synchronizes the intercepted data.
In addition, in other implementation manners, the embodiment may make the disk in the terminal into a resource pool, and virtual the virtual disk for receiving the mirrored data after the mirroring process. In data synchronization, the present embodiment synchronizes mirrored data to the virtual disk. When an interception event occurs, the embodiment performs data interception at the application layer, so that intercepted data is stored at the application layer. In the process of mirror image processing, when mirror image data is synchronized to the virtual disk, a timestamp corresponding to an interception event is carried, so that after the terminal obtains the timestamp, the terminal can roll back to the occurrence time of the corresponding interception event based on the timestamp, obtain intercepted data from an application layer, and synchronize the intercepted data to the virtual disk. According to the embodiment, the intercepted data are obtained through the time stamp, synchronization of mirror image data can be guaranteed, the data reading and writing quantity is not affected, and the integrity of the whole mirror image data is guaranteed.
In addition, the embodiment can also divide the virtual disk into areas, is used for storing the virtual storage units of different types of mirror image data, and encodes each virtual storage unit, and after receiving the mirror image data, the embodiment can store the mirror image data to the corresponding virtual storage units based on the type information of the mirror image data, thereby ensuring the efficiency of mirror image synchronization.
In summary, the present embodiment first receives a data access request, and obtains mirror image data when determining that the data access request is a data mirror image request. And then, carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process. And finally, acquiring intercepted data based on the timestamp information, and synchronizing the intercepted data. According to the embodiment, the intercepted data can be acquired according to the interception event which occurs in the mirror image processing process and based on the timestamp information corresponding to the interception event, so that the intercepted data can be acquired to perform data synchronization, and the integrity of the data mirror image is ensured.
Based on the above embodiment, the present invention further provides a mirrored data synchronization apparatus, as shown in fig. 2, including: the system comprises a mirror image data acquisition module 10, a timestamp information determination module 20 and a data synchronization module 30. Specifically, the mirror data obtaining module 10 of the present embodiment is configured to receive a data access request, and obtain mirror data when determining that the data access request is a data mirror request. The timestamp information determining module 20 is configured to perform mirroring on the mirrored data, and determine an interception event and timestamp information corresponding to the interception event during the mirroring process. The data synchronization module 30 is configured to obtain intercepted data based on the timestamp information, and synchronize the intercepted data.
In one implementation, the mirrored data acquisition module 10 in this embodiment includes:
the access intention determining unit is used for acquiring data access request information, analyzing the data access request information and obtaining the access intention corresponding to the data access request information;
a pushing mode determining unit, configured to obtain a pushing mode corresponding to the data pushing intention if the access intention is the data pushing intention;
and the mirror image data acquisition unit is used for determining the data access request information as a data mirror image request and acquiring the mirror image data if the pushing mode is a mirror image mode.
In one implementation, the mirror data obtaining unit in this embodiment includes:
an information acquisition subunit, configured to acquire pointer information in the data access request, and determine corresponding file header information and storage path information based on the pointer information;
and the data pulling subunit is used for determining a storage position based on the storage path information and pulling mirror image data corresponding to the file header information from the storage position.
In one implementation, the timestamp information determination module 20 in this embodiment includes:
the occupied memory determining unit is used for acquiring the data information received after the mirror image processing and acquiring a first occupied memory of the data information;
the occupied memory comparison unit is used for acquiring a second occupied memory of the mirror image data and comparing the first occupied memory with the second occupied memory;
and the time recording unit is used for determining that an interception event occurs in the mirror image processing process if the first occupied memory is smaller than the second occupied memory, and recording timestamp information corresponding to the interception event.
In one implementation, the time recording unit in this embodiment includes:
a duration recording subunit, configured to record an actual mirroring duration of the mirroring process in the mirroring process;
a time length comparison subunit, configured to obtain an estimated image time length corresponding to the image data, and compare the actual image time length with the estimated image time length;
and the event determining subunit is used for determining that an interception event occurs in the mirror image processing process if the time length difference between the actual mirror image time length and the estimated mirror image time length is larger than a preset value, and recording timestamp information corresponding to the interception event.
In one implementation, the data synchronization module 30 in this embodiment includes:
the time determining unit is used for positioning the occurrence time of the interception event based on the time stamp information;
the data interception unit is used for acquiring data of which the two ends are offset by preset duration by taking the occurrence time of the interception event as a midpoint to obtain the intercepted data.
In one implementation, the data synchronization module 30 in this embodiment includes:
the data comparison unit is used for comparing the intercepted data with the data information received after the mirror image processing;
and the data eliminating unit is used for eliminating the same data in the intercepted data and the data information and synchronizing the rest data in the intercepted data.
The working principle of each module in the mirror image data synchronization device of this embodiment is the same as that of each step in the above method embodiment, and will not be described here again.
Based on the above embodiment, the present invention also provides a terminal, and a schematic block diagram of the terminal may be shown in fig. 3. The terminal may include one or more processors 100 (only one shown in fig. 3), a memory 101, and a computer program 102, e.g., a mirrored data synchronization program, stored in the memory 101 and executable on the one or more processors 100. The one or more processors 100, when executing the computer program 102, may implement the various steps in an embodiment of a mirrored data synchronization method. Alternatively, the one or more processors 100, when executing the computer program 102, may implement the functions of the modules/units of the mirrored data synchronization embodiments, without limitation.
In one embodiment, the processor 100 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In one embodiment, the memory 101 may be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the electronic device. Further, the memory 101 may also include both an internal storage unit and an external storage device of the electronic device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
It will be appreciated by those skilled in the art that the functional block diagram shown in fig. 3 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the terminal to which the present inventive arrangements may be applied, as a specific terminal may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program, which may be stored on a non-transitory computer readable storage medium, that when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, operational database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operation data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (4)

1. A method of synchronizing mirrored data, the method comprising:
receiving a data access request, and acquiring mirror image data when the data access request is determined to be a data mirror image request;
carrying out mirror image processing on the mirror image data, and determining an interception event and timestamp information corresponding to the interception event in the mirror image processing process;
acquiring intercepted data based on the timestamp information, and synchronizing the intercepted data;
the receiving the data access request, and when determining that the data access request is a data mirroring request, obtaining mirrored data includes:
acquiring data access request information, and analyzing the data access request information to obtain an access intention corresponding to the data access request information;
if the access intention is a data pushing intention, a pushing mode corresponding to the data pushing intention is obtained;
if the pushing mode is a mirror mode, determining the data access request information as a data mirror request, and acquiring the mirror data;
the obtaining the mirror image data includes:
acquiring pointer information in the data access request, and determining corresponding file header information and storage path information based on the pointer information;
determining a storage position based on the storage path information, and pulling mirror image data corresponding to the file header information from the storage position;
the determining the interception event and the timestamp information corresponding to the interception event in the mirror image processing process comprises the following steps:
acquiring data information received after mirror image processing, and acquiring a first occupied memory of the data information;
acquiring a second occupied memory of the mirror image data, and comparing the first occupied memory with the second occupied memory;
if the first occupied memory is smaller than the second occupied memory, determining that an interception event occurs in the mirror image processing process, and recording timestamp information corresponding to the interception event;
or,
the determining the interception event and the timestamp information corresponding to the interception event in the mirror image processing process comprises the following steps:
in the mirror image processing process, recording the actual mirror image time length of the mirror image processing process;
obtaining the estimated mirror time length corresponding to the mirror data, and comparing the actual mirror time length with the estimated mirror time length;
if the time length difference between the actual mirror time length and the estimated mirror time length is larger than a preset value, determining that an interception event occurs in the mirror processing process, and recording timestamp information corresponding to the interception event;
the acquiring intercepted data based on the timestamp information includes:
positioning the occurrence time of the interception event based on the timestamp information;
acquiring data of which the two ends are offset by preset time length by taking the occurrence time of the interception event as a midpoint, and acquiring intercepted data;
the synchronizing the intercepted data comprises the following steps:
comparing the intercepted data with the data information received after the mirror image processing;
and eliminating the same data in the intercepted data and the data information, and synchronizing the rest data in the intercepted data.
2. A mirrored data synchronization apparatus, said apparatus comprising:
the mirror image data acquisition module is used for receiving a data access request and acquiring mirror image data when the data access request is determined to be a data mirror image request;
the time stamp information determining module is used for carrying out mirror image processing on the mirror image data and determining an interception event and time stamp information corresponding to the interception event in the mirror image processing process;
the data synchronization module is used for acquiring intercepted data based on the timestamp information and synchronizing the intercepted data;
the mirror image data acquisition module comprises:
the access intention determining unit is used for acquiring data access request information, analyzing the data access request information and obtaining the access intention corresponding to the data access request information;
a pushing mode determining unit, configured to obtain a pushing mode corresponding to the data pushing intention if the access intention is the data pushing intention;
the mirror image data acquisition unit is used for determining the data access request information as a data mirror image request and acquiring the mirror image data if the pushing mode is a mirror image mode;
the mirror image data acquisition unit includes:
an information acquisition subunit, configured to acquire pointer information in the data access request, and determine corresponding file header information and storage path information based on the pointer information;
a data pulling subunit, configured to determine a storage location based on the storage path information, and pull mirror image data corresponding to the file header information from the storage location;
the timestamp information determination module includes:
the occupied memory determining unit is used for acquiring the data information received after the mirror image processing and acquiring a first occupied memory of the data information;
the occupied memory comparison unit is used for acquiring a second occupied memory of the mirror image data and comparing the first occupied memory with the second occupied memory;
the time recording unit is used for determining that an interception event occurs in the mirror image processing process if the first occupied memory is smaller than the second occupied memory, and recording timestamp information corresponding to the interception event;
or,
the timestamp information determination module includes:
a duration recording subunit, configured to record an actual mirroring duration of the mirroring process in the mirroring process;
a time length comparison subunit, configured to obtain an estimated image time length corresponding to the image data, and compare the actual image time length with the estimated image time length;
an event determining subunit, configured to determine that an interception event occurs in the mirror image processing process if a duration difference between the actual mirror image duration and the estimated mirror image duration is greater than a preset value, and record timestamp information corresponding to the interception event;
the data synchronization module comprises:
the time determining unit is used for positioning the occurrence time of the interception event based on the time stamp information;
the data interception unit is used for acquiring data of which the two ends are respectively deviated from preset duration by taking the occurrence time of the interception event as a midpoint to obtain intercepted data;
the data synchronization module comprises:
the data comparison unit is used for comparing the intercepted data with the data information received after the mirror image processing;
and the data eliminating unit is used for eliminating the same data in the intercepted data and the data information and synchronizing the rest data in the intercepted data.
3. A terminal comprising a memory, a processor and a mirrored data synchronization program stored in the memory and operable on the processor, the processor implementing the steps of the mirrored data synchronization method of claim 1 when executing the mirrored data synchronization program.
4. A computer readable storage medium, wherein a mirror data synchronization program is stored on the computer readable storage medium, which when executed by a processor, implements the steps of the mirror data synchronization method of claim 1.
CN202410004683.1A 2024-01-03 2024-01-03 Mirror image data synchronization method, device, terminal and storage medium Active CN117492935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410004683.1A CN117492935B (en) 2024-01-03 2024-01-03 Mirror image data synchronization method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410004683.1A CN117492935B (en) 2024-01-03 2024-01-03 Mirror image data synchronization method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN117492935A CN117492935A (en) 2024-02-02
CN117492935B true CN117492935B (en) 2024-03-15

Family

ID=89667635

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410004683.1A Active CN117492935B (en) 2024-01-03 2024-01-03 Mirror image data synchronization method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN117492935B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7526516B1 (en) * 2006-05-26 2009-04-28 Kaspersky Lab, Zao System and method for file integrity monitoring using timestamps
CN104866435A (en) * 2015-06-06 2015-08-26 成都云祺科技有限公司 Continuous data protection method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10101941B2 (en) * 2016-09-20 2018-10-16 International Business Machines Corporation Data mirror invalid timestamped write handling
US10229180B2 (en) * 2017-06-01 2019-03-12 International Business Machines Corporation Consistent point-in-time copy of a consistent asynchronous mirror target without pausing a consistent asynchronous mirror copy

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7526516B1 (en) * 2006-05-26 2009-04-28 Kaspersky Lab, Zao System and method for file integrity monitoring using timestamps
CN104866435A (en) * 2015-06-06 2015-08-26 成都云祺科技有限公司 Continuous data protection method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于虚拟机监控器的类蜜罐实时内存取证";赵宇韬等;《浙江大学学报(工学版)》;20180215(第02期);第186-196页 *

Also Published As

Publication number Publication date
CN117492935A (en) 2024-02-02

Similar Documents

Publication Publication Date Title
EP3522042A1 (en) Method and apparatus for information processing, server and computer readable medium
US9229970B2 (en) Methods to minimize communication in a cluster database system
WO2020151181A1 (en) Cross-platform data updating method and apparatus based on block chain, and computer device
US11233874B2 (en) Ordinary write in distributed system maintaining data storage integrity
CN108965383B (en) File synchronization method and device, computer equipment and storage medium
US20180139280A1 (en) Methods and apparatuses for cluster switching
WO2015184925A1 (en) Data processing method for distributed file system and distributed file system
CN104424186A (en) Method and device for realizing persistence in flow calculation application
US20220286277A1 (en) Unmanned driving information storage and playback method, device and storage medium
CN110019063B (en) Method for computing node data disaster recovery playback, terminal device and storage medium
CN109522273B (en) Method and device for realizing data writing
US9588884B2 (en) Systems and methods for in-place reorganization of device storage
CN117492935B (en) Mirror image data synchronization method, device, terminal and storage medium
CN110543398A (en) method and system for recording fault information
CN107621994B (en) Method and device for creating data snapshot
CN108460047B (en) Data synchronization method and device
CN107528703B (en) Method and equipment for managing node equipment in distributed system
CN111104294A (en) Method and device for generating BMC log
CN112199329B (en) Double-machine operation and maintenance data archiving and cleaning method and device based on fort machine
CN113535477B (en) Method and equipment for data disaster recovery
CN114896276A (en) Data storage method and device, electronic equipment and distributed storage system
CN117472397B (en) Data mirror image control method, device, terminal and storage medium
CN105988917B (en) Abnormal information acquisition method and device
CN116339609A (en) Data processing method and storage device
CN112698987A (en) On-line backup method, device, equipment and storage medium for snapshot-free operating system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant