CN117640663A - Data remote synchronization method, device, equipment and storage medium - Google Patents

Data remote synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN117640663A
CN117640663A CN202311680588.5A CN202311680588A CN117640663A CN 117640663 A CN117640663 A CN 117640663A CN 202311680588 A CN202311680588 A CN 202311680588A CN 117640663 A CN117640663 A CN 117640663A
Authority
CN
China
Prior art keywords
file
data
synchronized
file information
information
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
CN202311680588.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.)
GHT CO Ltd
Original Assignee
GHT 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 GHT CO Ltd filed Critical GHT CO Ltd
Priority to CN202311680588.5A priority Critical patent/CN117640663A/en
Publication of CN117640663A publication Critical patent/CN117640663A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data remote synchronization method, a device, equipment and a storage medium. The method comprises the following steps: the method comprises the steps of physically connecting with a main device; when the first file created by the main equipment is detected, acquiring file information of the first file; wherein the file information includes a file name and a file attribute; creating a second file in the target device according to the file information; receiving data to be synchronized sent by a main device; and storing the data to be synchronized into the local storage module and synchronizing the data to be synchronized into the second file. Through simulating the automatic storage of mobile storage medium and long-range synchronous data, avoided the complex operation that the manual dump data brought, latency subalternation drawback, saved human cost and time cost, reduced the data loss risk that equipment damage brought, through two kinds of working patterns, can use traditional communication protocol and custom communication protocol, the security of reinforcing communication.

Description

