CN112182002A - Data disaster tolerance method and device, electronic equipment and computer readable medium - Google Patents

Data disaster tolerance method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112182002A
CN112182002A CN202011031169.5A CN202011031169A CN112182002A CN 112182002 A CN112182002 A CN 112182002A CN 202011031169 A CN202011031169 A CN 202011031169A CN 112182002 A CN112182002 A CN 112182002A
Authority
CN
China
Prior art keywords
value pair
key
pair data
data
terminal device
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.)
Pending
Application number
CN202011031169.5A
Other languages
Chinese (zh)
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011031169.5A priority Critical patent/CN112182002A/en
Publication of CN112182002A publication Critical patent/CN112182002A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines

Abstract

The embodiment of the disclosure discloses a data disaster tolerance method and a data disaster tolerance device. One embodiment of the method comprises: sending target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device; in response to determining that the number of the target key value pair data stored on the first terminal device exceeds a preset threshold, sending the target key value pair data stored on the first terminal device to an online file storage system; in response to detecting a connection with a second terminal device, selecting target key-value pair data meeting a first predetermined condition from an online file storage system; and packaging the selected target key value pair data and then sending the packaged target key value pair data to the second terminal equipment. The implementation mode can realize distributed storage of disaster tolerance data, improve the data acquisition speed and realize effective data disaster tolerance.

Description

