CN114036233A - Remote data synchronization method, device, equipment and storage medium - Google Patents

Remote data synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN114036233A
CN114036233A CN202111342519.4A CN202111342519A CN114036233A CN 114036233 A CN114036233 A CN 114036233A CN 202111342519 A CN202111342519 A CN 202111342519A CN 114036233 A CN114036233 A CN 114036233A
Authority
CN
China
Prior art keywords
file
data
data center
text
content
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
CN202111342519.4A
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.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202111342519.4A priority Critical patent/CN114036233A/en
Publication of CN114036233A publication Critical patent/CN114036233A/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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • 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/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a data processing technology, and discloses a remote data synchronization method, which comprises the following steps: extracting preset type source data from a first data center to obtain a target file; extracting the file content and the file structure in the target file by using a pre-constructed traversal service; compressing the text content to obtain a compressed file, and encoding the text content by using a message digest algorithm to obtain an encrypted tag; and transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center. The invention also provides a remote data synchronization device, electronic equipment and a storage medium. The invention can reduce the delay of data when the remote information is synchronized.

Description

Remote data synchronization method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a remote data synchronization method and apparatus, an electronic device, and a computer-readable storage medium.
Background
In order to increase data disaster tolerance, many internet enterprises construct data centers in various countries around the world for synchronously storing some important information, but the data centers are connected by wireless signals and are far away from each other, and the current method mainly performs information transmission by improving the bandwidth of information transmission and by means of information segment transmission.
However, the technical change speed of the bandwidth still cannot keep up with the explosive increase of the data volume, and no matter the bandwidth is occupied in real time or sent in a segmented manner, the data of the source table of one data center cannot be immediately started to be transmitted to another data center after being newly added in batches, so that the data delay still exists.
Disclosure of Invention
The invention provides a remote data synchronization method, a remote data synchronization device and a computer readable storage medium, and mainly aims to solve the problem of high data delay during remote information synchronization.
In order to achieve the above object, the present invention provides a remote data synchronization method, which includes:
extracting preset type source data from a first data center to obtain a target file;
extracting the file content and the file structure in the target file by using a pre-constructed traversal service;
compressing the text content to obtain a compressed file, and encoding the text content by using a message digest algorithm to obtain an encrypted tag;
and transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center.
Optionally, the extracting preset type of source data from the first data center to obtain the target file includes:
monitoring the data updating condition in the first data center in real time by using a preset monitoring service;
and if the first data center generates a new data file, automatically extracting the new data file to obtain the target file.
Optionally, the extracting, by using a pre-constructed traversal service, the file content and the file structure in the target file includes:
traversing and accessing each subfile in the target file by using a pre-constructed traversal service to obtain file content;
analyzing the file type of each subfile to obtain a file type set;
and constructing a hive table according to the file type set by utilizing a pre-constructed Hadoop database tool, and extracting a file structure in the hive table.
Optionally, the encoding the text content by using a message digest algorithm to obtain an encrypted tag includes:
grouping and filling the target files according to a preset configuration strategy to obtain initialization data;
acquiring N pre-constructed official initial values, and performing cyclic calculation on the prediction times of the initialization data by using the official initial values to obtain N encrypted values;
and connecting the N encrypted values according to a preset sequence to obtain the encrypted tag.
Optionally, the compressing the text content to obtain a compressed file includes:
performing corresponding character replacement on the characteristic character strings in the text content by using a preset replacement rule table to obtain a primary compressed file;
and carrying out root node construction operation on the primary compressed file by using a Huffman coding algorithm to obtain the compressed file.
Optionally, after the transmitting the encrypted tag, the compressed file, and the text structure to the second data center by using the access token generated in advance by the second data center, the method further includes:
and at the second data center, decompressing the compressed file into the text structure by using the text encryption label to obtain the restored source data.
Optionally, after the compressed file is decompressed to the text structure by using the text encryption tag and source data corresponding to the compressed file is obtained, the method further includes:
encoding the source data by using a pre-constructed encoder to obtain encoded data;
and segmenting the coded data according to a preset rule to obtain each data block, and performing distributed storage on each data block.
In order to solve the above problem, the present invention further provides a remote data synchronization apparatus, including:
the file acquisition module is used for extracting preset type source data from the first data center to obtain a target file;
the content and structure extraction module is used for extracting file content and a file structure in the target file by utilizing a pre-constructed traversal service;
the compression and encryption module is used for compressing the text content to obtain a compressed file, and coding the text content by using a message digest algorithm to obtain an encryption tag;
and the data transmission module is used for transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the remote data synchronization method described above.
In order to solve the above problem, the present invention also provides a computer-readable storage medium having at least one computer program stored therein, the at least one computer program being executed by a processor in an electronic device to implement the remote data synchronization method described above.
In the embodiment of the invention, the data in the first data center is compressed, the data transmission amount is reduced, the data transmission efficiency is increased, in addition, the file structure of the file content is extracted for transmission, so that the data can be automatically tabulated to store the data when being transmitted to the second data center, the coupling degree of each subfile in the transmitted file can be reserved, the processing time of the second data center for receiving the data can be saved, and the data delay is reduced; finally, the invention encrypts the text content through the message digest algorithm, so that the text content transmitted between the data centers is not decoded. Therefore, the remote data synchronization method, the remote data synchronization device, the electronic equipment and the computer readable storage medium provided by the invention can solve the problem of high data delay during remote information synchronization.
Drawings
Fig. 1 is a schematic flowchart of a remote data synchronization method according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart illustrating a step of a remote data synchronization method according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a remote data synchronization apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device for implementing the remote data synchronization method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a remote data synchronization method. The execution subject of the remote data synchronization method includes, but is not limited to, at least one of electronic devices, such as a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the remote data synchronization method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a remote data synchronization method according to an embodiment of the present invention. In this embodiment, the remote data synchronization method includes:
and S1, extracting preset type source data from the first data center to obtain a target file.
As is known, data centers are used for backing up data, so that disaster tolerance of the data is improved, when an accident occurs in one data center, another data center can still store data of an enterprise, and data transmission under the condition only needs to ensure integrity of the data. However, in another situation, such as when the data application of data center a needs to be put into use immediately after some data collection ground, but the data is actually collected and grounded in data center B, a low-delay data synchronization service between data centers a and B is needed to transfer the data of the data centers for the first time.
In detail, in the embodiment of the present invention, the extracting preset type of source data from a first data center to obtain a target file includes:
monitoring the data updating condition in the first data center in real time by using a preset monitoring service;
and if the first data center generates a new data file, automatically extracting the new data file to obtain the target file.
In the embodiment of the present invention, the monitoring service is an executable program, and is configured to monitor whether a new file exists in a file directory in a database of the first data center.
Specifically, in the embodiment of the present invention, when a folder is newly constructed in the file directory, the monitoring service is executed, and a file in the newly-added folder is extracted as the target file.
And S2, extracting the file content and the file structure in the target file by using the pre-constructed traversal service.
The traversal service is a recursive program that can sequentially access all folders in the target file.
In detail, referring to fig. 2, in the embodiment of the present invention, the extracting the file content and the file structure in the target file by using the pre-constructed traversal service includes:
s21, traversing and accessing each subfile in the target file by using a pre-constructed traversal service to obtain file content;
s22, analyzing the file type of each subfile to obtain a file type set;
s23, constructing a hive table according to the file type set by using a pre-constructed Hadoop database tool, and extracting a file structure in the hive table.
The Hadoop database tool utilized by the embodiment of the invention is hive, and the hive can map the structured data file into a database table and provide an SQL query function.
The invention judges the dependency relationship of each subfile according to the file type of each subfile by using the hive, constructs a hive table containing a file structure according to the dependency relationship of each subfile, and correspondingly stores the file content into the hive table.
S3, compressing the text content to obtain a compressed file, and encoding the text content by using a message digest algorithm to obtain an encrypted tag.
The embodiment of the invention compresses the text content in the hive table, and not only comprises the data of each subfile, but also comprises the upper and lower level relation of the directory among the subfiles.
In detail, in the embodiment of the present invention, the compressing the text content to obtain a compressed file includes:
performing corresponding character replacement on the characteristic character strings in the text content by using a preset replacement rule table to obtain a primary compressed file;
and carrying out root node construction operation on the primary compressed file by using a Huffman coding algorithm to obtain the compressed file.
In the embodiment of the present invention, the rule table is a table constructed according to data commonly used by an enterprise, such as [ Chinese: 00, people: 01, China: 02 … … ]. If a text content is "I am a Chinese font style, I am from Chinese". The compressed encoding is: i am a 0001, I am from 02. The length after compression coding is reduced significantly.
Further, the repeated characters in the primary compressed file can be labeled by using the huffman coding algorithm to obtain the compressed file, for example, the frequency of the character string "aaaaabbbccddd" is used instead of the frequency, and the frequency of the character 'a', b ', c', d 'is respectively' 6 ', 4', 2 ', 3'.
In the embodiment of the invention, by utilizing the Huffman coding algorithm, firstly, the node weights are 6, 4, 2 and 3, and the minimum 2 and 3 are selected to form a combined node with a root node of 5. The current node weights are 6, 4 and 5, and the minimum 4 and 5 are selected to form a combined node with a root node of 9. The current node weights are 6 and 9, and the minimum 6 and 9 are selected to form a combined node with a root node of 15. The current node weight is 15, only one node is needed, and the Huffman tree is established.
The invention wants to obtain the code of each character from the Huffman tree, as long as traversing from the root node to the character node in the Huffman tree, adding a '0' when going to the left, adding a '1' when going to the right, and finally obtaining the character string which is the code character string of the character.
In a word, each character is a primary compressed file with a fixed length through a Huffman coding algorithm, and the primary compressed file is converted into codes with variable lengths of the characters in a left '0' right '1' mode, so that the file volume is further reduced.
Further, in this embodiment of the present invention, the encoding the text content by using a message digest algorithm to obtain an encrypted tag includes:
grouping and filling the target files according to a preset configuration strategy to obtain initialization data;
acquiring N pre-constructed official initial values, and performing cyclic calculation on the prediction times of the initialization data by using the official initial values to obtain N encrypted values;
and connecting the N encrypted values according to a preset sequence to obtain the encrypted tag.
The real-time embodiment of the invention carries out complementation operation on the value of '512' by the original text length (bit) in the target file, when the result of the complementation operation is not equal to '448', the original text needs to be filled, so that the result of complementation of the original text to '512' is equal to 448, wherein the filling method is that the first bit is filled with 1, the rest bits are filled with 0, after the filling is finished, the length of the information is 512 x N +448, then the real length of the original text is recorded by the rest positions (512 x N +448 is 64 bits), the binary value of the length is complemented at the end, and the processed information length is the initialization data of 512 x (N + 1).
The embodiment of the invention further obtains an initial value A, B, C, D from the official website of the message digest algorithm, wherein a is 0x 01234567; b ═ 0x89 ABCDEF; c ═ 0 xfeedcba 98; and D is 0x76543210, then, circularly processing the target file by using the 4 initial values to obtain 4 8-bit 16-system encrypted values, and connecting the 4 encrypted values according to the A, B, C, D sequence to obtain a 32-bit 16-system encrypted tag.
And S4, transmitting the encrypted tag, the compressed file and the text structure to a second data center by using an access token generated in advance by the second data center.
In detail, in this embodiment of the present invention, after the transmitting the encrypted tag, the compressed file, and the text structure to the second data center by using the access token generated in advance by the second data center, the method further includes:
and at the second data center, decompressing the compressed file into the text structure by using the text encryption label to obtain the restored source data.
In the embodiment of the present invention, a program for periodically generating a new access token exists between the second data center and the first data center, so as to ensure that data between the first data center and the second data center is not easily intercepted, and also ensure that information of other devices cannot interfere with the first data center and the second data center.
According to the embodiment of the invention, by extracting the key fields in the access token, such as the effective time and the identity information, when the identity information is matched with the first data center and the effective time is not expired, the access token is judged to be effective, otherwise, the access token is invalid.
Further, in the embodiment of the present invention, in the second data center, a new hive table is automatically constructed according to the text structure transmitted by the second data center, and the same file name as the compressed file is assigned. And the second data center analyzes the file encryption label through a preset decompression tool, judges whether the file encryption label corresponds to the compressed file or not, and does not decompress the compressed file when the file encryption label does not correspond to the compressed file. And when the source file and the source file correspond to each other, decompressing the compressed file into the new hive table to obtain source data corresponding to the compressed file, wherein the content and the structure of the source file are changed.
Further, in this embodiment of the present invention, after the decompressing, by using the text encryption tag, the compressed file into the text structure to obtain the source data corresponding to the compressed file, the method further includes:
encoding the source data by using a pre-constructed encoder to obtain encoded data;
and segmenting the coded data according to a preset rule to obtain each data block, and performing distributed storage on each data block.
In order to ensure that data can be safely stored and is not easy to lose along with time, the embodiment of the invention generally adopts a distributed storage mode to store the source data.
In the embodiment of the invention, source data is converted into coded data by using an encoder, the coded data is encrypted by using an erasure code to obtain an encrypted coded block, the encrypted coded block is cut into blocks according to a specific cutting mode of the erasure code to obtain a plurality of data blocks, and finally the data blocks are stored in each memory of the second data center in a distributed manner, wherein the erasure code is a data protection method and can divide data into segments, expand and encode redundant data blocks and store the redundant data blocks at different positions, such as a disk, a storage node or other network positions.
The embodiment of the application can automatically process the actions from S1 to S4 based on the artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
In summary, the embodiment of the present invention reduces the data transmission amount and increases the data transmission efficiency by compressing the data in the first data center, and in addition, by extracting the file structure of the file content for transmission, the data can be automatically tabulated to store the data when being transmitted to the second data center, which not only can preserve the coupling degree of each subfile in the transmitted file, but also can save the processing time for the second data center to receive the data, and reduce the data delay; finally, the invention encrypts the text content through the message digest algorithm, so that the text content transmitted between the data centers is not decoded. Therefore, the remote data synchronization method provided by the invention can solve the problem of high data delay during remote information synchronization.
Fig. 3 is a functional block diagram of a remote data synchronization apparatus according to an embodiment of the present invention.
The remote data synchronization apparatus 100 of the present invention can be installed in an electronic device. According to the implemented functions, the remote data synchronization device 100 may include a file acquisition module 101, a content and structure extraction module 102, a compression and encryption module 103, and a data transmission module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the file acquisition module 101 is configured to extract preset type source data from the first data center to obtain a target file;
the content and structure extraction module 102 is configured to extract file content and a file structure in the target file by using a pre-constructed traversal service;
the compression and encryption module 103 is configured to compress the text content to obtain a compressed file, and encode the text content by using a message digest algorithm to obtain an encrypted tag;
the data transmission module 104 is configured to transmit the encrypted tag, the compressed file, and the text structure to a second data center by using an access token generated in advance by the second data center.
In detail, when the modules in the remote data synchronization apparatus 100 according to the embodiment of the present invention are used, the same technical means as the remote data synchronization method described in fig. 1 to 2 are adopted, and the same technical effect can be produced, which is not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device implementing a remote data synchronization method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a remote data synchronization program, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (for example, executing a remote data synchronization program and the like) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a remote data synchronization program, etc., but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 4 only shows an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The remote data synchronization program stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, enable:
extracting preset type source data from a first data center to obtain a target file;
extracting the file content and the file structure in the target file by using a pre-constructed traversal service;
compressing the text content to obtain a compressed file, and encoding the text content by using a message digest algorithm to obtain an encrypted tag;
and transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
extracting preset type source data from a first data center to obtain a target file;
extracting the file content and the file structure in the target file by using a pre-constructed traversal service;
compressing the text content to obtain a compressed file, and encoding the text content by using a message digest algorithm to obtain an encrypted tag;
and transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for remote data synchronization, the method comprising:
extracting preset type source data from a first data center to obtain a target file;
extracting the file content and the file structure in the target file by using a pre-constructed traversal service;
compressing the text content to obtain a compressed file, and encoding the text content by using a message digest algorithm to obtain an encrypted tag;
and transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center.
2. The remote data synchronization method of claim 1, wherein the extracting the preset type of source data from the first data center to obtain the target file comprises:
monitoring the data updating condition in the first data center in real time by using a preset monitoring service;
and if the first data center generates a new data file, automatically extracting the new data file to obtain the target file.
3. The remote data synchronization method of claim 1, wherein the extracting the file content and the file structure in the target file by using the pre-built traversal service comprises:
traversing and accessing each subfile in the target file by using a pre-constructed traversal service to obtain file content;
analyzing the file type of each subfile to obtain a file type set;
and constructing a hive table according to the file type set by utilizing a pre-constructed Hadoop database tool, and extracting a file structure in the hive table.
4. The remote data synchronization method of claim 1, wherein said encoding said text content using a message digest algorithm to obtain an encrypted tag comprises:
grouping and filling the target files according to a preset configuration strategy to obtain initialization data;
acquiring N pre-constructed official initial values, and performing cyclic calculation on the prediction times of the initialization data by using the official initial values to obtain N encrypted values;
and connecting the N encrypted values according to a preset sequence to obtain the encrypted tag.
5. The remote data synchronization method of claim 1, wherein the compressing the text content to obtain a compressed file comprises:
performing corresponding character replacement on the characteristic character strings in the text content by using a preset replacement rule table to obtain a primary compressed file;
and carrying out root node construction operation on the primary compressed file by using a Huffman coding algorithm to obtain the compressed file.
6. The remote data synchronization method of claim 1, wherein after transmitting the encryption tag, the compressed file, and the text structure to a second data center using an access token pre-generated by the second data center, further comprising:
and at the second data center, decompressing the compressed file into the text structure by using the text encryption label to obtain the restored source data.
7. The remote data synchronization method according to claim 6, wherein after the decompressing the compressed file into the text structure by using the text encryption tag and obtaining the source data corresponding to the compressed file, the method further comprises:
encoding the source data by using a pre-constructed encoder to obtain encoded data;
and segmenting the coded data according to a preset rule to obtain each data block, and performing distributed storage on each data block.
8. A remote data synchronization apparatus, the apparatus comprising:
the file acquisition module is used for extracting preset type source data from the first data center to obtain a target file;
the content and structure extraction module is used for extracting file content and a file structure in the target file by utilizing a pre-constructed traversal service;
the compression and encryption module is used for compressing the text content to obtain a compressed file, and coding the text content by using a message digest algorithm to obtain an encryption tag;
and the data transmission module is used for transmitting the encrypted tag, the compressed file and the text structure to a second data center by utilizing an access token generated in advance by the second data center.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the remote data synchronization method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a remote data synchronization method according to any one of claims 1 to 7.
CN202111342519.4A 2021-11-12 2021-11-12 Remote data synchronization method, device, equipment and storage medium Pending CN114036233A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111342519.4A CN114036233A (en) 2021-11-12 2021-11-12 Remote data synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111342519.4A CN114036233A (en) 2021-11-12 2021-11-12 Remote data synchronization method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114036233A true CN114036233A (en) 2022-02-11