Data remote synchronization method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data synchronization technologies, and in particular, to a method, an apparatus, a device, and a storage medium for remotely synchronizing data.
Background
The mobile storage refers to a portable storage device, which is used for storing and transmitting data, and common mobile storage devices include a usb disk, a mobile hard disk, an SD card, a TF card, a Solid State Disk (SSD), and the like. These devices are typically small in size and lightweight, facilitating the transfer and backup of data between different devices by a user. The capacity of the mobile storage device can be selected according to the requirement of a user, the capacity is different from a few GB to a few TB, the user can store data such as files, photos, music, videos and the like in the mobile storage device so as to share and transmit the data among different devices, and meanwhile, the mobile storage device can also be used as a data backup means to protect important data from being lost or damaged accidentally.
The prior art has made many different designs and practices on convenient reading and use of the mobile storage medium, but still needs to use mobile storage devices such as a USB flash disk to store data, then transfers the data in the USB flash disk through a USB flash disk ferrying device, or uses a remote synchronous device to transfer the data stored in the mobile storage medium such as the USB flash disk through a network, and the mobile storage device is very simple and convenient to use, and can read and write the data only by inserting the mobile storage device into a USB interface or a clamping groove of a computer, a mobile phone or other compatible devices, but also has the problems of long time consumption, low safety, high failure rate and the like of dumping the data.
Disclosure of Invention
The technical problems to be solved by the embodiment of the invention are as follows: the remote data synchronization method has the advantages that the labor and time cost is reduced and the safety of equipment and data is improved by means of automatic data synchronization.
In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a data remote synchronization method, including:
the method comprises the steps of physically connecting with a main device;
when detecting that a primary device creates a first file, acquiring file information of the first file; wherein the file information comprises a file name and a file attribute;
creating a second file in the target equipment according to the file information;
receiving data to be synchronized sent by a main device;
and storing the data to be synchronized into a local storage module and synchronizing the data to be synchronized into the second file.
Further, after the physical connection with the master device, the method further includes:
receiving configuration file information of a main device;
and setting file system format and capacity according to the configuration file information.
Further, the configuration file information further includes address information of the target device, and the creating a second file in the target device according to the file information includes:
establishing communication connection with the target equipment according to the address information;
and creating a second file at the target equipment according to the file information.
Further, before the physical connection with the master device, the method further includes:
when the target equipment is a server, a registration message is sent to the server; the server runs on a storage server or computer equipment;
receiving a registration response message sent by a server side, and establishing communication connection with the server side;
and setting file system format, capacity and transmission protocol according to the registration response message.
Further, after receiving the data to be synchronized sent by the master device, the method further includes:
when the residual capacity of the local storage module is larger than or equal to the size of the data to be synchronized, directly storing the data to be synchronized into the local storage module;
and when the residual capacity of the local storage module is smaller than the size of the data to be synchronized, deleting part of the data in the local storage module according to a preset rule, and storing the data to be synchronized into the local storage module.
In order to solve the above technical problem, in a second aspect, an embodiment of the present invention provides a data remote synchronization device, including:
the main equipment connecting module is used for physically connecting with the main equipment;
the file acquisition module is used for acquiring file information of a first file when detecting that the main equipment creates the first file; wherein the file information comprises a file name and a file attribute;
the file creation module is used for creating a second file in the target equipment according to the file information;
the data receiving module is used for receiving the data to be synchronized sent by the main equipment;
and the remote synchronization module is used for storing the data to be synchronized into the local storage module and synchronizing the data to be synchronized into the second file.
Further, after the physical connection with the master device, the method further includes:
receiving configuration file information of a main device;
and setting file system format and capacity according to the configuration file information.
Further, the configuration file information further includes address information of the target device, and the file creating module includes:
establishing communication connection with the target equipment according to the address information;
and creating a second file at the target equipment according to the file information.
In order to solve the above technical problem, in a third aspect, an embodiment of the present invention provides an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program;
wherein the processor, when executing the computer program, implements the data remote synchronization method of any one of the above first aspects.
In order to solve the above technical problem, according to a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing a computer program, where the computer program is executed to implement the data remote synchronization method according to any one of the first aspect.
Compared with the prior art, the data remote synchronization method provided by the embodiment has the beneficial effects that: through simulating the automatic storage of mobile storage medium and long-range synchronous data, avoided the complex operation that the manual dump data brought, latency subalternation drawback, saved human cost and time cost, reduced the data loss risk that equipment damage brought, through two kinds of working patterns, can use traditional communication protocol and custom communication protocol, the security of reinforcing communication.
Drawings
In order to more clearly illustrate the technical features of the embodiments of the present invention, the drawings that are required to be used in the embodiments of the present invention will be briefly described below, and it is apparent that the drawings described below are only some embodiments of the present invention and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for remotely synchronizing data;
FIG. 2 is a schematic flow chart of an independent operation mode in a data remote synchronization method provided by the invention;
FIG. 3 is a schematic flow chart of a client server mode in the data remote synchronization method provided by the invention;
FIG. 4 is a schematic diagram of a remote data synchronization device according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In a first aspect, an embodiment of the present invention provides a data remote synchronization method, and referring to fig. 1, a schematic flow chart of the data remote synchronization method provided by the embodiment of the present invention is shown.
As shown in fig. 1, the method comprises the steps of:
s1: the method comprises the steps of physically connecting with a main device;
s2: when detecting that a primary device creates a first file, acquiring file information of the first file; wherein the file information comprises a file name and a file attribute;
s3: creating a second file in the target equipment according to the file information;
s4: receiving data to be synchronized sent by a main device;
s5: and storing the data to be synchronized into a local storage module and synchronizing the data to be synchronized into the second file. In a specific implementation, referring to fig. 2, a schematic diagram of an independent operation mode in a data remote synchronization method provided by the invention is shown, and a master device is a sender of data remote synchronization, and establishes physical connection with the master device through a mobile interface when the master device operates in the independent operation mode; the main device includes, but is not limited to, a computer, a driving recording instrument or a monitoring camera, and the mobile interface can use a common mobile storage device interface such as USB, TF, SD, or can use an interface such as M.2, SATA, PCIE, etc.; after the physical connection is established, the data transmission can be carried out with the main equipment, the main equipment can carry out early preparation before writing data, a first file is firstly established, and when the first file established by the main equipment is detected, the file information of the first file is obtained, wherein the file information comprises a file name and a file attribute; creating a second file at a target device by using the acquired file information, wherein the target device is a receiving party for data remote synchronization; after receiving the data to be synchronized written into the first file by the master device, storing the data to be synchronized into a local storage module, performing encapsulation processing according to a transmission protocol, and finally transmitting the data to be synchronized into the second file, wherein the transmission mode can adopt wired communication, wireless communication or encrypted communication, and the used communication protocol includes but is not limited to SSH, SFTP, FTP, HTTP, HTTPS.
In summary, the embodiment of the invention automatically stores and remotely synchronizes the data by simulating the mobile storage medium, thereby avoiding the defects of complex operation, long waiting time and the like caused by manually dumping the data, saving labor cost and time cost, and reducing the data loss risk caused by equipment damage.
In a preferred embodiment, step S1 is followed by:
s11: receiving configuration file information of a main device;
s12: and setting file system format and capacity according to the configuration file information.
Specifically, the configuration file sent by the main equipment is received, the configuration file is used for configuration, parameters of the configuration file can be modified according to actual requirements, and different file system formats and capacities are set; among them, file system formats include, but are not limited to, NTFS, EXT4, EXT3, EXT2, eFAT, FAT32, etc., and capacity settings may not exceed the physical upper limit of the hardware itself.
In a preferred embodiment, the configuration file information further includes address information of the target device, and step S3 includes:
s31: establishing communication connection with the target equipment according to the address information;
s32: and creating a second file at the target equipment according to the file information.
Specifically, address information of the target device is stored in a configuration file in advance, after the configuration file of the main device is received, the address information of the target device is acquired, communication connection is established with the target device according to the address information, and a second file is created in the target device according to the acquired file information of the first file.
In a preferred embodiment, step S1 is preceded by:
s101: when the target equipment is a server, a registration message is sent to the server; the server runs on a storage server or computer equipment;
s102: receiving a registration response message sent by a server side, and establishing communication connection with the server side;
s103: and setting file system format, capacity and transmission protocol according to the registration response message.
For example, referring to fig. 3, a schematic diagram of a client server mode in a data remote synchronization method provided by the present invention is shown, before a physical connection is performed between the client server mode and a host device, if the client server mode is running, that is, when a target device is a server, a communication connection needs to be established with the server, the server runs on a storage server or a computer device, a registration message is sent to the server, and the registration message is used to inform the server of its own status information, so as to be used for authentication, negotiation of a transmission protocol, establishment of a secure connection, subsequent data transmission, and the like, where the registration message includes a serial number of the client, a supported transmission protocol, a storage capacity, and the like; after the registration message is sent, a registration response message sent by the server is received, wherein the registration response message is a reply to the registration message of the client, and if the registration is successful, the registration response message carries information such as a protocol used for transmission, a safety link, a port number used for transmission, capacity and the like; after successful registration, communication connection is established with the server, and file system format, capacity and transmission protocol are set according to the registration response message.
Further, after the server creates the second file, the data to be synchronized is written into the second file, where the storage device or path in which the data to be synchronized is stored in the second file is determined by the configuration file in the server, the data may be directly stored in the storage device of the storage server or the computer device, such as a hard disk, a solid state disk, etc., if the data needs to be transmitted to other addresses, and a data forwarding module may be added to the server to transmit the data, where the communication transmission protocol used includes, but is not limited to SSH, SFTP, FTP, HTTP, HTTPS.
It should be noted that, when operating in the client server mode, the server is also responsible for controlling and managing the client, which specifically includes: verifying the legality of the client, and verifying whether the client is legal or not according to the physical information carried during the registration of the client, and whether the client is allowed to be registered to the server or not; configuring a client according to configuration information of a server, and setting file system format, capacity, transmission protocol, port number and the like of the client; controlling data transmission of a client; restarting the client; and counting transmission information of the client, wherein the transmission information comprises the number of transmitted files, the total size of the files, the current transmission rate and the like.
In a preferred embodiment, step S4 is followed by:
s41: when the residual capacity of the local storage module is larger than or equal to the size of the data to be synchronized, directly storing the data to be synchronized into the local storage module;
s42: and when the residual capacity of the local storage module is smaller than the size of the data to be synchronized, deleting part of the data in the local storage module according to a preset rule, and storing the data to be synchronized into the local storage module.
Specifically, after receiving data to be synchronized sent by a master device, the data to be synchronized can be stored in a local storage module, firstly, the residual capacity of the local storage module and the size of the data to be synchronized are judged, and when the residual capacity of the local storage module is greater than or equal to the size of the data to be synchronized, the data to be synchronized is directly stored in the local storage module; when the residual capacity of the local storage module is smaller than the size of the data to be synchronized, part of the data in the local storage module can be deleted according to a preset replacement rule, so that the deleted residual capacity is larger than or equal to the size of the data to be synchronized, and the data to be synchronized is stored in the local storage module.
In a second aspect, an embodiment of the present invention provides a data remote synchronization device, and referring to fig. 4, a schematic structural diagram of the data remote synchronization device provided in the embodiment of the present invention is shown.
As shown in fig. 4, the apparatus includes:
a master device connection module 41 for physically connecting with a master device;
a file obtaining module 42, configured to obtain file information of a first file when detecting that a master device creates the first file; wherein the file information comprises a file name and a file attribute;
a file creation module 43 for creating a second file at the target device according to the file information;
a data receiving module 44, configured to receive data to be synchronized sent by the master device;
and the remote synchronization module 45 is configured to store the data to be synchronized in the local storage module and synchronize the data to be synchronized in the second file.
In a preferred embodiment, the method further comprises the steps of: receiving configuration file information of a main device; and setting file system format and capacity according to the configuration file information.
In a preferred embodiment, the configuration file information further includes address information of the target device, and the file creating module 43 includes:
establishing a communication connection unit: establishing communication connection with the target equipment according to the address information;
creating a second file unit: and creating a second file at the target equipment according to the file information.
In a preferred embodiment, step S1 is preceded by: when the target equipment is a server, a registration message is sent to the server; the server runs on a storage server or computer equipment; receiving a registration response message sent by a server side, and establishing communication connection with the server side; and setting file system format, capacity and transmission protocol according to the registration response message.
In a preferred embodiment, step S4 is followed by: when the residual capacity of the local storage module is larger than or equal to the size of the data to be synchronized, directly storing the data to be synchronized into the local storage module; and when the residual capacity of the local storage module is smaller than the size of the data to be synchronized, deleting part of the data in the local storage module according to a preset rule, and storing the data to be synchronized into the local storage module.
It should be noted that, the data remote synchronization device provided by the embodiment of the present invention can implement all the processes of the data remote synchronization method described in any one of the embodiments, and the functions and the implemented technical effects of each module and unit in the device are respectively the same as those of the data remote synchronization method described in the embodiment, and are not repeated herein.
In a third aspect, an embodiment of the present invention provides an electronic device, and referring to fig. 5, a schematic structural diagram of the electronic device is provided.
As shown in fig. 5, the apparatus includes:
a memory 51 for storing a computer program;
a processor 52 for executing the computer program;
wherein the processor 52, when executing the computer program, implements a data remote synchronization method as described in any of the embodiments above.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 52 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program in the electronic device.
The processor 52 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be used to store the computer program and/or module, and the processor 52 may implement various functions of the electronic device by running or executing the computer program and/or module stored in the memory 51, and invoking data stored in the memory 51. The memory 51 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory 51 may include a high-speed random access memory, and may further include a nonvolatile memory such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid-state storage device.
It should be noted that the above electronic device includes, but is not limited to, a processor, a memory, and those skilled in the art will understand that the schematic structural diagram of fig. 5 is merely an example of the above electronic device, and does not limit the electronic device, and may include more components than those illustrated, or some components may be combined, or different components may be combined.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed to implement the data remote synchronization method according to any one of the foregoing embodiments.
While the invention has been described with reference to the preferred embodiments, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for remotely synchronizing data, comprising:
the method comprises the steps of physically connecting with a main device;
when detecting that a primary device creates a first file, acquiring file information of the first file; wherein the file information comprises a file name and a file attribute;
creating a second file in the target equipment according to the file information;
receiving data to be synchronized sent by a main device;
and storing the data to be synchronized into a local storage module and synchronizing the data to be synchronized into the second file.
2. The method for remotely synchronizing data according to claim 1, further comprising, after said physically connecting to the master device:
receiving configuration file information of a main device;
and setting file system format and capacity according to the configuration file information.
3. The method for remotely synchronizing data according to claim 2, wherein the configuration file information further includes address information of the target device, and wherein creating the second file at the target device according to the file information includes:
establishing communication connection with the target equipment according to the address information;
and creating a second file at the target equipment according to the file information.
4. The method for remotely synchronizing data according to claim 1, further comprising, prior to said physically connecting with the master device:
when the target equipment is a server, a registration message is sent to the server; the server runs on a storage server or computer equipment;
receiving a registration response message sent by a server side, and establishing communication connection with the server side;
and setting file system format, capacity and transmission protocol according to the registration response message.
5. The method for remotely synchronizing data according to claim 1, further comprising, after receiving the data to be synchronized transmitted by the master device:
when the residual capacity of the local storage module is larger than or equal to the size of the data to be synchronized, directly storing the data to be synchronized into the local storage module;
and when the residual capacity of the local storage module is smaller than the size of the data to be synchronized, deleting part of the data in the local storage module according to a preset rule, and storing the data to be synchronized into the local storage module.
6. A data remote synchronization device, comprising:
the main equipment connecting module is used for physically connecting with the main equipment;
the file acquisition module is used for acquiring file information of a first file when detecting that the main equipment creates the first file; wherein the file information comprises a file name and a file attribute;
the file creation module is used for creating a second file in the target equipment according to the file information;
the data receiving module is used for receiving the data to be synchronized sent by the main equipment;
and the remote synchronization module is used for storing the data to be synchronized into the local storage module and synchronizing the data to be synchronized into the second file.
7. The data remote synchronization apparatus of claim 6, wherein after the physical connection with the master device, further comprising:
receiving configuration file information of a main device;
and setting file system format and capacity according to the configuration file information.
8. The data remote synchronization apparatus of claim 7, wherein the configuration file information further includes address information of the target device, and the file creation module includes:
establishing communication connection with the target equipment according to the address information;
and creating a second file at the target equipment according to the file information.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program;
wherein the processor, when executing the computer program, implements the data remote synchronization method according to any one of claims 1 to 5.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed, implements the data remote synchronization method according to any one of claims 1 to 5.
CN202311680588.5A 2023-12-07 2023-12-07 Data remote synchronization method, device, equipment and storage medium Pending CN117640663A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311680588.5A CN117640663A (en) 2023-12-07 2023-12-07 Data remote synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311680588.5A CN117640663A (en) 2023-12-07 2023-12-07 Data remote synchronization method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117640663A true CN117640663A (en) 2024-03-01

Family

ID=90018103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311680588.5A Pending CN117640663A (en) 2023-12-07 2023-12-07 Data remote synchronization method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117640663A (en)

Similar Documents

Publication Publication Date Title
EP3082353B1 (en) Method and terminal device for sending and receiving user data
EP2566286B1 (en) Wireless Internet Access Module, Communication Method for Host and Wireless Internet Access Module, and Data Card
KR101190426B1 (en) Synchronizati0n methods and systems
CN104737135B (en) The information processing terminal and synchronisation control means
CN103377689B (en) Storage device and wireless communication control method thereof
US20190087283A1 (en) Aircraft aerial photography data backup method, apparatus and device, and computer readable storage medium
US10681115B2 (en) Multimedia data transmission method and device
WO2015106511A1 (en) Method and device for mobile terminal virtual storage
WO2021147793A1 (en) Data processing method, apparatus and system, electronic device and computer storage medium
WO2017097106A1 (en) Method and apparatus for transmitting file difference
CN103369034A (en) Method, system and device for sending photos to digital photo frames
CN104580425A (en) Client data synchronization method and system
CN104065742A (en) Picking-up person information processing method and device for safe kindergarten picking up
WO2015117356A1 (en) Start-up method and communication terminal
WO2016026291A1 (en) Wireless data card, communication system, data synchronization method and computer storage medium
WO2018001054A1 (en) Method and device for synchronizing cloud desktop data
CN117640663A (en) Data remote synchronization method, device, equipment and storage medium
WO2012131531A1 (en) Memory card having extended data storage functionality
CN102932513B (en) A kind of business card maintaining method, device and equipment
CN111143899A (en) Method and device for storing data, storage medium and electronic device
CN108182292B (en) Log file processing method and device applied to intelligent sound box and intelligent sound box
CN111984459B (en) Apple ID account removing method and system
KR20070028960A (en) Mobile communication terminal transmitting data and its operating method
CN109831762B (en) POS data communication method, device, terminal equipment and system
KR101699159B1 (en) Communication apparatus, virtual file system module comprised in the communication apparatus, control method thereof, and recording medium for recording program for executing the control method, application saved in the recording medium for executing the control method being combined with hardware

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