Data disaster tolerance method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a data disaster recovery method, a data disaster recovery device, electronic equipment and a computer readable medium.
Background
With the advent of the big data age, data is more and more important to the development of science and technology. Here, it is important to perform data disaster recovery on how efficiently massive data is.
At present, when disaster recovery data is stored, the disaster recovery data is often required to be stored in a disaster recovery server, and the way of storing the disaster recovery data is single. Meanwhile, when the terminal device needs the disaster tolerance data, the terminal device often needs to acquire the disaster tolerance data from the disaster tolerance server, and the time consumed for acquiring the disaster tolerance data is long.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose data disaster recovery methods, apparatuses, devices and computer readable media to solve the technical problems mentioned in the background section above.
In a first aspect, an embodiment of the present disclosure provides a data disaster recovery method for a server, where the method includes: sending target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device; and in response to determining that the number of the target key-value pair data stored on the first terminal device exceeds a preset threshold, sending the target key-value pair data stored on the first terminal device to an online file storage system.
In a second aspect, an embodiment of the present disclosure provides a data disaster recovery method for a terminal device, where the method includes: in response to detecting a transmission fault aiming at target content, searching whether a key corresponding to the target content exists in at least one piece of stored target key value pair data, wherein the at least one piece of target key value pair data is received from a disaster recovery server, and the key and the value in the target key value pair data are generated by the disaster recovery server according to the content presented on the terminal equipment; and when the target content is searched, acquiring the target content based on the value corresponding to the searched key.
In a third aspect, an embodiment of the present disclosure provides a data disaster recovery device for a server, where the device includes: a first sending unit configured to send target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device; a second sending unit configured to send the target key-value pair data stored on the first terminal device to an online file storage system in response to determining that the number of the target key-value pair data stored on the first terminal device exceeds a preset threshold; a selection unit configured to select, in response to detection of a connection with the second terminal device, target key-value pair data that meets a first predetermined condition from the online file storage system; and the packaging unit is configured to package the selected target key value pair data and then send the data to the second terminal equipment.
In a fourth aspect, an embodiment of the present disclosure provides a data disaster recovery apparatus for a terminal device, where the apparatus includes: a searching unit configured to search, in response to detecting a transmission failure for a target content, whether a key corresponding to the target content exists in at least one piece of stored target key-value pair data, where the at least one piece of target key-value pair data is received from a disaster recovery server, and keys and values in the target key-value pair data are generated by the disaster recovery server according to content presented on a terminal device; and the first acquisition unit is configured to acquire the target content based on the value corresponding to the searched key when the target content is searched.
In a fifth aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as in any one of the first or second aspects.
A sixth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, where the program, when executed by a processor, implements a method as in any one of the first or second aspects.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: by sending the target key-value pair data to the online key-value pair storage system, the first terminal device and the online file storage system, distributed storage of disaster tolerance data can be achieved. In addition, when the number of the target key value pair data stored on the first terminal device exceeds a preset threshold value, the target key value pair data stored on the first terminal device is sent to the online file storage system, and the storage pressure of the disaster tolerance data of the first terminal device is reduced. By the means, effective data disaster tolerance is achieved.
In other embodiments, the terminal device may obtain the content through the locally stored disaster recovery data, so that the speed of obtaining the disaster recovery data is obviously increased, and the transmission failure is overcome, thereby ensuring the content obtaining capability of the user.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of an application scenario of a data disaster recovery method according to some embodiments of the present disclosure;
FIG. 2 is a flow diagram of one embodiment of a data disaster recovery method, according to an embodiment of the present disclosure;
fig. 3 is a flowchart of one embodiment of a data disaster recovery method for a terminal device according to an embodiment of the present disclosure;
FIG. 4 illustrates an exemplary system architecture diagram of a data disaster recovery method or apparatus, according to some embodiments of the present disclosure;
FIG. 5 is a schematic block diagram of some embodiments of a data disaster recovery apparatus for a server according to the present disclosure;
fig. 6 is a schematic structural diagram of some embodiments of a data disaster recovery apparatus for a terminal device according to the present disclosure;
FIG. 7 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure;
fig. 8 is an exemplary structural diagram of an encapsulated file in a data disaster recovery method according to some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram 100 of an application scenario of a data disaster recovery method according to some embodiments of the present disclosure.
As shown in fig. 1, the video 102 may be content presented by the terminal device 106, and the content presented by the terminal device 106 is stored in the service 101. For example, the video 102, wherein the target key-value pair data generated according to the video 102 may include two parts, one part being a key corresponding to the video 102, as indicated by reference numeral 103; the other part is the corresponding value of the video 102, as indicated by reference numeral 104. The server 101 may then send the target key-value pair data 105 to the online key-value pair storage system 107. At the same time, the target key-value pair data 105 is also sent to the terminal device 106. Finally, in response to determining that the number of target key-value pair data stored on the terminal device 106 exceeds a preset threshold (e.g., 4), the target key-value pair data 105 may also be sent to the online file storage system 108.
On this basis, in response to detecting a connection with the second terminal device, target key-value pair data that meets a first predetermined condition (e.g., sports category) is selected from the above-described online-file storage system 108. And on the basis, the selected target key value pair data is packaged and sent to the second terminal equipment.
It is understood that the data disaster recovery method may be performed by the server described above. The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules, for example, to provide distributed services, or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of servers and the number of terminal devices in fig. 1 are merely illustrative. There may be any number of servers and terminal devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a data disaster recovery method according to the present disclosure is shown. The data disaster recovery method can be applied to a server and comprises the following steps:
step 201, sending the target key-value pair data to the online key-value pair storage system and the first terminal device.
In some embodiments, the execution principal (e.g., the server in fig. 1) may send the target key-value pair data to the online key-value pair storage system and the first terminal device via a wired connection or a wireless connection. The keys and values in the target key-value pair data are generated from content presented on the first terminal device. And the keys in the target key value pair data are used for representing the belonging category information of the content presented on the first terminal equipment. The values in the target key-value pair data are used to characterize information related to content presented on the first terminal device. The related information may include, but is not limited to, at least one of the following: a link to the content; title of the content, summary of the content.
Optionally, the content presented on the first terminal device may be filtered, so that the filtered content is used to generate keys and values in the target key-value pair data.
For example, 10 segments of video are played on the first terminal device, and the 10 segments of video are filtered (for example, one video is selected every 4 segments of video), so as to obtain two segments of video. For each of the two videos, the number of the category to which the video belongs is used as a key, and the related information of the video (for example, the URL of the video) is used as a value, so as to generate target key value pair data.
Here, the collected target key-value pair data is often stored in a designated partition. Wherein the designated partition is a memory region opened up for the target key value pair data. The target key-value pair data in the specified partition is all stored to the online key-value pair storage system by an execution agent (e.g., an offline script included in the execution agent described above). In practice, data in an online key-value pair storage system is often used as a large candidate set of disaster-tolerant data. An online key-value pair storage system may often store all of the target key-value pair data.
At the same time, the target key-value pair data may also be stored locally at the first terminal device. It is emphasized that the first terminal device has a limited capacity itself. It is often not possible to receive all of the target key-value pair data. Thus, when the target key-value pair data stored on the first terminal device reaches a maximum limit, some policy may be used to update the target key-value pair data stored by the first terminal device. For example, an LRU (Least Recently Used) policy may be Used to update the target key-value pair data stored by the first terminal device.
Step 202, sending the target key-value pair data stored on the first terminal device to an online file storage system.
In some embodiments, when the executing body detects that the number of target key-value pair data stored on the first terminal device exceeds a preset threshold, the target key-value pair data may be sent to an online file storage system. Here, the preset threshold may be determined by the capacity of the first terminal device. The online file system is used for storing the target key value to the data in a file form. It should be noted that, here, the number of the first terminal devices may be plural. Key-value pair data of content presented on a plurality of first terminal devices may be continuously transmitted to the online file system. Therefore, the disaster recovery data in the online file system can be continuously updated.
Step 203, responding to the detection of the connection with the second terminal device, selecting target key value pair data meeting the first preset condition from the online file storage system.
And step 204, encapsulating the selected target key value pair data and then sending the encapsulated target key value pair data to the second terminal equipment.
In some embodiments, as an example, the first predetermined condition may include: the content type of the content used to generate the target key-value pair data belongs to a predetermined type. For example, the video type of the video used to generate the target key-value pair data is a sports type. And after the execution main body screens out the corresponding key value pair data of the sports type video, sending the data to the second terminal equipment. And the second terminal equipment stores the key value pair data as disaster tolerance data. The selected target key value pair data can be packaged for transmission and processing. Specifically, the package may be performed according to a predetermined package format.
It should be noted that the number of the second terminal devices may also be multiple, and when the execution main body detects connection with multiple second terminal devices, the target key-value pair data meeting the first predetermined condition may be selected from the online file system. These data are then transmitted to a plurality of second terminal devices within a predetermined time (e.g., 1 second). Therefore, the disaster tolerance data can be shared between the plurality of second terminal devices and the online file system.
In an optional implementation manner of some embodiments, the encapsulating the selected target key value to the data may further be performed as follows. That is, the execution agent may package the selected target key-value pair data into a file. Wherein, the above-mentioned file includes: index length information, values in the key-value pair data, based on an index of a key in the key-value pair data. The index length information is integer information represented by fixed length bytes. The index based on a key in the key-value pair data stores the key (keyword) of the key-value pair data and the position of the value in the key-value pair data. As an example, as shown in fig. 8, where a mark 801 is index length information, a mark 802 is an index, and a mark 803 is a value in key-value pair data.
Optionally, the first predetermined condition may further include: the hit rate of the key value to the data is larger than a preset threshold value. Here, the hit rate may refer to a ratio of the number of times contents associated with a certain key-value pair data are presented at the terminal device per unit time to the number of times contents associated with all key-value pair data are presented at the terminal device.
For example, a group of terminal devices presents a total of 30 videos with associated key-value pair data within 30 minutes. Here, the video associated with the key-value pair data a is presented 3 times on the set of terminal devices, and the hit rate of the key-value pair data a may be 0.1.
In some optional implementations of some embodiments, the execution subject of the step of obtaining the target key-value pair data may be the server or not. Specifically, the target key-value pair data is obtained by:
first, the first terminal device may screen the initial key-value pair data set, and then obtain the key-value pair data set. The initial key-value pair data is generated from content presented on the first terminal device.
As an example, 100 segments of video are presented on the first terminal device. First, for each of the 100 segments of video, initial key-value pair data corresponding to the segment of video may be generated, resulting in an initial key-value pair data set. Then, the initial key-value pair data in the initial key-value pair data set may be further filtered (for example, according to a video type of a video corresponding to the key-value pair data), so that 50 pieces of initial key-value pair data may be obtained. Then, for each of the 50 pieces of initial key-value pair data, a serialization operation is performed to generate key-value pair data, resulting in a key-value pair data set. Here, the initial key-value pair data set may also be filtered using a sampling method (e.g., Markov Monte Carlo sampling).
And secondly, the execution main body can acquire the key value pair data set from the first terminal in a wired connection mode or a wireless connection mode.
And thirdly, the execution main body can further screen the key-value pair data set, and select the key-value pair data meeting a second preset condition as target key-value pair data.
Wherein the second predetermined condition may include, but is not limited to, at least one of the following: the content corresponding to the key value pair data meets the legal requirements; the content corresponding to the key-value pair data is acquired by a plurality of terminals within a predetermined time.
In some optional implementation manners of some embodiments, if the number of the target key-value pair data stored on the first terminal device exceeds a preset threshold, the execution main body may construct an index for the target key-value pair data, and obtain the target key-value pair data including the index. And then, sending the target key value pair data comprising the index to an online file storage system in a wired connection or wireless connection mode. Thus, key-value pair data in the online file storage system is updated.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: by sending the target key-value pair data to the online key-value pair storage system, the first terminal device and the online file storage system, distributed storage of disaster tolerance data can be achieved. In addition, when the number of the target key value pair data stored on the first terminal device exceeds a preset threshold value, the target key value pair data stored on the first terminal device is sent to the online file storage system, and the storage pressure of the disaster tolerance data of the first terminal device is reduced. In addition, in response to detecting connection with the second terminal device, the selected data may be sent to the second terminal, so that the second terminal obtains the disaster recovery data. By the means, effective data disaster tolerance is achieved.
Fig. 3 is a flowchart 300 of one embodiment of a data disaster recovery method for a terminal device according to an embodiment of the present disclosure. The data disaster recovery method for the terminal equipment comprises the following steps:
step 301, in response to detecting a transmission failure for the target content, searching whether a key corresponding to the target content exists in at least one piece of stored target key value pair data.
In some embodiments, the executing entity (e.g., the terminal device in fig. 1) may search, in response to detecting a transmission failure for the target content, a local storage medium (e.g., a local disk) for whether a key corresponding to the target content exists in the stored at least one piece of target key-value pair data. Here, the key corresponding to the target content may be generated by the terminal device described above from the target content. Here, the at least one piece of target key-value pair data may be received from a disaster tolerance server. The keys and values in the target key-value pair data may be generated by the disaster recovery server based on content presented on other terminal devices.
The keys in the target key-value pair data may be used to represent the category information of the content presented on the first terminal device. The values in the target key-value pair data may be used to characterize relevant information of the content presented on the first terminal device, such as a link address of the content.
Step 302, when the key is found, the target content is obtained based on the value corresponding to the found key.
In some embodiments, when the execution main body finds the key corresponding to the target content on the local storage medium, the target content may be obtained according to the storage location indicated by the value de-valued corresponding to the key.
In some optional implementations of some embodiments, the value retrieval request may be sent to the online key-value pair storage system when a key corresponding to the target content is not found on the local storage medium. After receiving the request from the execution agent, the online key value pair storage system may return a value corresponding to the target content required by the execution agent to the execution agent. Here, the value acquisition request includes the key corresponding to the target content. The technical effect of this implementation is that when the value corresponding to the desired target content is not found locally, the value can be obtained from the online key-value pair storage system.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: the terminal equipment can acquire the content by means of the locally stored disaster tolerance data, the speed of acquiring the disaster tolerance data is obviously improved, and the transmission fault is overcome, so that the content acquisition capability of a user is ensured, and the user experience is improved.
Fig. 4 illustrates an exemplary system architecture 400 of a data disaster recovery method or apparatus according to some embodiments of the present disclosure.
As shown in fig. 4, the system architecture 400 may include a terminal device 401, a database 402 for storing data queues, a server 403, an online key-value pair storage system 404, and an online file storage system 405. Among them, the terminal apparatus 401 can provide various services to the user through Rpc (remote procedure call).
During this process, data may be collected and stored in a data queue. As an example, during the process of receiving a data request, and successfully acquiring and returning data, the online service may sample and send the data to the data collector for data collection as needed. The data collector may store the received data in a data queue. Optionally, the sampled data may be serialized, and the serialized data may be stored in a data queue. The data in the data queue may be randomly placed into multiple partitions (e.g., partition 0, partition 1 … …, partition n, etc. in the figure). The offline script may consume data specifying the partition. By way of example, the full amount of data may be stored to the online key-value pair storage system 404 and the local disaster recovery data updated.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides some embodiments of a data disaster recovery apparatus for a server, which correspond to those of the method embodiments shown in fig. 2, and which can be specifically applied to the above-mentioned server.
As shown in fig. 5, the data disaster recovery apparatus 500 for a server of some embodiments includes:
a first sending unit 501, a second sending unit 502, a selecting unit 503 and an encapsulating unit 504. Wherein the first sending unit 501 is configured to send the target key-value pair data to the online key-value pair storage system and the first terminal device. Wherein the keys and values in the target key-value pair data are generated from content presented on the first terminal device. A second sending unit 502 configured to send the target key-value pair data stored on the first terminal device to the online file storage system in response to determining that the number of the target key-value pair data stored on the first terminal device exceeds a preset threshold. A selecting unit 503 configured to select target key-value pair data meeting a first predetermined condition from the online file storage system in response to detecting the connection with the second terminal device. And the encapsulating unit 504 is configured to encapsulate the selected target key value pair data and then send the encapsulated target key value pair data to the second terminal device.
In some optional implementations of some embodiments, the third sending unit of the data disaster recovery apparatus for the server may include a sub-encapsulation unit and a sub-sending unit. Wherein the sub-packaging unit is configured to: and encapsulating the selected target key value pair data into a file. Wherein, the above-mentioned file includes: index length information, values in the key-value pair data, based on an index of a key in the key-value pair data. The sub-transmission unit is configured to: and sending the file to the second terminal equipment.
In some optional implementations of some embodiments, the first predetermined condition includes: the hit rate of the key value to the data is larger than a preset threshold value.
In some optional implementations of some embodiments, the target key-value pair data is obtained by: and obtaining a key-value pair data set from the first terminal device, wherein the key-value pair data set is screened by the first terminal device from an initial key-value pair data set, and the initial key-value pair data is generated according to the content presented on the first terminal device. And screening out key-value pair data meeting a second preset condition from the key-value pair data set to serve as target key-value pair data.
In some optional implementations of some embodiments, the second sending unit 502 may be further configured to: constructing an index for the target key-value pair data to obtain target key-value pair data comprising the index; and sending the target key value pair data comprising the index to the online file storage system.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
With further reference to fig. 6, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides some embodiments of a data disaster recovery apparatus for a terminal device, where the apparatus embodiments correspond to those of the method shown in fig. 3, and the apparatus may be specifically applied to the above-mentioned server.
As shown in fig. 6, a data disaster recovery apparatus 600 for a terminal device according to some embodiments includes: a searching unit configured to search, in response to detecting a transmission failure for a target content, whether a key corresponding to the target content exists in at least one piece of stored target key-value pair data, where the at least one piece of target key-value pair data is received from a disaster recovery server, and keys and values in the target key-value pair data are generated by the disaster recovery server according to content presented on a terminal device; and the first acquisition unit is configured to acquire the target content based on the value corresponding to the searched key when the target content is searched.
In some optional implementations of some embodiments, the data disaster recovery apparatus 600 for a terminal device may further include a second obtaining unit. Wherein the second acquisition unit is configured to: and when the key value is not searched, sending a value acquisition request to an online key value pair storage system, wherein the value acquisition request comprises the key corresponding to the target content.
It will be understood that the elements described in the apparatus 600 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 600 and the units included therein, and are not described herein again.
Referring now to fig. 7, a schematic diagram of an electronic device (e.g., the server or terminal device of fig. 1) 700 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed from storage 708, or may be installed from ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the apparatus; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: sending target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device; and in response to determining that the number of the target key value pair data stored on the first terminal device exceeds a preset threshold, sending the target key value pair data stored on the first terminal device to an online file storage system. Or when the one or more programs are executed by the electronic device, cause the electronic device to: in response to detecting a transmission fault aiming at target content, searching whether a key corresponding to the target content exists in at least one piece of stored target key value pair data, wherein the at least one piece of target key value pair data is received from a disaster recovery server, and the key and the value in the target key value pair data are generated by the disaster recovery server according to the content presented on the terminal equipment; and when the target content is searched, acquiring the target content based on the value corresponding to the searched key.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first transmission unit and a second transmission unit. Where the names of these units do not in some cases constitute a limitation of the units themselves, for example, the first sending unit may also be described as a "unit sending target key-value pair data to the online key-value pair storage system and the first terminal device".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
According to one or more embodiments of the present disclosure, there is provided a data disaster recovery method, including: sending target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device; in response to determining that the number of the target key value pair data stored on the first terminal device exceeds a preset threshold, sending the target key value pair data stored on the first terminal device to an online file storage system; in response to detecting connection with a second terminal device, selecting target key-value pair data meeting a first predetermined condition from the online file storage system; and encapsulating the selected target key value pair data and then sending the encapsulated target key value pair data to the second terminal equipment.
According to one or more embodiments of the present disclosure, the encapsulating the selected target key value pair data and then sending the encapsulated target key value pair data to the second terminal device includes: encapsulating the selected target key-value pair data into a file, wherein the file comprises: indexing length information, values in the key-value pair data, based on an index of a key in the key-value pair data; and sending the file to the second terminal equipment.
According to one or more embodiments of the present disclosure, the first predetermined condition includes: the hit rate of the key value to the data is larger than a preset threshold value.
According to one or more embodiments of the present disclosure, the target key-value pair data is obtained by: acquiring a key-value pair data set from the first terminal device, wherein the key-value pair data set is screened by the first terminal device from an initial key-value pair data set, and the initial key-value pair data is generated according to content presented on the first terminal device; and screening out key-value pair data meeting a second preset condition from the key-value pair data set to serve as target key-value pair data.
According to one or more embodiments of the present disclosure, there is provided a data disaster recovery apparatus for a server, including: a first sending unit configured to send target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device; a second sending unit configured to send the target key-value pair data stored on the first terminal device to an online file storage system in response to determining that the number of the target key-value pair data stored on the first terminal device exceeds a preset threshold.
According to one or more embodiments of the present disclosure, the data disaster recovery apparatus for a server may further include: a selection unit and a third transmission unit. Wherein the selection unit is configured to: and in response to detecting the connection with the second terminal device, selecting target key-value pair data meeting a first predetermined condition from the online file storage system. The third transmitting unit is configured to: and encapsulating the selected target key value pair data and then sending the encapsulated target key value pair data to the second terminal equipment.
According to one or more embodiments of the present disclosure, the second transmitting unit of the data disaster recovery apparatus for a server may include a sub-encapsulating unit, a sub-transmitting unit, a selecting unit, and an encapsulating unit. Wherein the sub-packaging unit is configured to: and encapsulating the selected target key value pair data into a file. Wherein, the above-mentioned file includes: index length information, values in the key-value pair data, based on an index of a key in the key-value pair data. The sub-transmission unit is configured to: and sending the file to the second terminal equipment. A selection unit configured to select, in response to detection of a connection with the second terminal device, target key-value pair data that meets a first predetermined condition from the online file storage system; and the packaging unit is configured to package the selected target key value pair data and then send the data to the second terminal equipment.
According to one or more embodiments of the present disclosure, the first predetermined condition includes: the hit rate of the key value to the data is larger than a preset threshold value.
According to one or more embodiments of the present disclosure, the target key-value pair data is obtained by: and obtaining a key-value pair data set from the first terminal device, wherein the key-value pair data set is screened by the first terminal device from an initial key-value pair data set, and the initial key-value pair data is generated according to the content presented on the first terminal device. And screening out key-value pair data meeting a second preset condition from the key-value pair data set to serve as target key-value pair data.
According to one or more embodiments of the present disclosure, the second transmitting unit may be further configured to: constructing an index for the target key-value pair data to obtain target key-value pair data comprising the index; and sending the target key value pair data comprising the index to the online file storage system.
According to one or more embodiments of the present disclosure, there is provided a data disaster recovery method for a terminal device, including: in response to detecting a transmission fault aiming at target content, searching whether a key corresponding to the target content exists in at least one piece of stored target key value pair data, wherein the at least one piece of target key value pair data is received from a disaster recovery server, and the key and the value in the target key value pair data are generated by the disaster recovery server according to the content presented on the terminal equipment; and when the target content is searched, acquiring the target content based on the value corresponding to the searched key.
According to one or more embodiments of the present disclosure, the method further includes: and when the key value is not searched, sending a value acquisition request to an online key value pair storage system, wherein the value acquisition request comprises the key corresponding to the target content.
According to one or more embodiments of the present disclosure, there is provided a data disaster recovery apparatus for a terminal device, including: a searching unit configured to search, in response to detecting a transmission failure for a target content, whether a key corresponding to the target content exists in at least one piece of stored target key-value pair data, where the at least one piece of target key-value pair data is received from a disaster recovery server, and keys and values in the target key-value pair data are generated by the disaster recovery server according to content presented on a terminal device; and the first acquisition unit is configured to acquire the target content based on the value corresponding to the searched key when the target content is searched.
According to one or more embodiments of the present disclosure, the data disaster recovery apparatus for a terminal device may further include a second obtaining unit. Wherein the second acquisition unit is configured to: and when the key value is not searched, sending a value acquisition request to an online key value pair storage system, wherein the value acquisition request comprises the key corresponding to the target content.
According to one or more embodiments of the present disclosure, there is provided an electronic device including: one or more processors; a storage device having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to implement a method as described in any of the embodiments above.
According to one or more embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any of the embodiments above.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (11)

