CN106569913A - Method and device for terminal backup data - Google Patents
Method and device for terminal backup data Download PDFInfo
- Publication number
- CN106569913A CN106569913A CN201610957882.XA CN201610957882A CN106569913A CN 106569913 A CN106569913 A CN 106569913A CN 201610957882 A CN201610957882 A CN 201610957882A CN 106569913 A CN106569913 A CN 106569913A
- Authority
- CN
- China
- Prior art keywords
- backup
- backup data
- data
- terminal
- cache space
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000005540 biological transmission Effects 0.000 claims abstract description 56
- 239000000872 buffer Substances 0.000 claims description 24
- 238000004590 computer program Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000013508 migration Methods 0.000 description 2
- 230000005012 migration Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
本发明实施例公开了一种终端备份数据的方法及装置,所述方法包括:获取备份终端的剩余存储空间的容量大小和备份速度,检测所述备份终端对目标终端的传输速度;计算所述备份速度与所述传输速度的比值,根据所述比值和所述剩余存储空间的容量大小确定第一缓存空间的大小;将待备份数据写入所述第一缓存空间,确定所述第一缓存空间中包含的数据为第一备份数据包;当第一备份数据包达到所述第一缓存空间大小时,将所述第一备份数据包传输到所述目标终端。采用本发明实施例,可提高数据备份的效率和存储空间的利用率。
The embodiment of the present invention discloses a method and device for backing up data at a terminal, the method comprising: obtaining the capacity of the remaining storage space and the backup speed of the backup terminal, detecting the transmission speed of the backup terminal to the target terminal; calculating the ratio of the backup speed to the transmission speed, and determining the size of the first cache space according to the ratio and the capacity of the remaining storage space; writing the data to be backed up into the first cache space, determining that the data contained in the first cache space is the first backup data packet; when the first backup data packet reaches the size of the first cache space, transmitting the first backup data packet to the target terminal. The embodiment of the present invention can improve the efficiency of data backup and the utilization rate of storage space.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种终端备份数据的方法及装置。The invention relates to the field of communication technology, in particular to a method and device for backing up data by a terminal.
背景技术Background technique
随着移动终端互联网应用的飞速发展和普及,人们拥有的终端设备的种类也越来越多,例如,手机、平板或电脑等其它终端,且终端的更换换代愈加频繁,而终端上存储着通讯录、个人日程、图库、短信、备忘录和聊天记录等等相关数据。为了防止这些重要数据丢失,需要对备份终端的这些数据进行数据备份,然后传输到目标终端上。With the rapid development and popularization of mobile terminal Internet applications, people have more and more types of terminal equipment, such as mobile phones, tablets or computers and other terminals, and the replacement of terminals is more frequent, and the terminal stores communication Records, personal schedule, gallery, text messages, memos and chat records and other related data. In order to prevent the loss of these important data, it is necessary to perform data backup on the data of the backup terminal, and then transmit it to the target terminal.
在相关技术方案中,将备份终端的数据备份到本地的缓存空间,然后将备份数据传输给目标终端,目标终端接收到数据后进行恢复。对于一般的终端来说,存储容量是非常有限的。如果备份终端剩余的存储空间的容量不足,会导致数据从备份终端迁移到目标终端上失败,从而导致数据的丢失。In a related technical solution, the data of the backup terminal is backed up to a local cache space, and then the backup data is transmitted to the target terminal, and the target terminal restores the data after receiving the data. For general terminals, the storage capacity is very limited. If the capacity of the remaining storage space of the backup terminal is insufficient, data migration from the backup terminal to the target terminal will fail, resulting in data loss.
发明内容Contents of the invention
本发明实施例提出了一种终端备份数据的方法,可以解决备份终端剩余的存储空间的容量不足导致数据丢失的问题。The embodiment of the present invention proposes a method for backing up data by a terminal, which can solve the problem of data loss due to insufficient capacity of the remaining storage space of the backup terminal.
一种终端备份数据的方法,包括:A method for terminal backup data, comprising:
获取备份终端的剩余存储空间的容量大小和备份速度,检测所述备份终端对目标终端的传输速度;Obtain the capacity and backup speed of the remaining storage space of the backup terminal, and detect the transmission speed of the backup terminal to the target terminal;
计算所述备份速度与所述传输速度的比值,根据所述比值和所述剩余存储空间的容量大小确定第一缓存空间的大小;calculating the ratio of the backup speed to the transmission speed, and determining the size of the first cache space according to the ratio and the capacity of the remaining storage space;
将待备份数据写入所述第一缓存空间,确定所述第一缓存空间中包含的数据为第一备份数据包;writing the data to be backed up into the first cache space, and determining that the data contained in the first cache space is the first backup data package;
当第一备份数据包达到所述第一缓存空间大小时,将所述第一备份数据包传输到所述目标终端。在其中一个实施例中,所述方法还包括:在所述第一备份数据包传输到所述目标终端完成时,清空所述第一缓存空间。When the first backup data packet reaches the size of the first buffer space, the first backup data packet is transmitted to the target terminal. In one of the embodiments, the method further includes: clearing the first buffer space when the transmission of the first backup data packet to the target terminal is completed.
在其中一个实施例中,所述将所述第一备份数据包传输到所述目标终端包括:根据所述比值和所述剩余存储空间的容量大小确定第二缓存空间的大小,且所述第二缓存空间与所述第一缓存空间无交集;在传输所述第一备份数据包时,将第一备份数据包以外的至少一部分待备份数据写入所述第二缓存空间,确定所述第二缓存空间中包含的数据为第二备份数据包。In one of the embodiments, the transmitting the first backup data packet to the target terminal includes: determining the size of the second cache space according to the ratio and the capacity of the remaining storage space, and the first The second cache space has no intersection with the first cache space; when transmitting the first backup data packet, at least a part of the data to be backed up other than the first backup data packet is written into the second cache space, and the second cache space is determined. The data contained in the second buffer space is the second backup data package.
在其中一个实施例中,所述方法还包括:在所述将所述第一备份数据包传输到所述目标终端完成之后,传输所述第二备份数据包到所述目标终端。In one of the embodiments, the method further includes: transmitting the second backup data packet to the target terminal after the transmission of the first backup data packet to the target terminal is completed.
在其中一个实施例中,所述将待备份数据写入所述第一缓存空间之前还包括:检测选中备份数据类型指令,将所述选中备份数据类型指令对应的所述待备份数据写入所述第一缓存空间。In one of the embodiments, before writing the data to be backed up into the first cache space, it further includes: detecting the instruction of the selected backup data type, and writing the data to be backed up corresponding to the instruction of the selected backup data type into the The first cache space.
此外,还提出了一种终端备份数据的装置。In addition, a terminal backup data device is also proposed.
一种终端备份数据的装置,包括:A device for backing up data at a terminal, comprising:
参数获取模块,用于获取备份终端的剩余存储空间的容量大小和备份速度,检测所述备份终端对目标终端的传输速度;A parameter acquisition module, configured to acquire the capacity and backup speed of the remaining storage space of the backup terminal, and detect the transmission speed of the backup terminal to the target terminal;
缓存空间确定模块,用于计算所述备份速度与所述传输速度的比值,根据所述比值和所述剩余存储空间的容量大小确定第一缓存空间的大小;A cache space determination module, configured to calculate the ratio of the backup speed to the transmission speed, and determine the size of the first cache space according to the ratio and the capacity of the remaining storage space;
备份数据确定模块,用于将待备份数据写入所述第一缓存空间,确定所述第一缓存空间中包含的数据为第一备份数据包;A backup data determination module, configured to write the data to be backed up into the first cache space, and determine that the data contained in the first cache space is the first backup data package;
备份数据发送模块,用于当第一备份数据包达到所述第一缓存空间大小时,将所述第一备份数据包传输到所述目标终端。A backup data sending module, configured to transmit the first backup data packet to the target terminal when the first backup data packet reaches the size of the first buffer space.
在其中一个实施例中,所述装置还包括缓存空间清空模块,用于在所述第一备份数据包传输到所述目标终端完成时,清空所述第一缓存空间。In one of the embodiments, the device further includes a buffer space clearing module, configured to clear the first buffer space when the transmission of the first backup data packet to the target terminal is completed.
在其中一个实施例中,所述缓存空间确定模块还用于根据所述比值和所述剩余存储空间的容量大小确定第二缓存空间的大小,且所述第二缓存空间与所述第一缓存空间无交集;所述备份数据确定模块还用于在传输所述第一备份数据包时,将第一备份数据包以外的至少一部分待备份数据写入所述第二缓存空间,确定所述第二缓存空间中包含的数据为第二备份数据包。In one of the embodiments, the cache space determination module is further configured to determine the size of the second cache space according to the ratio and the capacity of the remaining storage space, and the second cache space is the same as the first cache space The space has no intersection; the backup data determination module is also used to write at least a part of the data to be backed up other than the first backup data packet into the second cache space when transmitting the first backup data packet, and determine the second The data contained in the second buffer space is the second backup data package.
在其中一个实施例中,所述备份数据发送模块还用于在所述将所述第一备份数据包传输到所述目标终端完成之后,传输所述第二备份数据包到所述目标终端。在其中一个实施例中,所述装置还包括优选备份数据确定模块,用于检测选中备份数据类型指令,将所述选中备份数据类型指令对应的所述待备份数据写入所述第一缓存空间。In one of the embodiments, the backup data sending module is further configured to transmit the second backup data packet to the target terminal after the transmission of the first backup data packet to the target terminal is completed. In one of the embodiments, the device further includes a preferred backup data determination module, configured to detect a selected backup data type instruction, and write the data to be backed up corresponding to the selected backup data type instruction into the first cache space .
采用了上述终端备份数据的方法及系统之后,获取备份终端的剩余存储容量的容量大小和备份速度,检测备份终端和目标终端之间的传输速度,从而确定第一缓存空间的大小,然后将待备份数据写入第一缓存空间确定第一备份数据包,最后当第一备份数据包达到所述第一缓存空间大小时,将第一备份数据包传输给目标移动终端,解决了在有限的备份终端上将所有待备份数据传输给目标终端失败的问题,且由备份速度和传输速度的比值和剩余存储容量的容量大小将待备份数据分成多份,使得传输过程和备份过程同时进行,从而提高数据备份的效率和存储空间的利用率。After adopting the above-mentioned method and system for backing up data by a terminal, obtain the capacity and backup speed of the remaining storage capacity of the backup terminal, detect the transmission speed between the backup terminal and the target terminal, thereby determine the size of the first buffer space, and then store the The backup data is written into the first buffer space to determine the first backup data packet, and finally when the first backup data packet reaches the size of the first buffer space, the first backup data packet is transmitted to the target mobile terminal, which solves the problem of limited backup The terminal fails to transmit all the data to be backed up to the target terminal, and the data to be backed up is divided into multiple parts according to the ratio of the backup speed to the transmission speed and the size of the remaining storage capacity, so that the transmission process and the backup process are carried out at the same time, thereby improving Data backup efficiency and storage space utilization.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
其中:in:
图1为本发明实施例提供的一种终端备份数据的方法的流程图;FIG. 1 is a flow chart of a method for terminal backup data provided by an embodiment of the present invention;
图2为本发明实施例提供的一种终端备份数据的过程示意图;FIG. 2 is a schematic diagram of a terminal backup data process provided by an embodiment of the present invention;
图3为本发明实施例提供的一种终端选中待备份数据的应用场景示意图;FIG. 3 is a schematic diagram of an application scenario in which a terminal selects data to be backed up according to an embodiment of the present invention;
图4为本发明实施例提供的一种终端备份数据的装置的结构图;FIG. 4 is a structural diagram of an apparatus for backing up data at a terminal provided by an embodiment of the present invention;
图5为一个实施例中运行终端备份数据的方法的计算机设备的结构示意图。Fig. 5 is a schematic structural diagram of a computer device running a method for backing up data at a terminal in an embodiment.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。此外,术语“第一”、“第二”和“第三”等是用于区别不同的对象,而并非用于描述特定的顺序。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention. In addition, the terms "first", "second", and "third", etc. are used to distinguish different objects, and are not used to describe a specific order.
在一个实施例中,提出了一种终端备份数据的方法。该方法的实现可依赖于计算机程序,该计算机程序可运行于基于冯诺依曼体系的计算机系统之上,该计算机程序涉及备份终端和与备份终端进行通信连接的目标终端,备份终端和目标终端包括但不限于智能手机、平板电脑、掌上电脑,笔记本电脑或个人电脑等等终端设备。该计算机程序可以是终端上的备份软件中的一个独立的应用,也可以是基于备份软件应用开发的功能选项或应用插件,可安装在运行IOS、Android、Windows Phone等操作系统的终端设备中。In one embodiment, a method for backing up data by a terminal is provided. The implementation of the method may rely on a computer program, the computer program may run on a computer system based on the Von Neumann architecture, the computer program involves a backup terminal and a target terminal communicating with the backup terminal, the backup terminal and the target terminal Including but not limited to smart phones, tablets, handheld computers, laptops or personal computers and other terminal devices. The computer program can be an independent application in the backup software on the terminal, or it can be a function option or application plug-in developed based on the backup software application, and can be installed in terminal devices running IOS, Android, Windows Phone and other operating systems.
具体的,如图1所示,一种终端备份数据的方法,包括:Specifically, as shown in Figure 1, a method for terminal backup data includes:
步骤S102:获取备份终端的剩余存储空间的容量大小和备份速度,检测所述备份终端对目标终端的传输速度;Step S102: Obtain the capacity and backup speed of the remaining storage space of the backup terminal, and detect the transmission speed of the backup terminal to the target terminal;
智能手机、平板电脑、掌上电脑,笔记本电脑或个人电脑等等终端之间的传输方式可采用蓝牙或红外、Wi-Fi或数据流量、数据线连接硬件存储设备如硬盘或者U盘等。传输速度依赖于传输介质和待传输的数据容量大小,例如硬盘的传输速度明显快于U盘,Wi-Fi的传输速度比数据流量的传输速度快。Smartphones, tablet computers, handheld computers, laptops or personal computers can be transmitted between terminals such as Bluetooth or infrared, Wi-Fi or data traffic, data cables connected to hardware storage devices such as hard disks or U disks, etc. The transmission speed depends on the transmission medium and the size of the data to be transmitted. For example, the transmission speed of a hard disk is significantly faster than that of a USB flash drive, and the transmission speed of Wi-Fi is faster than that of data traffic.
需要说明的是,传输的网络状态可以是Wi-Fi情况下,也可以是2G\3G\4G等数据流量的情况,为了节省用户流量的使用量,减少不必要的资费浪费,可在终端设备设置仅在Wi-Fi情况下进行备份。It should be noted that the transmission network status can be in the case of Wi-Fi, or in the case of 2G\3G\4G data traffic. Settings are only backed up over Wi-Fi.
步骤S104:计算所述备份速度与所述传输速度的比值,根据所述比值和所述剩余存储空间的容量大小确定第一缓存空间的大小;Step S104: Calculate the ratio of the backup speed to the transmission speed, and determine the size of the first cache space according to the ratio and the capacity of the remaining storage space;
备份和传输都需要一定的时间,为了节省传输的时间和避免因为待备份数据的存储容量大于备份终端的存储容量造成的备份失败,可将待备份数据分成多个特定大小的数据包,备份完成一个数据包即可写入目标终端,从而加快传输的过程。Both backup and transmission take a certain amount of time. In order to save transmission time and avoid backup failure caused by the storage capacity of the data to be backed up is greater than the storage capacity of the backup terminal, the data to be backed up can be divided into multiple data packets of a specific size, and the backup is complete. A data packet can be written to the target terminal, thus speeding up the transfer process.
备份速度通常会快于传输速度,且备份速度与传输速度的比值可以为整数,也可以为小数,小数采用四舍五入的方式、小数向下取整或者小数向上取整等等方式取整。根据计算得到的备份速度与传输速度的比值和剩余存储空间的容量大小,将剩余存储空间分成至少两个缓存空间,且缓存空间之间不交叠。可以理解的是,缓存空间的容量大小设备的越小,则备份的总时长越短,从而提高了备份数据的效率和存储空间的利用率。The backup speed is usually faster than the transmission speed, and the ratio of the backup speed to the transmission speed can be an integer or a decimal, and the decimal is rounded up, rounded down or rounded up, etc. According to the calculated ratio of the backup speed to the transmission speed and the capacity of the remaining storage space, the remaining storage space is divided into at least two cache spaces, and the cache spaces do not overlap. It can be understood that the smaller the capacity of the cache space is, the shorter the total backup time is, thereby improving the efficiency of backup data and the utilization rate of storage space.
举例来说,原始移动终端的剩余空间是1G,传输速度较快如10M/s,备份速度也是20M/s,则传输速度和备份数据的比值为2,缓存空间的容量大小可设置为300M。For example, the remaining space of the original mobile terminal is 1G, the transmission speed is faster such as 10M/s, and the backup speed is also 20M/s, then the ratio of the transmission speed to the backup data is 2, and the capacity of the cache space can be set to 300M.
步骤S106:将待备份数据写入所述第一缓存空间,确定所述第一缓存空间中包含的数据为第一备份数据包;Step S106: writing the data to be backed up into the first cache space, and determining that the data contained in the first cache space is the first backup data packet;
待备份数据包含数据本身外,还包含了待备份数据的名称、数据类型和在备份终端上存储的相对路径等数据基本信息。将待备份数据写入第一缓存空间时,第一备份数据包则包含了待备份数据和待备份数据的数据基本信息。The data to be backed up includes not only the data itself, but also basic data information such as the name of the data to be backed up, the data type, and the relative path stored on the backup terminal. When the data to be backed up is written into the first cache space, the first backup data packet includes the data to be backed up and basic data information of the data to be backed up.
步骤S108:当第一备份数据包达到所述第一缓存空间大小时,将所述第一备份数据包传输到所述目标终端。Step S108: When the first backup data packet reaches the size of the first buffer space, transmit the first backup data packet to the target terminal.
当所述第一备份数据包传输到所述目标终端后,目标终端对第一备份数据包中的数据进行解析。具体的:在所述将所述第一备份数据包传输到所述目标终端完成之后,所述目标终端解压所述第一备份数据包,存储所述第一备份数据包中包含的数据。目标终端可获取在第一备份数据包中的数据或数据类型所存储的相对路径,将对应的待备份数据存储在目标终端的相对路径下。目标终端还可存储在系统默认的位置下,或者提示用户供选择的备份数据的存储路径。After the first backup data packet is transmitted to the target terminal, the target terminal analyzes the data in the first backup data packet. Specifically: after the transmission of the first backup data packet to the target terminal is completed, the target terminal decompresses the first backup data packet, and stores the data contained in the first backup data packet. The target terminal may obtain the relative path stored in the data or data type in the first backup data packet, and store the corresponding data to be backed up under the relative path of the target terminal. The target terminal can also be stored in the default location of the system, or the user can be prompted to choose the storage path of the backup data.
在第一备份数据包传输完成后应及时清空目标缓存空间,为后续备份数据腾出空间,确保了备份数据和传输数据的过程同时进行,提高了数据备份的效率和存储空间的利用率。具体的:在所述第一备份数据包传输到所述目标终端完成时,清空所述第一缓存空间。After the transmission of the first backup data packet is completed, the target cache space should be cleared in time to make room for subsequent backup data, ensuring that the process of backup data and data transmission is carried out at the same time, and improving the efficiency of data backup and the utilization rate of storage space. Specifically: clear the first buffer space when the transmission of the first backup data packet to the target terminal is completed.
与此同时,若还存在待备份数据,由于备份数据包之间不交叠,当前剩余存储空间的容量大小足以备份下一个备份数据包,一旦备份完成就将备份数据包写入目标终端,直到待备份数据全部传输到目标终端后停止备份,从而提高数据的备份效率和存储空间的利用率。具体的:根据所述比值和所述剩余存储空间的容量大小确定第二缓存空间的大小,且所述第二缓存空间与所述第一缓存空间无交集;在传输所述第一备份数据包时,将第一备份数据包以外的至少一部分待备份数据写入所述第二缓存空间,确定所述第二缓存空间中包含的数据为第二备份数据包。At the same time, if there is still data to be backed up, since the backup data packets do not overlap, the capacity of the current remaining storage space is sufficient to back up the next backup data packet. Once the backup is completed, the backup data packet will be written to the target terminal until Stop the backup after all the backup data is transmitted to the target terminal, thereby improving data backup efficiency and storage space utilization. Specifically: determine the size of the second cache space according to the ratio and the capacity of the remaining storage space, and the second cache space has no intersection with the first cache space; when transmitting the first backup data packet At this time, at least a part of the data to be backed up other than the first backup data package is written into the second cache space, and the data contained in the second cache space is determined to be the second backup data package.
在其中一个实施例中,所述方法还包括在所述将所述第一备份数据包传输到所述目标终端完成之后,传输所述第二备份数据包到所述目标终端。优选的,当传输速度与备份速度相等时,可以将缓存空间设置为待备份数据的一半,也就是说当目标终端接收第一备份数据包的同时,备份终端备份第二备份数据包,当目标终端接收第二备份数据包的同时,原始移动终端备份第三个备份数据包,以此类推,保证备份操作和传输操作的同步执行。具体的:当所述备份速度与所述传输速度之间的比值为1时,所述目标缓存空间的容量大小为所述剩余存储空间的容量大小的1/2。In one of the embodiments, the method further includes transmitting the second backup data packet to the target terminal after the transmission of the first backup data packet to the target terminal is completed. Preferably, when the transmission speed is equal to the backup speed, the buffer space can be set to half of the data to be backed up, that is to say, when the target terminal receives the first backup data packet, the backup terminal backs up the second backup data packet, when the target terminal While the terminal receives the second backup data packet, the original mobile terminal backs up the third backup data packet, and so on, so as to ensure the synchronous execution of the backup operation and the transmission operation. Specifically: when the ratio between the backup speed and the transmission speed is 1, the capacity of the target cache space is 1/2 of the capacity of the remaining storage space.
举例来说,结合一个具体终端备份数据的应用场景。如图2所示备份终端的剩余空间是1G,传输速度较快如20M/s,备份速度也是20M/s,那么可以确定备份数据大小为500M。当备份终端备份到500M后,进行第一备份数据包的传输过程中,传输过程中进行第二备份数据包的备份,当然第二存储空间的容量大小也是500M。当第一备份数据包传输完成后传输第二备份数据包,同时清空第一备份数据包,清理剩余缓存空间中不必要的缓存,循环交替的完成这一个过程,直至完成备份终端的待备份数据全部迁移,从而提高了数据备份的效率和存储空间的利用率。For example, consider an application scenario where a specific terminal backs up data. As shown in Figure 2, the remaining space of the backup terminal is 1G, the transmission speed is relatively fast, such as 20M/s, and the backup speed is also 20M/s, so it can be determined that the backup data size is 500M. After the backup terminal backs up to 500M, the first backup data packet is transmitted, and the second backup data packet is backed up during the transmission. Of course, the capacity of the second storage space is also 500M. When the transmission of the first backup data packet is completed, the second backup data packet is transmitted, and at the same time, the first backup data packet is cleared, unnecessary buffers in the remaining buffer space are cleared, and this process is completed alternately in a cycle until the data to be backed up of the backup terminal is completed All migration, thus improving the efficiency of data backup and utilization of storage space.
需要说明的是,待备份数据因为容量大小有限,存在不能写满缓存空间的情况。当存在不能写满缓存空间的情况时,将剩余的待备份数据全部写入缓存空间并传输备份数据包到目标终端。It should be noted that due to the limited capacity of the data to be backed up, there are cases where the cache space cannot be filled. When there is a situation that the cache space cannot be filled, write all the remaining data to be backed up into the cache space and transmit the backup data packet to the target terminal.
待备份数据的可以选择系统默认地全部用户资料,也可以是用户自定义的联系人、图片、视频、音频和文档等等。具体的:所述将待备份数据写入所述第一缓存空间之前还包括:检测选中备份数据类型指令,将所述选中备份数据类型指令对应的所述待备份数据写入所述第一缓存空间。For the data to be backed up, you can choose all the user data by default in the system, or user-defined contacts, pictures, videos, audio and documents, etc. Specifically: before writing the data to be backed up into the first cache space, it also includes: detecting the instruction of the selected backup data type, and writing the data to be backed up corresponding to the selected backup data type instruction into the first cache space.
结合一个具体的选中待备份数据的应用场景来说,如图3所示,用户通过终端的图形化用户交互界面选择优先备份的数据类型为联系人,选定之后选择确定按钮即可实现联系人的变化。需要说明的是,可以选择多个数据类型或者选择备份全部用户资料。Combined with a specific application scenario of selecting data to be backed up, as shown in Figure 3, the user selects the preferred data type for backup as contacts through the graphical user interface of the terminal, and then selects the OK button to realize the contact The change. It should be noted that multiple data types can be selected or all user data can be backed up.
当备份出现异常时,终端会向用户返回提示信息,让用户知道备份数据的过程出现了故障不能正常进行备份。具体的:当写入过程中出现异常时,发送提示信息。When an abnormality occurs in the backup, the terminal will return a prompt message to the user to let the user know that there is a failure in the process of backing up the data and the backup cannot be performed normally. Specifically: when an exception occurs during the writing process, a prompt message is sent.
在一个实施例中,还提出了一种终端备份数据的装置。如图4所示,上述移动终端备份数据的装置包括参数获取模块102、缓存空间确定模块104、备份数据确定模块106以及备份数据发送模块108,其中:In one embodiment, a device for backing up data by a terminal is also provided. As shown in FIG. 4 , the above-mentioned device for backing up data in a mobile terminal includes a parameter acquisition module 102, a cache space determination module 104, a backup data determination module 106, and a backup data sending module 108, wherein:
参数获取模块102,用于获取备份终端的剩余存储空间的容量大小和备份速度,检测所述备份终端对目标终端的传输速度;A parameter acquisition module 102, configured to acquire the capacity and backup speed of the remaining storage space of the backup terminal, and detect the transmission speed of the backup terminal to the target terminal;
缓存空间确定模块104,用于计算所述备份速度与所述传输速度的比值,根据所述比值和所述剩余存储空间的容量大小确定第一缓存空间的大小;A cache space determining module 104, configured to calculate the ratio of the backup speed to the transmission speed, and determine the size of the first cache space according to the ratio and the capacity of the remaining storage space;
备份数据确定模块106,用于将待备份数据写入所述第一缓存空间,确定所述第一缓存空间中包含的数据为第一备份数据包;A backup data determination module 106, configured to write the data to be backed up into the first cache space, and determine that the data contained in the first cache space is the first backup data package;
备份数据发送模块108,用于当第一备份数据包达到所述第一缓存空间大小时,将所述第一备份数据包传输到所述目标终端。The backup data sending module 108 is configured to transmit the first backup data packet to the target terminal when the first backup data packet reaches the size of the first buffer space.
在其中一个实施例中,所述装置还包括缓存空间清空模块110,用于在所述第一备份数据包传输到所述目标终端完成时,清空所述第一缓存空间。In one of the embodiments, the device further includes a cache space clearing module 110, configured to clear the first cache space when the transmission of the first backup data packet to the target terminal is completed.
在其中一个实施例中,所述缓存空间确定模块104还用于根据所述比值和所述剩余存储空间的容量大小确定第二缓存空间的大小,且所述第二缓存空间与所述第一缓存空间无交集;所述备份数据确定模块106还用于在传输所述第一备份数据包时,将第一备份数据包以外的至少一部分待备份数据写入所述第二缓存空间,确定所述第二缓存空间中包含的数据为第二备份数据包。所述备份数据确定模块106还用于In one of the embodiments, the cache space determination module 104 is further configured to determine the size of the second cache space according to the ratio and the capacity of the remaining storage space, and the second cache space is the same as the first The cache space has no intersection; the backup data determination module 106 is also configured to write at least a part of the data to be backed up other than the first backup data packet into the second cache space when transmitting the first backup data packet, and determine the The data contained in the second buffer space is the second backup data package. The backup data determining module 106 is also used for
在其中一个实施例中,所述备份数据发送模块108还用于在所述将所述第一备份数据包传输到所述目标终端完成之后,传输所述第二备份数据包到所述目标终端。In one of the embodiments, the backup data sending module 108 is further configured to transmit the second backup data packet to the target terminal after the completion of the transmission of the first backup data packet to the target terminal .
在其中一个实施例中,所述装置还包括优选备份数据确定模块112,用于检测选中备份数据类型指令,将所述选中备份数据类型指令对应的所述待备份数据写入所述第一缓存空间。In one of the embodiments, the device further includes a preferred backup data determination module 112, configured to detect a selected backup data type instruction, and write the data to be backed up corresponding to the selected backup data type instruction into the first cache space.
采用了上述终端备份数据的方法及系统之后,获取备份终端的剩余存储容量的容量大小和备份速度,检测备份终端和目标终端之间的传输速度,从而确定第一缓存空间的大小,然后将待备份数据写入第一缓存空间确定第一备份数据包,最后当第一备份数据包达到所述第一缓存空间大小时,将第一备份数据包传输给目标移动终端,解决了在有限的备份终端上将所有待备份数据传输给目标终端失败的问题,且由备份速度和传输速度的比值和剩余存储容量的容量大小将待备份数据分成多份,使得传输过程和备份过程同时进行,从而提高数据备份的效率和存储空间的利用率。After adopting the above-mentioned method and system for backing up data by a terminal, obtain the capacity and backup speed of the remaining storage capacity of the backup terminal, detect the transmission speed between the backup terminal and the target terminal, thereby determine the size of the first buffer space, and then store the The backup data is written into the first buffer space to determine the first backup data packet, and finally when the first backup data packet reaches the size of the first buffer space, the first backup data packet is transmitted to the target mobile terminal, which solves the problem of limited backup The terminal fails to transmit all the data to be backed up to the target terminal, and the data to be backed up is divided into multiple parts according to the ratio of the backup speed to the transmission speed and the size of the remaining storage capacity, so that the transmission process and the backup process are carried out at the same time, thereby improving Data backup efficiency and storage space utilization.
在一个实施例中,如图5所示,图5展示了一种运行移动终端备份数据的方法的基于冯诺依曼体系的计算机系统的终端。该计算机系统可以是智能手机、平板电脑、掌上电脑,笔记本电脑或个人电脑等终端设备。具体的,可包括通过系统总线连接的外部输入接口1001、处理器1002、存储器1003和输出接口1004。其中,外部输入接口1001可选的可至少包括网络接口10012。存储器1003可包括外存储器10032(例如硬盘、光盘或软盘等)和内存储器10034。输出接口1004可至少包括显示屏10042等设备。In one embodiment, as shown in FIG. 5 , FIG. 5 shows a terminal of a computer system based on a von Neumann architecture running a method for backing up data in a mobile terminal. The computer system can be a terminal device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer or a personal computer. Specifically, it may include an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus. Wherein, the external input interface 1001 may optionally include at least a network interface 10012 . The memory 1003 may include an external memory 10032 (such as a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034 . The output interface 1004 may at least include devices such as a display screen 10042 .
在本实施例中,本方法的运行基于计算机程序,该计算机程序的程序文件存储于前述基于冯诺依曼体系的计算机系统的外存储器10032中,在运行时被加载到内存储器10034中,然后被编译为机器码之后传递至处理器1002中执行,从而使得基于冯诺依曼体系的计算机系统中形成逻辑上的参数获取模块102、缓存空间确定模块104、备份数据确定模块106、备份数据发送模块108、缓存空间清空模块110以及优选备份数据确定模块112。且在上述应用快捷方式位置选择的方法执行过程中,输入的参数均通过外部输入接口1001接收,并传递至存储器1003中缓存,然后输入到处理器1002中进行处理,处理的结果数据或缓存于存储器1003中进行后续地处理,或被传递至输出接口1004进行输出。In this embodiment, the operation of this method is based on a computer program, and the program file of the computer program is stored in the external memory 10032 of the aforementioned computer system based on the Von Neumann architecture, and is loaded into the internal memory 10034 during operation, and then After being compiled into machine code, it is passed to the processor 1002 for execution, so that a logical parameter acquisition module 102, cache space determination module 104, backup data determination module 106, and backup data sending module are formed in the computer system based on the Von Neumann system. Module 108 , cache space emptying module 110 and preferred backup data determining module 112 . Moreover, during the execution of the method for selecting the location of the application shortcut, the input parameters are all received through the external input interface 1001, and transmitted to the cache in the memory 1003, and then input to the processor 1002 for processing, and the processed result data or cached in Subsequent processing is performed in the memory 1003, or is transmitted to the output interface 1004 for output.
具体的,上述处理器1002用于获取备份终端的剩余存储空间的容量大小和备份速度,检测所述备份终端对目标终端的传输速度;计算所述备份速度与所述传输速度的比值,根据所述比值和所述剩余存储空间的容量大小确定第一缓存空间的大小;Specifically, the above-mentioned processor 1002 is used to obtain the capacity and backup speed of the remaining storage space of the backup terminal, detect the transmission speed of the backup terminal to the target terminal; calculate the ratio of the backup speed to the transmission speed, and according to the The ratio and the capacity of the remaining storage space determine the size of the first cache space;
上述存储器1003用于将待备份数据写入所述第一缓存空间,确定所述第一缓存空间中包含的数据为第一备份数据包;The memory 1003 is used to write the data to be backed up into the first cache space, and determine that the data contained in the first cache space is the first backup data package;
上述输出接口1004用于当第一备份数据包达到所述第一缓存空间大小时,将所述第一备份数据包传输到所述目标终端。The output interface 1004 is configured to transmit the first backup data packet to the target terminal when the first backup data packet reaches the size of the first buffer space.
在其中一个实施例中,上述存储器1003还用于在所述第一备份数据包传输到所述目标终端完成时,清空所述第一缓存空间。In one of the embodiments, the memory 1003 is further configured to clear the first cache space when the transmission of the first backup data packet to the target terminal is completed.
在其中一个实施例中,上述处理器1002还用于根据所述比值在剩余存储空间中确定第二缓存空间,且所述第二缓存空间与所述第一缓存空间无交集;上述存储器1003还用于在传输所述第一备份数据包时,将第一备份数据包以外的至少一部分待备份数据写入所述第二缓存空间,确定所述第二缓存空间中包含的数据为第二备份数据包。In one of the embodiments, the above-mentioned processor 1002 is further configured to determine a second cache space in the remaining storage space according to the ratio, and the second cache space has no intersection with the first cache space; the above-mentioned memory 1003 is also When the first backup data packet is transmitted, at least a part of the data to be backed up other than the first backup data packet is written into the second cache space, and the data contained in the second cache space is determined as the second backup data pack.
在其中一个实施例中,上述输出接口1004还用于在所述将所述第一备份数据包传输到所述目标终端完成之后,传输所述第二备份数据包到所述目标终端。In one of the embodiments, the output interface 1004 is further configured to transmit the second backup data packet to the target terminal after the transmission of the first backup data packet to the target terminal is completed.
在其中一个实施例中,上述外部输入接口1001还用于检测选中备份数据类型指令,上述存储器1003还用于将所述选中备份数据类型指令对应的所述待备份数据写入所述第一缓存空间。In one of the embodiments, the above-mentioned external input interface 1001 is also used to detect the selected backup data type instruction, and the above-mentioned memory 1003 is also used to write the data to be backed up corresponding to the selected backup data type instruction into the first cache space.
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。The above disclosures are only preferred embodiments of the present invention, and certainly cannot limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610957882.XA CN106569913B (en) | 2016-10-27 | 2016-10-27 | Method and device for terminal to backup data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610957882.XA CN106569913B (en) | 2016-10-27 | 2016-10-27 | Method and device for terminal to backup data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106569913A true CN106569913A (en) | 2017-04-19 |
CN106569913B CN106569913B (en) | 2019-05-10 |
Family
ID=58535554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610957882.XA Active CN106569913B (en) | 2016-10-27 | 2016-10-27 | Method and device for terminal to backup data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106569913B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107426806A (en) * | 2017-07-17 | 2017-12-01 | 深圳市盛路物联通讯技术有限公司 | Internet-of-things terminal transmits the method and device of data |
CN109871295A (en) * | 2017-12-01 | 2019-06-11 | 北京金山云网络技术有限公司 | A data backup method, backup device, electronic device and storage medium |
CN110569102A (en) * | 2019-07-22 | 2019-12-13 | 华为技术有限公司 | A method and device for deploying a container instance |
CN111258821A (en) * | 2020-03-23 | 2020-06-09 | 重庆忽米网络科技有限公司 | Backup data rapid extraction method based on cloud computing |
CN112162694A (en) * | 2020-09-09 | 2021-01-01 | 合肥富煌君达高科信息技术有限公司 | Data transmission speed control method and device |
CN112261634A (en) * | 2020-10-19 | 2021-01-22 | Tcl通讯(宁波)有限公司 | Bluetooth transmission control method, device, terminal equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101414973A (en) * | 2008-11-25 | 2009-04-22 | 中国人民解放军信息工程大学 | Method and apparatus for transmitting data packet |
CN101695131A (en) * | 2009-10-16 | 2010-04-14 | 深圳市五巨科技有限公司 | Method and device for playing online audio/video by mobile terminal |
US20100251172A1 (en) * | 2009-03-31 | 2010-09-30 | Lenovo (Singapore) Pte. Ltd. | High-speed recovery for computing systems |
CN104601799A (en) * | 2014-12-18 | 2015-05-06 | 广东欧珀移动通信有限公司 | Data transmission method and mobile terminal |
US9170891B1 (en) * | 2012-09-10 | 2015-10-27 | Amazon Technologies, Inc. | Predictive upload of snapshot data |
-
2016
- 2016-10-27 CN CN201610957882.XA patent/CN106569913B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101414973A (en) * | 2008-11-25 | 2009-04-22 | 中国人民解放军信息工程大学 | Method and apparatus for transmitting data packet |
US20100251172A1 (en) * | 2009-03-31 | 2010-09-30 | Lenovo (Singapore) Pte. Ltd. | High-speed recovery for computing systems |
CN101695131A (en) * | 2009-10-16 | 2010-04-14 | 深圳市五巨科技有限公司 | Method and device for playing online audio/video by mobile terminal |
US9170891B1 (en) * | 2012-09-10 | 2015-10-27 | Amazon Technologies, Inc. | Predictive upload of snapshot data |
CN104601799A (en) * | 2014-12-18 | 2015-05-06 | 广东欧珀移动通信有限公司 | Data transmission method and mobile terminal |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107426806A (en) * | 2017-07-17 | 2017-12-01 | 深圳市盛路物联通讯技术有限公司 | Internet-of-things terminal transmits the method and device of data |
CN107426806B (en) * | 2017-07-17 | 2021-01-26 | 深圳市盛路物联通讯技术有限公司 | Method and device for transmitting data by Internet of things terminal |
CN109871295A (en) * | 2017-12-01 | 2019-06-11 | 北京金山云网络技术有限公司 | A data backup method, backup device, electronic device and storage medium |
CN109871295B (en) * | 2017-12-01 | 2022-04-05 | 北京金山云网络技术有限公司 | Data backup method, backup device, electronic equipment and storage medium |
CN110569102A (en) * | 2019-07-22 | 2019-12-13 | 华为技术有限公司 | A method and device for deploying a container instance |
CN110569102B (en) * | 2019-07-22 | 2022-12-13 | 华为技术有限公司 | A method and device for deploying a container instance |
CN111258821A (en) * | 2020-03-23 | 2020-06-09 | 重庆忽米网络科技有限公司 | Backup data rapid extraction method based on cloud computing |
CN111258821B (en) * | 2020-03-23 | 2023-08-18 | 重庆忽米网络科技有限公司 | Cloud computing-based backup data rapid extraction method |
CN112162694A (en) * | 2020-09-09 | 2021-01-01 | 合肥富煌君达高科信息技术有限公司 | Data transmission speed control method and device |
CN112162694B (en) * | 2020-09-09 | 2024-05-07 | 合肥中科君达视界技术股份有限公司 | Data transmission speed control method and device |
CN112261634A (en) * | 2020-10-19 | 2021-01-22 | Tcl通讯(宁波)有限公司 | Bluetooth transmission control method, device, terminal equipment and storage medium |
CN112261634B (en) * | 2020-10-19 | 2023-08-08 | 深圳市嘀嘟科技有限公司 | Bluetooth transmission control method and device, terminal equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106569913B (en) | 2019-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106569913A (en) | Method and device for terminal backup data | |
US11337042B2 (en) | Short message processing method and apparatus, and electronic device | |
WO2018049888A1 (en) | Application data migration method and device | |
JP2016524762A (en) | Sharing virtual hard disks across multiple virtual machines | |
CN110637282B (en) | Touch method and terminal | |
KR20160014043A (en) | Efficient programmatic memory access over network file access protocols | |
CN103106109A (en) | Mobile device and method for running two platform systems or application programs thereon | |
WO2015024494A1 (en) | Application sharing method and device | |
CN105007082A (en) | A data compression method, device and terminal | |
US20210042171A1 (en) | Cross-platform stateless clipboard experiences | |
WO2013169529A1 (en) | Screen and associated file sharing | |
CN103475572A (en) | Method, device and system for sending multiple pictures in instant messaging application | |
US20240086360A1 (en) | File saving method and electronic device | |
CN108595220A (en) | Processing method, equipment and the computer readable storage medium of application component | |
CN114579055B (en) | Disk storage method, device, equipment and medium | |
CN106547486A (en) | A data migration method and device | |
US10740252B2 (en) | Serial peripheral interface filter for processor security | |
CN113412480B (en) | Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium | |
CN107733781B (en) | An instant messaging processing method, device and computer storage medium | |
CN106484779A (en) | File operation method and device | |
CN112711955B (en) | NFC information transmission method, NFC information transmission device and terminal | |
CN103377071B (en) | A kind of batch data delet method and system | |
CN106527851A (en) | Information previewing method and mobile terminal | |
CN106547485A (en) | Data migration method and device | |
CN115437847A (en) | Data backup method, device, electronic device 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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant before: Guangdong OPPO Mobile Communications Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |