CN117472397B - Data mirror image control method, device, terminal and storage medium - Google Patents

Data mirror image control method, device, terminal and storage medium Download PDF

Info

Publication number
CN117472397B
CN117472397B CN202311819162.3A CN202311819162A CN117472397B CN 117472397 B CN117472397 B CN 117472397B CN 202311819162 A CN202311819162 A CN 202311819162A CN 117472397 B CN117472397 B CN 117472397B
Authority
CN
China
Prior art keywords
data
mirror image
callback function
target
image data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311819162.3A
Other languages
Chinese (zh)
Other versions
CN117472397A (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 CN202311819162.3A priority Critical patent/CN117472397B/en
Publication of CN117472397A publication Critical patent/CN117472397A/en
Application granted granted Critical
Publication of CN117472397B publication Critical patent/CN117472397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The invention discloses a data mirror image control method, a device, a terminal and a storage medium, wherein the method comprises the following steps: mirror image data is obtained, a target callback function is determined based on the mirror image data, and the target callback function and the mirror image data are stored in a message queue; when executing the mirror event, acquiring a target callback function from the message queue, and calling mirror data based on the target callback function to carry out mirror processing; and after the mirror image processing is finished, acquiring an initial callback function, replacing the target callback function with the initial callback function, and performing data synchronization by using the initial callback function. The invention can call the mirror image data based on the target callback function, and re-synchronize the data based on the initial callback function after the mirror image event is executed.

Description

Data mirror image control method, device, terminal and storage medium
Technical Field
The present invention relates to the field of data mirroring technologies, and in particular, to a data mirroring control method, device, terminal, and storage medium.
Background
Traditional data mirroring is performed by creating a top-level device and then abstracting out a virtual device. In addition, after the mirror image processing, the equipment needs to be restarted, so that service interruption can be caused, and inconvenience is brought to the use of a user.
Accordingly, there is a need for improvement and advancement in the art.
Disclosure of Invention
The invention aims to solve the technical problem that the data mirroring control method, the device, the terminal and the medium are provided for overcoming the defects in the prior art, and aims to solve the problem that abstract virtual equipment is needed to realize data mirroring in the prior art. In addition, after the mirror image processing, the equipment needs to be restarted, so that service interruption can be caused, and the problem of inconvenience is brought to the use of users.
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 data mirroring control method, the method including:
obtaining mirror image data, determining a target callback function based on the mirror image data, and storing the target callback function and the mirror image data into a message queue;
when executing the mirror event, acquiring the target callback function from the message queue, and calling the mirror data to carry out mirror processing based on the target callback function;
and after the mirror image processing is finished, acquiring an initial callback function, replacing the target callback function by the initial callback function, and performing data synchronization by using the initial callback function.
In one implementation, the obtaining the mirrored data, determining the target callback function based on the mirrored data, includes:
determining type information of the mirror image data based on the mirror image data, wherein the type information is used for reflecting the data type of the mirror image data;
and determining target virtual equipment for carrying out mirror image processing on the mirror image data based on the type information, and acquiring a target callback function corresponding to the target virtual equipment.
In one implementation, the determining, based on the type information, a target virtual device for mirroring the mirrored data includes:
acquiring a preset equipment library, wherein the preset equipment library comprises a plurality of virtual equipment and function information of each virtual equipment, and the function information corresponds to the data type of data subjected to mirror image processing by using the virtual equipment;
and matching the type information with the preset equipment library to obtain the target virtual equipment.
In one implementation manner, the mirroring processing based on the target callback function calling the mirrored data includes:
calling the mirror image data based on the target callback function, and judging whether original data corresponding to the mirror image data exists or not;
if the original data exist, incremental data of the mirror image data relative to the original data are acquired;
and calling the incremental data based on the target callback function to carry out mirror image processing.
In one implementation, the obtaining incremental data of the mirror data relative to the original data if the original data exists includes:
if the original data exist, analyzing the mirror image data to obtain analysis content;
the method comprises the steps of obtaining original content corresponding to the original data, carrying out segmentation processing on the analysis content and the original content according to the same components to obtain a plurality of first content segments corresponding to the analysis content and a plurality of second content segments corresponding to the original content;
and respectively comparing the first content segment with the second content segment to obtain the incremental data.
In one implementation, the comparing the first content segment with the second content segment to obtain the incremental data includes:
determining a first check value for each of the first content segments and a second check value for each of the second content segments, respectively;
and comparing the first check value with the second check value to determine the increment data.
In one implementation, the performing data synchronization using the initial callback function includes:
the method comprises the steps of obtaining mirror image position information corresponding to incremental data, wherein the mirror image position information is used for reflecting the position of the incremental data after mirror image processing is carried out on the incremental data;
acquiring the incremental data based on the mirror image position information through the initial callback function, and synchronizing the incremental data;
and monitoring the synchronous state in real time, if the synchronous state is interrupted, acquiring the unsynchronized data, recording the unsynchronized data, and continuing to synchronize the unsynchronized data when the terminal is restarted next time.
In a second aspect, an embodiment of the present invention may further provide a data mirroring control apparatus, where the apparatus includes:
the target callback function determining module is used for acquiring mirror image data, determining a target callback function based on the mirror image data, and storing the target callback function and the mirror image data into a message queue;
the data mirror image processing module is used for acquiring the target callback function from the message queue when executing a mirror image event, and calling the mirror image data to carry out mirror image processing based on the target callback function;
and the data synchronization module is used for acquiring an initial callback function after the mirror image processing is finished, replacing the target callback function with the initial callback function, and performing data synchronization by using the initial callback function.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal includes a memory, a processor, and a data mirroring control program stored in the memory and capable of running on the processor, and when the processor executes the data mirroring control program, the processor implements the steps of the data mirroring control 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 data mirroring control program is stored on the computer readable storage medium, where the data mirroring control program, when executed by a processor, implements the steps of the data mirroring control method according to any one of the above schemes.
The beneficial effects are that: compared with the prior art, the invention provides a data mirror image control method, which comprises the steps of firstly obtaining mirror image data, determining a target callback function based on the mirror image data, and storing the target callback function and the mirror image data into a message queue. And then, when the mirror event is executed, acquiring the target callback function from the message queue, and calling the mirror data to carry out mirror processing based on the target callback function. And finally, after the mirror image processing is finished, acquiring an initial callback function, replacing the target callback function by the initial callback function, and performing data synchronization by using the initial callback function. The invention can call the mirror image data based on the target callback function, and re-synchronize the data based on the initial callback function after the mirror image event is executed.
Drawings
Fig. 1 is a flowchart of a specific implementation of a data mirroring control method according to an embodiment of the present invention.
Fig. 2 is a functional schematic diagram of a data mirroring control 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 data mirror image control method, which is based on the method of the embodiment, does not need to abstract virtual equipment when data mirror image is carried out, does not need to restart the equipment and does not need to interrupt service, and provides convenience for users. Specifically, in this embodiment, mirror image data is first obtained, an objective callback function is determined based on the mirror image data, and the objective callback function and the mirror image data are stored in a message queue. And then, when the mirror event is executed, acquiring the target callback function from the message queue, and calling the mirror data to carry out mirror processing based on the target callback function. And finally, after the mirror image processing is finished, acquiring an initial callback function, replacing the target callback function by the initial callback function, and performing data synchronization by using the initial callback function. The invention can call the mirror image data based on the target callback function, and re-synchronize the data based on the initial callback function after the mirror image event is executed.
The data mirror image control method of the embodiment can be applied to a terminal, and the terminal can be an intelligent product terminal such as a computer and a mobile phone. In this embodiment, as shown in fig. 1, the data mirroring control method includes:
and step S100, obtaining mirror image data, determining a target callback function based on the mirror image data, and storing the target callback function and the mirror image data into a message queue.
In this embodiment, mirror image data is first obtained, where the mirror image data is data that needs to be mirrored on a terminal. Because the embodiment does not need to abstract virtual equipment to realize the calling and mirror processing of mirror data and mirror processing of the mirror data, the embodiment can determine the target callback function according to the mirror data so as to call the mirror data and mirror processing based on the target callback function. After mirror image data and a target callback function are acquired, the mirror image data and the target callback function are stored into a message queue, and execution of a mirror image event is waited.
In one implementation, the present embodiment is used in determining the target callback function. The method comprises the following steps:
step S101, based on the mirror image data, determining type information of the mirror image data, wherein the type information is used for reflecting the data type of the mirror image data;
step S102, determining a target virtual device for carrying out mirror image processing on the mirror image data based on the type information, and acquiring a target callback function corresponding to the target virtual device.
After mirror image data is acquired, the mirror image data is analyzed, and type information of the mirror image data is determined, wherein the type information is used for reflecting the data type of the mirror image data. In order to facilitate the call to the mirror image data, the embodiment can set different callback functions for the mirror image data of different data types so as to determine a corresponding target callback function based on the type information of the mirror image data, wherein the target callback function is used for calling the mirror image data corresponding to the type information and is only used for calling the mirror image data corresponding to the type information.
Specifically, after the type information of the mirror image data is analyzed, the target virtual device for performing mirror image processing on the mirror image data is determined, wherein the target virtual device is preset, is used for performing data mirror image, and is only used for performing data mirror image on the data type corresponding to the analyzed type information. In a specific application, the embodiment presets a preset equipment library, wherein the preset equipment library comprises a plurality of virtual equipment and function information of each virtual equipment, and the function information corresponds to a data type of data subjected to mirror image processing by using the virtual equipment. That is, the present embodiment sets a corresponding callback function for each type of information in advance, and therefore, the function information of the set callback function corresponds to the data type of the data subjected to the mirroring processing using the virtual device. And after the type information is matched with the preset equipment library, obtaining the target virtual equipment corresponding to the type information at the moment. After the target virtual device is determined, the embodiment can directly call the target callback function of the target virtual device.
In a specific application, the type information of the embodiment may include system class data and software application class data, where the system class data is data related to an operating system of the terminal, such as system installation data and system update data. The software application class data is data of an application program installed in the terminal, such as application program installation data, application program version update data, and the like. According to the embodiment, different virtual devices can be set according to the system class data and the software application class data, and different target callback functions are set for different virtual devices, so that after the type information of the mirror image data is determined, the corresponding target virtual device and the target callback function corresponding to the target virtual device can be determined quickly, and the data processing efficiency is improved. In addition, the software application class data can be subdivided according to the attribute of the software application, and the software application class data is further divided into the system self-contained software class data and the uninstallable software class data, so that different target callback functions can be conveniently and further used for different software application class data, the mirror image data can be classified more finely, and the retrieval accuracy of the target callback functions is improved.
And step 200, when a mirror event is executed, acquiring the target callback function from the message queue, and calling the mirror data to carry out mirror processing based on the target callback function.
When the terminal starts to execute the mirror event, the embodiment obtains the target callback function from the message queue, then calls mirror data based on the target callback function, and performs mirror processing on the mirror data. When a plurality of mirror image data are stored in the message queue according to the priority order, when a mirror image event is executed, the terminal firstly acquires mirror image data with high priority and a corresponding target callback function according to the priority order to carry out mirror image processing, and then acquires mirror image data with low priority and a corresponding target callback function to carry out mirror image processing.
In one implementation manner, the method in this embodiment includes the following steps when performing the mirroring process:
step 201, calling the mirror image data based on the target callback function, and judging whether original data corresponding to the mirror image data exists or not;
step S202, if original data exist, incremental data of the mirror image data relative to the original data are obtained;
and step S203, calling the incremental data based on the target callback function to carry out mirror image processing.
In this embodiment, since the virtual device is not required to be abstracted to perform data mirroring in this embodiment, but the target callback function determined in this embodiment corresponds to the corresponding virtual device, and the function of the target callback function is a function for implementing the virtual device, the mirroring process can be performed based on the target callback function. Specifically, the terminal firstly calls the mirror image data based on the target callback function, and judges whether original data corresponding to the mirror image data exists or not, wherein the original data is initial data corresponding to the mirror image data. For example, when the mirror image data is system class data, the mirror image data obtained currently is the latest version of system data, and the original data is the old version of system data. For another example, when the image data is software application data, the currently acquired image data is the latest version of software installation data, and the original data is the old version of software installation data.
In one implementation manner, if the terminal has original data, in order to save the time of data mirroring in the subsequent step and improve the efficiency of data mirroring, the embodiment may only obtain incremental data of the mirrored data relative to the original data, where the incremental data reflects data added by the current mirrored data relative to the original data, such as an increase of a function of an operating system, etc., and then the terminal may directly call back the incremental data according to a target dropping function and execute a mirroring event, so as to mirror the incremental data into the terminal. Of course, in another implementation manner, after determining that the original data exists in the terminal, the embodiment may also only obtain the decrement data of the mirror image data relative to the original data, where the decrement data reflects the data reduced by the current mirror image data relative to the original data, such as the function deletion of the software application, where the terminal may generate an operation instruction based on the decrement data, and modify the original data in the terminal according to the operation instruction, so that the modified original data is the same as the mirror image data, which eliminates the complicated step that most of the data needs to be covered in the traditional data mirror image, and only needs to delete the redundant data, thereby achieving the purpose of data mirror image.
Specifically, in this embodiment, if possible, the mirror image data is parsed to obtain parsed content. And then acquiring the original content corresponding to the original data. Then, the embodiment performs segmentation processing on the parsed content and the original content according to the same component to obtain a plurality of first content segments corresponding to the parsed content and a plurality of second content segments corresponding to the original content. That is, in this embodiment, when the parsing content and the original content are segmented based on the same segmentation method, a plurality of groups of content groups including a first content segment and a second content segment can be obtained, and when the first content segment and the second content segment are respectively compared, the first content segment and the second content segment in the same content group are respectively compared, and specifically, a first check value of the first content segment and a second check value of the second content segment in the same content group can be respectively determined. And comparing the first check value with the second check value, if the first check value is different from the second check value, indicating that the difference exists between the first content segment and the second content segment at the moment, based on the difference, rapidly analyzing the data with the difference in the first content segment and the second content segment of each content group, further rapidly obtaining the increment data or the decrement data, and determining the increment data.
In other implementations, if the terminal does not have the original data, it is indicated that the terminal has not installed the mirror image data before, and at this time, the embodiment may directly perform the mirror image processing on the mirror image data obtained at this time through the target callback function, so that the terminal stores the mirror image data.
And step S300, after the mirror image processing is finished, acquiring an initial callback function, replacing the target callback function by the initial callback function, and performing data synchronization by using the initial callback function.
In this embodiment, after the mirror event is executed, in order to intercept data in time and ensure that the terminal can operate normally, the embodiment may obtain an initial callback function, and replace the target callback function with the initial callback function. Then, the embodiment uses the initial callback function to execute the operation requirement of the terminal, and uses the initial callback function to perform data synchronization, wherein the data synchronization is to synchronize the mirror image data to the system of the terminal, so as to ensure that the terminal can normally operate after the data mirror image is completed. Therefore, after the data mirror image is finished, the terminal can complete data synchronization without restarting the terminal, so that the effectiveness of the data mirror image is ensured, and the normal use of a user is ensured.
In one implementation, the method in this embodiment includes the following steps when performing data synchronization:
step 301, obtaining mirror image position information corresponding to the incremental data, where the mirror image position information is used to reflect the position where the incremental data is stored after mirror image processing is performed on the incremental data;
step S302, acquiring the incremental data based on the mirror image position information through the initial callback function, and synchronizing the incremental data;
step S303, monitoring the synchronous state in real time, if the synchronous state is interrupted, acquiring the unsynchronized data, recording the unsynchronized data, and continuing to synchronize the unsynchronized data when the terminal is restarted next time.
Specifically, in this embodiment, first, mirrored position information corresponding to incremental data is obtained, where the mirrored position information is used to reflect a position where the incremental data is stored after the incremental data is mirrored. When the method is specifically applied, the image position information can be a bitmap, so that the terminal can conveniently and quickly position the incremental data, then the embodiment obtains the incremental data based on the image position information through the initial callback function and synchronizes the incremental data to a system of the terminal, and the embodiment switches the initial callback function to perform data synchronization at the moment, can be used for verifying whether the mirrored incremental data is valid or not, and is beneficial to ensuring that the mirrored incremental data can be normally invoked in the terminal system. Thus, the situation that the terminal is restarted to cause the service to be interrupted can be avoided. In addition, the terminal in this embodiment monitors the synchronization status in real time, if the synchronization status is interrupted, the synchronization fails at this time, the terminal may acquire the unsynchronized data, record the unsynchronized data, and then control the terminal to continue synchronizing the unsynchronized data when restarting next time. If the synchronization state is not interrupted, the data synchronization is successful, the terminal enters an operation page to complete data mirroring and synchronization, and normal use of the terminal is ensured.
In summary, the embodiment first obtains mirror image data, determines a target callback function based on the mirror image data, and stores the target callback function and the mirror image data into a message queue. And then, when the mirror event is executed, acquiring the target callback function from the message queue, and calling the mirror data to carry out mirror processing based on the target callback function. And finally, after the mirror image processing is finished, acquiring an initial callback function, replacing the target callback function by the initial callback function, and performing data synchronization by using the initial callback function. The invention can call the mirror image data based on the target callback function, and re-synchronize the data based on the initial callback function after the mirror image event is executed.
Based on the above embodiment, the present invention further provides a data mirroring control apparatus, as shown in fig. 2, including: the system comprises an object callback function determining module 10, a data mirroring processing module 20 and a data synchronizing module 30. Specifically, the target callback function determining module 10 of the present embodiment is configured to obtain mirror data, determine a target callback function based on the mirror data, and store the target callback function and the mirror data in a message queue. The data mirroring module 20 is configured to obtain the target callback function from the message queue when a mirroring event is executed, and call the mirroring data to perform mirroring based on the target callback function. The data synchronization module 30 is configured to obtain an initial callback function after the mirroring process is finished, replace the target callback function with the initial callback function, and perform data synchronization by using the initial callback function.
In one implementation, the target callback function determination module 10 includes:
a type information determining unit configured to determine type information of the mirror data based on the mirror data, the type information being used to reflect a data type of the mirror data;
and the callback function determining unit is used for determining target virtual equipment for carrying out mirror image processing on the mirror image data based on the type information and acquiring a target callback function corresponding to the target virtual equipment.
In one implementation, the callback function determination unit includes:
the function information determining subunit is used for obtaining a preset equipment library, wherein the preset equipment library comprises a plurality of virtual equipment and function information of each virtual equipment, and the function information corresponds to the data type of data subjected to mirror image processing by using the virtual equipment;
and the device matching subunit is used for matching the type information with the preset device library to obtain the target virtual device.
In one implementation, the data mirroring module 20 includes:
the data analysis unit is used for calling the mirror image data based on the target callback function and judging whether original data corresponding to the mirror image data exists or not;
the incremental data determining unit is used for acquiring incremental data of the mirror image data relative to the original data if the original data exist;
and the mirror image processing unit is used for calling the incremental data based on the target callback function to carry out mirror image processing.
In one implementation, the incremental data determining unit includes:
the data analysis subunit is used for analyzing the mirror image data if the original data exist, so as to obtain analysis content;
the segmentation processing subunit is used for acquiring original content corresponding to the original data, and carrying out segmentation processing on the analysis content and the original content according to the same components to obtain a plurality of first content segments corresponding to the analysis content and a plurality of second content segments corresponding to the original content;
and the content comparison subunit is used for respectively comparing the first content segment with the second content segment to obtain the incremental data.
In one implementation, the content comparison subunit includes:
a check value determining subunit configured to determine a first check value of each of the first content segments and a second check value of each of the second content segments, respectively;
and the check value comparison subunit is used for comparing the first check value with the second check value and determining the increment data.
In one implementation, the data synchronization module 30 includes:
the position information determining unit is used for obtaining mirror image position information corresponding to the incremental data, and the mirror image position information is used for reflecting the position of the incremental data after mirror image processing is carried out on the incremental data;
the data synchronization unit is used for acquiring the incremental data based on the mirror image position information through the initial callback function and synchronizing the incremental data;
and the data recording unit is used for monitoring the synchronous state in real time, acquiring the unsynchronized data if the synchronous state is interrupted, recording the unsynchronized data, and continuing to synchronize the unsynchronized data when the terminal is restarted next time.
The working principle of each module in the data mirror control 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 data mirroring control 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 embodiments of a data mirroring control method. Alternatively, the one or more processors 100, when executing the computer program 102, may implement the functions of the various modules/units in the data mirroring control apparatus embodiment, 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 (6)

1. A method of data mirroring control, the method comprising:
obtaining mirror image data, determining a target callback function based on the mirror image data, and storing the target callback function and the mirror image data into a message queue;
when executing the mirror event, acquiring the target callback function from the message queue, and calling the mirror data to carry out mirror processing based on the target callback function;
after the mirror image processing is finished, an initial callback function is obtained, the initial callback function is used for replacing the target callback function, and the initial callback function is used for data synchronization;
the obtaining mirror image data, determining a target callback function based on the mirror image data, includes:
determining type information of the mirror image data based on the mirror image data, wherein the type information is used for reflecting the data type of the mirror image data;
based on the type information, matching the type information with a preset equipment library, determining target virtual equipment for carrying out mirror image processing on the mirror image data, and acquiring a target callback function corresponding to the target virtual equipment, wherein the preset equipment library comprises a plurality of virtual equipment and function information of each virtual equipment, the function information corresponds to the data type of the data subjected to mirror image processing by using the virtual equipment, the target callback function is used for calling mirror image data corresponding to the type information and is only used for calling mirror image data corresponding to the type information, the target virtual equipment is preset and is used for carrying out data mirror image and is only used for carrying out data mirror image on the data type corresponding to the analyzed type information;
the calling the mirror image data based on the target callback function to carry out mirror image processing comprises the following steps:
calling the mirror image data based on the target callback function, and judging whether original data corresponding to the mirror image data exists or not;
if the original data exist, incremental data of the mirror image data relative to the original data are acquired;
calling the incremental data to carry out mirror image processing based on the target callback function;
the data synchronization using the initial callback function comprises:
the method comprises the steps of obtaining mirror image position information corresponding to incremental data, wherein the mirror image position information is used for reflecting the position of the incremental data after mirror image processing is carried out on the incremental data;
acquiring the incremental data based on the mirror image position information through the initial callback function, and synchronizing the incremental data;
and monitoring the synchronous state in real time, if the synchronous state is interrupted, acquiring the unsynchronized data, recording the unsynchronized data, and continuing to synchronize the unsynchronized data when the terminal is restarted next time.
2. The method according to claim 1, wherein the obtaining incremental data of the mirrored data relative to the original data if the original data exists includes:
if the original data exist, analyzing the mirror image data to obtain analysis content;
the method comprises the steps of obtaining original content corresponding to the original data, carrying out segmentation processing on the analysis content and the original content according to the same components to obtain a plurality of first content segments corresponding to the analysis content and a plurality of second content segments corresponding to the original content;
and respectively comparing the first content segment with the second content segment to obtain the incremental data.
3. The method of claim 2, wherein the comparing the first content segment with the second content segment to obtain the incremental data comprises:
determining a first check value for each of the first content segments and a second check value for each of the second content segments, respectively;
and comparing the first check value with the second check value to determine the increment data.
4. A data mirroring control apparatus, the apparatus comprising:
the target callback function determining module is used for acquiring mirror image data, determining a target callback function based on the mirror image data, and storing the target callback function and the mirror image data into a message queue;
the data mirror image processing module is used for acquiring the target callback function from the message queue when executing a mirror image event, and calling the mirror image data to carry out mirror image processing based on the target callback function;
the data synchronization module is used for acquiring an initial callback function after the mirror image processing is finished, replacing the target callback function with the initial callback function, and performing data synchronization by using the initial callback function;
the target callback function determination module comprises:
a type information determining unit configured to determine type information of the mirror data based on the mirror data, the type information being used to reflect a data type of the mirror data;
the callback function determining unit is used for matching the type information with a preset device library based on the type information, determining target virtual devices for carrying out mirror image processing on the mirror image data, and acquiring target callback functions corresponding to the target virtual devices, wherein the preset device library comprises a plurality of virtual devices and function information of each virtual device, the function information corresponds to the data type of the data which is subjected to mirror image processing by using the virtual devices, the target callback functions are used for calling mirror image data corresponding to the type information and are only used for calling mirror image data corresponding to the type information, the target virtual devices are preset and are used for carrying out data mirror image, and the target virtual devices are only used for carrying out data mirror image on the data type corresponding to the analyzed type information;
the data mirror processing module comprises:
the data analysis unit is used for calling the mirror image data based on the target callback function and judging whether original data corresponding to the mirror image data exists or not;
the incremental data determining unit is used for acquiring incremental data of the mirror image data relative to the original data if the original data exist;
the mirror image processing unit is used for calling the incremental data to carry out mirror image processing based on the target callback function;
the data synchronization module comprises:
the position information determining unit is used for obtaining mirror image position information corresponding to the incremental data, and the mirror image position information is used for reflecting the position of the incremental data after mirror image processing is carried out on the incremental data;
the data synchronization unit is used for acquiring the incremental data based on the mirror image position information through the initial callback function and synchronizing the incremental data;
and the data recording unit is used for monitoring the synchronous state in real time, acquiring the unsynchronized data if the synchronous state is interrupted, recording the unsynchronized data, and continuing to synchronize the unsynchronized data when the terminal is restarted next time.
5. A terminal comprising a memory, a processor and a data mirroring control program stored in the memory and executable on the processor, the processor implementing the steps of the data mirroring control method according to any one of claims 1-3 when executing the data mirroring control program.
6. A computer readable storage medium, wherein a data mirroring control program is stored on the computer readable storage medium, which when executed by a processor, implements the steps of the data mirroring control method according to any one of claims 1-3.
CN202311819162.3A 2023-12-27 2023-12-27 Data mirror image control method, device, terminal and storage medium Active CN117472397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311819162.3A CN117472397B (en) 2023-12-27 2023-12-27 Data mirror image control method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311819162.3A CN117472397B (en) 2023-12-27 2023-12-27 Data mirror image control method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN117472397A CN117472397A (en) 2024-01-30
CN117472397B true CN117472397B (en) 2024-04-05

Family

ID=89635105

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311819162.3A Active CN117472397B (en) 2023-12-27 2023-12-27 Data mirror image control method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN117472397B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404506A (en) * 2015-10-30 2016-03-16 广州云晫信息科技有限公司 Construction method and system of cloud computing mirror image document
CN110505162A (en) * 2019-08-08 2019-11-26 腾讯科技(深圳)有限公司 Method for message transmission, device and electronic equipment
CN113641760A (en) * 2021-08-16 2021-11-12 付睿智 Data synchronization method and device
CN113656189A (en) * 2018-05-15 2021-11-16 西安万像电子科技有限公司 Message processing method and device
CN115562565A (en) * 2021-07-01 2023-01-03 旺宏电子股份有限公司 Memory device and method for maintaining data mirror integrity thereof
CN116467389A (en) * 2023-04-24 2023-07-21 中煤科工集团重庆研究院有限公司 Data synchronization method for coal mine two-stage data center
CN116800700A (en) * 2022-06-29 2023-09-22 中移(苏州)软件技术有限公司 Mirror image management method, system, equipment and storage medium
CN116820493A (en) * 2023-05-23 2023-09-29 山东浪潮科学研究院有限公司 Mirror image file deployment method, system, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9258363B2 (en) * 2010-11-15 2016-02-09 Microsoft Technology Licensing, Llc Data cube high availability
US20130304705A1 (en) * 2012-05-11 2013-11-14 Twin Peaks Software, Inc. Mirror file system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404506A (en) * 2015-10-30 2016-03-16 广州云晫信息科技有限公司 Construction method and system of cloud computing mirror image document
CN113656189A (en) * 2018-05-15 2021-11-16 西安万像电子科技有限公司 Message processing method and device
CN110505162A (en) * 2019-08-08 2019-11-26 腾讯科技(深圳)有限公司 Method for message transmission, device and electronic equipment
CN115562565A (en) * 2021-07-01 2023-01-03 旺宏电子股份有限公司 Memory device and method for maintaining data mirror integrity thereof
CN113641760A (en) * 2021-08-16 2021-11-12 付睿智 Data synchronization method and device
CN116800700A (en) * 2022-06-29 2023-09-22 中移(苏州)软件技术有限公司 Mirror image management method, system, equipment and storage medium
CN116467389A (en) * 2023-04-24 2023-07-21 中煤科工集团重庆研究院有限公司 Data synchronization method for coal mine two-stage data center
CN116820493A (en) * 2023-05-23 2023-09-29 山东浪潮科学研究院有限公司 Mirror image file deployment method, system, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于开源的消息队列云服务研究;郑立 等;信息通信技术与政策;20200515(第05期);第56-60页 *

Also Published As

Publication number Publication date
CN117472397A (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN107729041B (en) Application program hot updating method, device, terminal and storage medium
US10509585B2 (en) Data synchronization method, apparatus, and system
CN106970921B (en) Data migration method and device
EP3522042A1 (en) Method and apparatus for information processing, server and computer readable medium
CN109445861B (en) System starting method, device, computer device and storage medium
US20180285216A1 (en) Virtual Machine Recovery Method and Virtual Machine Management Device
CN110753084B (en) Uplink data reading method, cache server and computer readable storage medium
CN110018884B (en) Distributed transaction processing method, coordination device, database and electronic equipment
CN108965383B (en) File synchronization method and device, computer equipment and storage medium
CN110795171B (en) Service data processing method, device, computer equipment and storage medium
CN111639132B (en) Log synchronization method and equipment
CN107203437B (en) Method, device and system for preventing memory data from being lost
CN111274205A (en) Data block access method and device and storage medium
CN113064919B (en) Data processing method, data storage system, computer device and storage medium
CN117472397B (en) Data mirror image control method, device, terminal and storage medium
CN105824622B (en) Data processing method and electronic equipment
CN115061858B (en) Data persistence method and device, computer equipment and storage medium
CN114490570A (en) Production data synchronization method and device, data synchronization system and server
CN117492935B (en) Mirror image data synchronization method, device, terminal and storage medium
CN112783866A (en) Data reading method and device, computer equipment and storage medium
CN113672640A (en) Data query method and device, computer equipment and storage medium
CN113032021A (en) System switching and data processing method, device, equipment and storage medium thereof
CN111221817B (en) Service information data storage method, device, computer equipment and storage medium
CN117112314B (en) Service data switching method, device, equipment and storage medium
CN117555729A (en) Automatic backup and recovery method for system, terminal equipment and storage medium

Legal Events

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