1. A data disaster recovery method for a terminal device comprises the following steps:
in response to detecting a transmission fault aiming at target content, searching whether a key corresponding to the target content exists in at least one piece of stored target key-value pair data, wherein the at least one piece of target key-value pair data is received from a disaster recovery server, and the key and the value in the target key-value pair data are generated by the disaster recovery server according to the content presented on the terminal equipment;
and when the target content is searched, acquiring the target content based on the value corresponding to the searched key.
2. The method of claim 1, wherein the method further comprises:
when not found, sending a value acquisition request to an online key-value pair storage system, wherein the value acquisition request comprises the value corresponding to the target content.
3. A data disaster recovery method, comprising:
sending target key-value pair data to an online key-value pair storage system and the first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device;
in response to determining that the number of the target key-value pair data stored on the first terminal device exceeds a preset threshold, sending the target key-value pair data stored on the first terminal device to an online file storage system;
in response to detecting a connection with a second terminal device, selecting target key-value pair data meeting a first predetermined condition from the online file storage system;
and packaging the selected target key value pair data and then sending the packaged target key value pair data to the second terminal equipment.
4. The method of claim 3, wherein the encapsulating the selected target key-value pair data and sending the encapsulated target key-value pair data to the second terminal device comprises:
encapsulating the selected target key-value pair data into a file, wherein the file comprises: indexing length information, values in the key-value pair data, based on an index of a key in the key-value pair data;
and sending the file to the second terminal equipment.
5. The method of claim 3, wherein the first predetermined condition comprises: the hit rate of the key value to the data is larger than a preset threshold value.
6. The method of claim 3, wherein the target key-value pair data is obtained by:
acquiring a key-value pair data set from the first terminal device, wherein the key-value pair data set is screened by the first terminal device from an initial key-value pair data set, and the initial key-value pair data is generated according to content presented on the first terminal device;
and screening out key-value pair data meeting a second preset condition from the key-value pair data set as target key-value pair data.
7. The method of claim 3, wherein said sending target key-value pair data stored on the first terminal device to an online file storage system comprises:
constructing an index for the target key-value pair data to obtain target key-value pair data comprising the index;
and sending the target key-value pair data comprising the index to the online file storage system.
8. A data disaster recovery apparatus for a server, comprising:
a first sending unit configured to send target key-value pair data to an online key-value pair storage system and a first terminal device, wherein keys and values in the target key-value pair data are generated according to content presented on the first terminal device;
a second sending unit configured to send the target key-value pair data stored on the first terminal device to an online file storage system in response to determining that the number of target key-value pair data stored on the first terminal device exceeds a preset threshold;
a selection unit configured to select, in response to detection of a connection with a second terminal device, target key-value pair data that meets a first predetermined condition from the online file storage system;
and the packaging unit is configured to package the selected target key value pair data and then send the data to the second terminal device.
9. A data disaster recovery apparatus for a terminal device, comprising:
the searching unit is configured to search whether a key corresponding to the target content exists in at least one piece of stored target key-value pair data in response to the detection of the transmission fault aiming at the target content, wherein the at least one piece of target key-value pair data is received from the disaster recovery server, and the key and the value in the target key-value pair data are generated by the disaster recovery server according to the content presented on the terminal equipment;
and the first acquisition unit is configured to acquire the target content based on the value corresponding to the searched key when the target content is searched.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-2 or any of claims 3-7.
11. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any of claims 1-2 or 3-7.
CN202011031169.5A 2020-09-27 2020-09-27 Data disaster tolerance method and device, electronic equipment and computer readable medium Pending CN112182002A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011031169.5A CN112182002A (en) 2020-09-27 2020-09-27 Data disaster tolerance method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011031169.5A CN112182002A (en) 2020-09-27 2020-09-27 Data disaster tolerance method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN112182002A true CN112182002A (en) 2021-01-05