Family

ID=80137484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111342519.4A Pending CN114036233A (en) 2021-11-12 2021-11-12 Remote data synchronization method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114036233A (en)

Similar Documents

Publication Publication Date Title
CN112671921A (en) Data transmission method and device, electronic equipment and readable storage medium
US8700803B2 (en) Web page optimization
CN103582883A (en) Improved encoding and decoding of variable-length data with group formats
CN112541338A (en) Similar text matching method and device, electronic equipment and computer storage medium
US11070231B2 (en) Reducing storage of blockchain metadata via dictionary-style compression
CN109697277A (en) The method and apparatus of Text compression
CN115408350A (en) Log compression method, log recovery method, log compression device, log recovery device, computer equipment and storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN112256472A (en) Distributed data calling method and device, electronic equipment and storage medium
CN111211887B (en) Resource encryption method, system, device and computer readable storage medium
CN114036233A (en) Remote data synchronization method, device, equipment and storage medium
CN112199374A (en) Data feature mining method aiming at data missing and related equipment thereof
CN116842012A (en) Method, device, equipment and storage medium for storing Redis cluster in fragments
CN108845995B (en) Data processing method, data processing apparatus, storage medium, and electronic apparatus
CN114448930A (en) Short address generation method and device, electronic equipment and computer readable storage medium
CN115827115A (en) H5 page jump method, device, equipment and storage medium of WeChat applet
CN116055144A (en) Data security analysis method, device, equipment and storage based on Internet of things
CN113918517A (en) Multi-type file centralized management method, device, equipment and storage medium
CN114124878A (en) Market data issuing method, device, system, equipment and medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN113672483B (en) Device log storage method and device, electronic device and medium
CN113704557A (en) Front-end resource package compression method and device, electronic equipment and storage medium
CN115002100B (en) File transmission method and device, electronic equipment and storage medium
CN116880778B (en) User privacy protection method based on regenerative coding and distributed storage
CN113868285A (en) Data reading method and device, electronic 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