Family

ID=73945167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011031169.5A Pending CN112182002A (en) 2020-09-27 2020-09-27 Data disaster tolerance method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112182002A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778034A (en) * 2014-02-26 2014-05-07 广州杰赛科技股份有限公司 Cloud storage-based data backup disaster recovery method and system
CN104836783A (en) * 2014-06-04 2015-08-12 腾讯科技(北京)有限公司 Data transmission method, device and system
CN105468660A (en) * 2014-09-30 2016-04-06 北京金山云网络技术有限公司 Reading method for distributed file system, client device and distributed file system
CN107249135A (en) * 2016-05-31 2017-10-13 杭州海康威视数字技术股份有限公司 Video data storage systems and its operating method and index server
CN110519346A (en) * 2019-08-14 2019-11-29 Oppo(重庆)智能科技有限公司 A kind of method, terminal, server and the computer readable storage medium of data switching
CN110784498A (en) * 2018-07-31 2020-02-11 阿里巴巴集团控股有限公司 Personalized data disaster tolerance method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103778034A (en) * 2014-02-26 2014-05-07 广州杰赛科技股份有限公司 Cloud storage-based data backup disaster recovery method and system
CN104836783A (en) * 2014-06-04 2015-08-12 腾讯科技(北京)有限公司 Data transmission method, device and system
CN105468660A (en) * 2014-09-30 2016-04-06 北京金山云网络技术有限公司 Reading method for distributed file system, client device and distributed file system
CN107249135A (en) * 2016-05-31 2017-10-13 杭州海康威视数字技术股份有限公司 Video data storage systems and its operating method and index server
CN110784498A (en) * 2018-07-31 2020-02-11 阿里巴巴集团控股有限公司 Personalized data disaster tolerance method and device
CN110519346A (en) * 2019-08-14 2019-11-29 Oppo(重庆)智能科技有限公司 A kind of method, terminal, server and the computer readable storage medium of data switching

Similar Documents

Publication Publication Date Title
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN111596991A (en) Interactive operation execution method and device and electronic equipment
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN112256733A (en) Data caching method and device, electronic equipment and computer readable storage medium
CN110650209A (en) Method and device for realizing load balance
CN111966950A (en) Log sending method and device, electronic equipment and computer readable medium
CN111857720A (en) Method and device for generating user interface state information, electronic equipment and medium
CN111858381B (en) Application fault tolerance capability test method, electronic device and medium
CN111628913B (en) Online time length determining method and device, readable medium and electronic equipment
CN114490718A (en) Data output method, data output device, electronic equipment and computer readable medium
CN112203103B (en) Message processing method, device, electronic equipment and computer readable storage medium
CN111625745B (en) Recommendation method, recommendation device, electronic equipment and computer readable medium
CN114035861A (en) Cluster configuration method and device, electronic equipment and computer readable medium
CN113760178A (en) Cache data processing method and device, electronic equipment and computer readable medium
CN112182002A (en) Data disaster tolerance method and device, electronic equipment and computer readable medium
CN112817874A (en) User interface test method, device, equipment and medium
CN113515576A (en) Data processing method and device, electronic equipment and computer readable medium
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN112115154A (en) Data processing and data query method, device, equipment and computer readable medium
CN111782549A (en) Test method and device and electronic equipment
CN112084440B (en) Data verification method, device, electronic equipment and computer readable medium
CN116820354B (en) Data storage method, data storage device and data storage system
CN115374320B (en) Text matching method and device, electronic equipment and computer 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.