Data backup method, electronic device and storage medium
By adaptively selecting remote server backup, cloud space backup or local backup methods, the backup data loss problem caused by local storage space limitations in electronic devices before the system upgrade is solved, and efficient and secure data backup is achieved.
Patent Information
- Application Number
- CN202411820022.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, when electronic devices are backed up before system upgrade, the local storage space is limited, and backup data is easily lost.
By obtaining the size and type of the target backup data, adaptively select remote server backup, cloud space backup or local backup methods, and rationally take advantage of the advantages of each backup method to avoid data loss or corruption caused by improper backup method selection.
It realizes adaptive selection of appropriate backup methods based on the size and type of backup data, improves the efficiency and security of data backup, and avoids the problem of excessive backup time or data corruption.
Smart Images

Figure CN119759651A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of storage technology, and in particular to a data backup method, an electronic device, and a storage medium. Background Art
[0002] At present, electronic devices such as mobile phones and tablets will back up user data before system upgrades to prevent loss after the system upgrade. In related technologies, it is proposed to use the local storage space of electronic devices to complete user data backup during the system upgrade process. However, this backup method is limited by the size of the local storage space. Once the local storage space is insufficient, data loss may occur. Summary of the invention
[0003] In view of this, the present disclosure provides a data backup method, an electronic device, and a storage medium to solve the problem of backup data loss caused by limited local storage space.
[0004] In a first aspect, the present disclosure provides a data backup method, the method comprising:
[0005] Obtain target backup data of the target system and its target data size;
[0006] Determining a target backup method from a plurality of backup methods based on the target data size, the plurality of backup methods comprising remote server backup, cloud space backup, and local backup, the plurality of backup methods having different backup performances corresponding to different data sizes;
[0007] The target backup data is backed up based on the target backup method.
[0008] In this method, based on the target data size, a target backup method is determined among remote server backup, cloud space backup and local backup, so as to back up the target backup data based on the target backup method. Therefore, it is possible to adaptively select a suitable backup method according to the data size of the target backup data, and reasonably use the backup method to back up target backup data of different data sizes. When the data volume of the target backup data is small, local backup is used to increase the backup speed. When the data volume of the target backup data is moderate, a backup method such as cloud space backup, which has a certain storage space and does not require additional maintenance, is used. When the data volume of the target backup data is large, a backup method such as remote server backup, which has a large storage space, is used. This can avoid the use of improper backup methods that cause long backup time, data damage or data loss.
[0009] In an optional implementation, determining a target backup method from a plurality of backup methods based on the target data size includes:
[0010] Acquire a target data type of the target backup data;
[0011] The target backup method is determined from the plurality of backup methods based on the target data size and the target data type, and the plurality of backup methods have different backup performances corresponding to different data sizes and different data types.
[0012] In this method, since different data types may differ during the data backup process, determining the target backup method by the target data size and the target data type can further improve the accuracy of the target backup method selection, thereby further improving the data backup performance.
[0013] In an optional implementation, determining a target backup method from a plurality of backup methods based on the target data size includes:
[0014] The target data size is input into a target model, and the multiple backup methods are screened to obtain the target backup method, wherein the target model is obtained by training the backup performance of the historical backup data based on the data size of the historical backup data, the historical backup method of the historical backup data, and the historical backup method.
[0015] In this method, a target model is obtained by training based on the data size of historical backup data, the historical backup method of the historical backup data, and the backup performance of the historical backup method for the historical backup data. Therefore, the target model can be used to learn the backup performance of different backup methods under different data sizes. Furthermore, the target backup method suitable for the target data size is determined by the target model. Therefore, the correctness of the target backup method selection can be effectively improved to improve the data backup performance.
[0016] In an optional implementation, if the target backup method is the remote server backup, then backing up the target backup data based on the target backup method includes:
[0017] Compressing the target backup data to obtain a target compressed file;
[0018] The target compressed file is uploaded to the target remote server for backup.
[0019] In this method, if the target backup method is remote server backup, the target backup data is compressed, and then the compressed target compressed file is uploaded to the target remote server for backup. Therefore, the amount of data to be transmitted between the local and the target remote server can be reduced by compression processing, so as to reduce the time consumption of data transmission and improve the efficiency of data backup.
[0020] In an optional implementation manner, compressing the target backup data to obtain a target compressed file includes:
[0021] Dividing the data in the target backup data according to data types to obtain sub-backup data of different data types;
[0022] Each of the sub-backup data is compressed to obtain a sub-compressed file of each of the sub-backup data, so as to obtain the target compressed file, wherein the target compressed file includes the sub-compressed file of each of the sub-backup data.
[0023] In this method, the data in the target backup data are divided according to data types, and then the sub-backup data of different data types are compressed to obtain sub-compressed files of each sub-backup data. Therefore, data damage caused by compressing data of multiple different data types at the same time can be avoided.
[0024] In an optional implementation, if the target backup method is the cloud space backup, then backing up the target backup data based on the target backup method includes:
[0025] Based on the data type of the data in the target backup data, the target backup data is uploaded to a target cloud space for backup.
[0026] In this method, if the target backup method is cloud space backup, the target backup data is uploaded to the target cloud space for backup based on the data type. Therefore, it is convenient to manage the data backup of the target backup data, and at the same time, it is also convenient to upload data using a processing method suitable for the data type, thereby improving the data upload efficiency and thus improving the data backup efficiency.
[0027] In an optional implementation, if the target backup method is the local backup, then backing up the target backup data based on the target backup method includes:
[0028] Before the target system is upgraded, a local backup space is established;
[0029] The target backup data is stored in the local backup space, and the local backup space is also used to store the system update file of the target system, and the system update file is used to update the target system.
[0030] In this method, the target backup data and the system update file are stored in the same local backup space, thereby avoiding the occupation of additional storage resources and improving the utilization rate of the local storage space.
[0031] In an optional implementation, before storing the system update file in the local backup space, the method further includes:
[0032] The target backup data in the local backup space is compressed.
[0033] In this method, before the local backup space stores the system update file, the target backup data in the local backup space is compressed, thereby further improving the space utilization of the local storage space, ensuring that the system update file is successfully written to the local space, and ensuring the normal operation of the system update.
[0034] In a second aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data backup method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0035] In a third aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data backup method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 is a flow chart of a data backup method according to an embodiment of the present disclosure;
[0038] Figure 2 is a flow chart of another data backup method according to an embodiment of the present disclosure;
[0039] Figure 3 is a structural block diagram of a data backup device according to an embodiment of the present disclosure;
[0040] Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0042] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0043] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0044] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0045] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0046] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0047] Android is a free and open source mobile operating system based on the Linux kernel, which is mainly used in mobile devices such as mobile phones, tablets and computers. At present, mobile phones, tablets and other electronic devices will prompt users to back up user data before upgrading the system to prevent loss after the system upgrade.
[0048] In the related art, two backup methods, external storage space and local storage space, are proposed.
[0049] 1. For external storage space. Users are required to back up user data to other storage devices or upload them to a remote server. For example, during a system upgrade, the user data in the mobile phone is backed up to an external storage card. After restoring the factory settings, the backed-up user data is restored from the external storage card. It can be seen that the backup of user data mainly depends on external storage space. However, this backup method requires plugging in a storage card or transferring data to a remote server. If the amount of data is too large, it will consume a lot of data transmission time, resulting in a longer data backup time.
[0050] 2. For local storage space. During the system upgrade process, the backup of user data does not require external storage devices or remote servers. The backup of user data can be completed during the system upgrade process by using the local storage space of the electronic device. However, this backup method is limited by the size of the local storage space. Once the local storage space is insufficient, data loss or damage may occur.
[0051] In view of this, according to an embodiment of the present disclosure, a data backup method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0052] In this embodiment, a data backup method is provided, which can be used in electronic devices, such as mobile phones, tablet computers, etc. Optionally, an Android system is installed in the electronic device. Figure 1 is a flow chart of a data backup method according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:
[0053] Step S101, obtaining target backup data of a target system and its target data size.
[0054] Optionally, the target backup data includes at least one of application data, contacts, call records, text messages, music, pictures, videos, and files. In addition, other data can be selected as the target backup data according to actual conditions.
[0055] Specifically, data information of the target backup data is obtained, and the data information includes at least one of a data type, an extension, and a keyword. Then, the local storage space is scanned according to the data information to obtain the target backup data. It should be noted that the above data information is only an example and can be adjusted according to actual conditions.
[0056] Exemplarily, the backup interface of the electronic device can guide the user to select the data type, extension name, and keyword to be backed up, and the electronic device scans the local storage space according to the data type, extension name, and keyword to obtain the target backup data.
[0057] Specifically, the target data size of the target backup data can be obtained by viewing the attribute information of the target backup data, or by using a tool for calculating data size.
[0058] It should be noted that in actual operation, the user can actively trigger the data backup task to obtain the target backup data and the target data size of the target system. Alternatively, a scheduled data backup task is set, and the target system of the electronic device (such as the Android system) regularly backs up the data that the user selects to be backed up, for example, the backup cycle is one week, and the backup time is 10 o'clock every Sunday.
[0059] Step S102, determining a target backup method from a plurality of backup methods based on the target data size, the plurality of backup methods including remote server backup, cloud space backup, and local backup, and the plurality of backup methods have different backup performances corresponding to different data sizes.
[0060] In an optional implementation, the backup performance is represented by the storage space size corresponding to the backup method, and the backup method suitable for different data sizes can be determined according to the storage space size of the remote server, cloud space, and local. For example, when the target backup data is in the first preset numerical range, remote server backup is used. When the target backup data is in the second preset numerical range, cloud space backup is used. When the target backup data is in the third preset numerical range, local backup is used. Among them, the value of the first preset numerical range is greater than the value of the second preset numerical range, and the value of the second preset numerical range is greater than the value of the third preset numerical range. For example, the first preset numerical range is a numerical range greater than 10G, the second preset numerical range is [5G, 10G), and the third preset numerical range is a numerical range less than 5G.
[0061] Exemplarily, when the target backup data is larger than 10G, the target backup data is compressed and the compressed data is sent to the remote server for storage and backup. When the target backup data is smaller than 10G and larger than 5G, the target backup data is uploaded to the cloud space for storage and backup. When the target backup data is smaller than 5G, the target backup data is stored and backed up locally.
[0062] In another optional implementation, the backup performance is characterized by data backup speed and data corruption. A reasonable backup method can be selected according to the data size of the target backup data, and the data conditions of different backup methods during the backup process, such as data backup speed and data corruption, are collected. The backup methods selected by the preset model at different data sizes are optimized according to the corresponding data backup speed, data corruption, backup method, and data size to obtain a target model. The target backup method is determined from multiple backup methods according to the target data size and the target model.
[0063] Step S103: backing up the target backup data based on the target backup method.
[0064] Specifically, if the target backup method is remote server backup, the target backup data is compressed and the compressed data is sent to the target remote server for storage and backup. If the target backup method is cloud space backup, the target backup data is uploaded to the target cloud space for storage and backup. If the target backup method is local storage backup, the target backup data is stored and backed up locally.
[0065] It should be noted that local refers to the electronic device that executes this series of data backup methods.
[0066] Specifically, when the target system is upgraded, the most recent backup data is obtained.
[0067] The data backup method provided in this embodiment determines a target backup method among remote server backup, cloud space backup and local backup based on the target data size, so as to back up the target backup data based on the target backup method. Therefore, it is possible to adaptively select a suitable backup method according to the data size of the target backup data, and reasonably use the backup method to back up target backup data of different data sizes. When the data volume of the target backup data is small, local backup is used to increase the backup speed. When the data volume of the target backup data is moderate, a backup method such as cloud space backup, which has a certain storage space and does not require additional maintenance, is used. When the data volume of the target backup data is large, a backup method such as remote server backup, which has a large storage space, is used. This can avoid the use of improper backup methods that result in long backup times, data damage or data loss.
[0068] In this embodiment, another data backup method is provided, which can be used for electronic devices such as mobile phones, tablet computers, etc. Figure 2 is a flow chart of another data backup method according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0069] Step S201, obtaining target backup data of the target system and its target data size, which can be referred to as the above step S101, will not be described in detail here.
[0070] Step S202, determining a target backup method from a plurality of backup methods based on the target data size, the plurality of backup methods including remote server backup, cloud space backup, and local backup, and the plurality of backup methods have different backup performances corresponding to different data sizes.
[0071] In some optional embodiments, the above step S202 includes: inputting the target data size into the target model, screening multiple backup methods, and obtaining the target backup method, the target model is based on the data size of the historical backup data, the historical backup method of the historical backup data, and the historical backup method is trained on the backup performance of the historical backup data.
[0072] Optionally, the target model is a neural convolutional network model using a deep learning algorithm.
[0073] Specifically, a reasonable historical backup method is selected according to the data size of the historical backup data, and the data conditions of different historical backup methods during the backup process are collected; wherein the data conditions include one of the data backup speed and the data damage conditions, and the backup performance of the historical backup method for the historical backup data is characterized by the data conditions. The model parameters of the preset model are adjusted according to the data conditions to optimize the selection of the backup method by the preset model, and the target model is obtained.
[0074] The data backup method provided in this embodiment obtains a target model by training the data size of historical backup data, the historical backup method of historical backup data, and the backup performance of the historical backup method for the historical backup data. Therefore, the target model can be used to learn the backup performance of different backup methods under different data sizes. Furthermore, the target backup method suitable for the target data size is determined by the target model. Therefore, the correctness of the target backup method selection can be effectively improved to improve the data backup performance.
[0075] Furthermore, the data backup method of the present invention also includes: obtaining a target backup performance of the target backup method for a target data size, wherein the target backup performance is characterized by one of a data backup speed and a data corruption condition, and adjusting model parameters of a target model using the target backup performance, the target data size, and the target backup method to obtain an updated target model.
[0076] In some optional implementations, the above step S202 includes:
[0077] Step a1, obtaining the target data type of the target backup data.
[0078] It should be noted that the target data type includes the data type of each data in the target backup data.
[0079] For example, if the target backup data is video, then the target data type is video. If the target backup data includes video and music, then the target data type includes video and music.
[0080] Step a2: determining a target backup method from a plurality of backup methods based on the target data size and the target data type, wherein the plurality of backup methods have different backup performances corresponding to different data sizes and different data types.
[0081] Specifically, the backup performance of different combinations of data size, data type, and backup methods can be statistically analyzed to obtain the corresponding relationship between data size, data type, and backup method. According to the target data size, target data type, and the corresponding relationship, the target backup method is determined.
[0082] Alternatively, a reasonable historical backup method is selected according to the data size and data type of the historical backup data, and the data conditions of different historical backup methods during the backup process are collected; wherein the data condition includes one of the data backup speed and the data damage condition, and the backup performance of the historical backup method for the historical backup data is characterized by the data condition. The model parameters of the preset model are adjusted according to the data condition to optimize the selection of the backup method by the preset model, and a target model is obtained. Furthermore, the target backup method is determined by the target model, the target data size, and the target data type.
[0083] The data backup method provided in this embodiment, since different data types may have different data backup processes, therefore, by determining the target backup method through the target data size and the target data type, the accuracy of the target backup method selection can be further improved to further improve the data backup performance.
[0084] Furthermore, the above-mentioned step S2022 includes: inputting the target data size and the target data type into the target model, screening multiple backup methods, and obtaining the target backup method, the target model is based on the data size of the historical backup data, the data type of the historical backup data, the historical backup method of the historical backup data, and the historical backup method is trained on the backup performance of the historical backup data.
[0085] Step S203: backing up the target backup data based on the target backup method.
[0086] In some optional implementations, if the target backup method is remote server backup, the above step S203 includes:
[0087] Step S2031a, compressing the target backup data to obtain a target compressed file.
[0088] Specifically, a first application of a target remote server is downloaded locally, and the first application is connected to the target remote server via a network. The target backup data and its target data type (including the data type of each data in the target backup data) are stored in a local preset location, and the target backup data is obtained at the local preset location by the first application, and the target backup data is compressed according to the data type of the data in the target backup data to obtain a target compressed file. Alternatively, the first application scans the local data to be backed up and selects the data type to be backed up to obtain the target backup data.
[0089] Step S2032a, uploading the target compressed file to the target remote server for backup.
[0090] Specifically, the target remote server is established by the manufacturer of the electronic device. The target remote server is connected to the local data through the 4G / 5G network. When the target compressed file is uploaded, the target remote server is logged in. Each user can establish an exclusive server backup space in the target remote server.
[0091] In the data backup method provided in this embodiment, if the target backup method is remote server backup, the target backup data is compressed, and then the compressed target compressed file is uploaded to the target remote server for backup. Therefore, the amount of data to be transmitted between the local and the target remote server can be reduced through compression processing, so as to reduce the time consumption of data transmission, thereby improving the efficiency of data backup.
[0092] In some optional implementations, the above step S2031a includes:
[0093] Step b1, dividing the data in the target backup data according to the data type to obtain sub-backup data of different data types.
[0094] Step b2, compressing each sub-backup data to obtain a sub-compressed file of each sub-backup data, so as to obtain a target compressed file, wherein the target compressed file includes the sub-compressed file of each sub-backup data.
[0095] Optionally, the data type includes at least one of application data, contacts, call records, text messages, music, pictures, videos, and files. It should be noted that the above is only an example, and the above data types may be adjusted in actual operation.
[0096] The data backup method provided in this embodiment divides the data in the target backup data according to the data type, and then compresses the sub-backup data of different data types to obtain sub-compressed files of each sub-backup data. Therefore, data damage caused by compressing data of multiple different data types at the same time can be avoided.
[0097] In some optional embodiments, the above step S2032a includes: obtaining a backup identifier; uploading the target compressed file and the backup identifier to the target remote server, the target remote server is used to determine the corresponding server backup space in the target remote server based on the backup identifier, and store the target compressed file in the server backup space.
[0098] Optionally, the backup identifier is a user identifier.
[0099] In some optional implementations, the data backup method of the present disclosure further includes: after the target system upgrade is completed, obtaining a target compressed file sent by the target remote server, decompressing the target compressed file, and obtaining target backup data.
[0100] Exemplarily, taking a mobile phone as an example, assuming that the target backup data is user data, the remote server backup mainly includes the following steps: 1) Establish an Android target remote server. 2) Download the first application to access the target server on the mobile phone, connect to the target remote server through the network, and the first application scans the data that needs to be backed up on the mobile phone. 3) Select the type of data to be backed up, and create a server backup space in the target remote server according to the backup identifier in the target remote server. 4) The target system stores the acquired user data in a folder for compression, and uploads the compressed target compressed file to the server backup space of the target remote server for storage. 5) After the target system upgrade is completed, the target remote server sends the target compressed file to the mobile phone, and the mobile phone decompresses the received target compressed file to obtain the user data.
[0101] In some optional implementations, if the target backup method is cloud space backup, the above step S203 includes:
[0102] Step S2031b: based on the data type of the data in the target backup data, uploading the target backup data to the target cloud space for backup.
[0103] Specifically, a second application of the target cloud space is installed locally, and the target cloud space is logged in by the account and password in the second application. The local storage space is scanned by the second application, and all data types stored in the local storage space are displayed. The data type to be backed up is selected according to the requirements. The data corresponding to the selected data type is crawled by the second application to obtain the target backup data. The target backup data is uploaded to the target cloud space.
[0104] It is worth noting that since the target remote server is built by the manufacturer itself, when using the target remote server to back up data, additional maintenance work needs to be done on the corresponding server backup space on the target remote server. In contrast, cloud space is paid for by users, so when using cloud space to back up data, no additional maintenance work is required, which can reduce additional data maintenance work compared to remote server backup.
[0105] Specifically, in actual operation, the backup cycle of the cloud space backup can be set, and the target backup data can be collected in the local storage space according to the backup data, and the old backup data can be updated. For example, user data can be collected once every seven days, and the old backup data can be updated.
[0106] It should be noted that for the method of updating the target system through the network, when there is no network, it is possible to determine that the target cloud space corresponds to the local mapping space, first store the target backup data in the mapping space, and then upload the target backup data to the target cloud space when waiting for the network connection.
[0107] The data backup method provided in this embodiment, if the target backup method is cloud space backup, uploads the target backup data to the target cloud space for backup based on the data type. Therefore, it is convenient to manage the data backup of the target backup data, and at the same time, it is also convenient to upload data using a processing method suitable for the data type, thereby improving the data upload efficiency and thus improving the data backup efficiency.
[0108] In some optional implementations, the data backup method of the present disclosure further includes: after the target system upgrade is completed, downloading the target backup data to the target cloud space.
[0109] In some optional implementations, if the target backup method is local backup, the above step S203 includes:
[0110] Step S2031c, before the target system is upgraded, a local backup space is established.
[0111] Specifically, a local backup space is established in the local storage space.
[0112] Optionally, the local backup space is 5-7G.
[0113] It should be noted that the target system upgrade described here is to update the target system using a system update file.
[0114] Step S2032c, storing the target backup data in the local backup space, the local backup space is also used to store the system update file of the target system, and the system update file is used to update the target system.
[0115] Specifically, before the target system is upgraded (such as the target system upgrade download stage), the target backup data is copied to the local backup space, and during the target system upgrade process, the system update file is obtained and stored in the local backup space.
[0116] It should be noted that in the related art, independent storage spaces are mostly created for target backup data and system update files. However, since the size of local storage space is limited, if independent storage spaces are created for both target backup data and system update files, it is likely that part of the storage resources will be allocated to the storage spaces corresponding to the target backup data and system update files, but will not be used, resulting in a waste of storage resources.
[0117] The data backup method provided in this embodiment stores the target backup data and the system update file in the same local backup space, thereby avoiding the occupation of additional storage resources and improving the utilization rate of the local storage space.
[0118] In some optional implementations, before establishing the local backup space, the data backup method of the present disclosure further includes: obtaining the remaining size of the local storage space; if the remaining size is less than or equal to the target data size, replacing the target backup method with cloud space backup. If the remaining size is greater than the target data size, local backup is used, and the above-mentioned local backup steps are performed.
[0119] In some optional implementations, before the local backup space storage system updates the file, the data backup method of the present disclosure further includes: compressing the target backup data in the local backup space.
[0120] Specifically, during the target system upgrade process, the target backup data is compressed to reduce the space occupied by the target backup data in the local backup space, thereby leaving a certain amount of space for storing system update files.
[0121] The data backup method provided in this embodiment compresses the target backup data in the local backup space before storing the system update file in the local backup space. Therefore, it can further improve the space utilization of the local storage space and ensure that the system update file is successfully written to the local space, thereby ensuring the normal operation of the system update.
[0122] In some optional implementations, after the target system upgrade is completed, the local backup space is squeezed and the target backup data is displayed according to the data type.
[0123] For example, taking a mobile phone as an example, the target backup data is displayed in the corresponding software of the mobile phone according to the data type. For example, if the target backup data is a picture taken by a camera, it is displayed in the gallery of the mobile phone.
[0124] It is worth noting that, compared with the related art, the data backup method disclosed in the present invention selects a suitable backup method according to the size of the data that the user needs to back up (i.e., the target backup data) during the backup stage of user data, and classifies and compresses the target backup data with a large storage capacity and then uploads it to the target remote server for backup. The target backup data with a medium storage capacity is uploaded to the target cloud space for backup. The target backup data with a smaller storage capacity is backed up locally. Therefore, different backup methods can be reasonably used to back up target backup data with different storage capacities, avoiding the waste of backup time and data damage caused by the use of improper backup methods, thereby reducing the backup time of user data during the Android system upgrade process.
[0125] Moreover, the data backup method disclosed in the present invention uses compression to back up target backup data with large storage capacity, and classifies and compresses data during compression. Therefore, it is possible to avoid the situation where data of different data types are compressed at the same time, which may easily cause data corruption, and the compressed data can be uploaded faster. At the same time, the cloud space can regularly upload and backup data, and call the target backup data when the target system is upgraded, and supports offline backup, and uploads the target backup data after the network is connected. At the same time, local backup can quickly complete the data backup operation, and after the target system upgrade is completed, the target backup data can be quickly browsed.
[0126] Therefore, the data backup method disclosed in the present invention can solve the problem in the related art that during the Android system upgrade process, user data backup uses two methods: external storage space and local storage space. The external storage space needs to be connected to a memory card or the user data needs to be transmitted to a remote server, and the backup takes a long time when the amount of data is too large. In addition, when relying on the local storage space for backup, the user data needs to be compressed (i.e., the local storage space is insufficient), which may cause data damage or loss in the process. It can be seen that compared with the related art, the data backup method disclosed in the present invention can effectively reduce the time consumption of data backup and improve the security of user data backup.
[0127] In the present embodiment, a data backup device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0128] This embodiment provides a data backup device, such as Figure 3 As shown, including:
[0129] The data acquisition module 301 is used to acquire the target backup data of the target system and its target data size;
[0130] A method selection module 302 is used to determine a target backup method from a plurality of backup methods based on the target data size, the plurality of backup methods including remote server backup, cloud space backup, and local backup, and the plurality of backup methods have different backup performances corresponding to different data sizes;
[0131] The data backup module 303 is used to back up the target backup data based on the target backup method.
[0132] In some optional implementations, the method selection module 302 includes:
[0133] A type acquisition unit, used for acquiring a target data type of target backup data;
[0134] The method selection unit is used to determine a target backup method from a plurality of backup methods based on a target data size and a target data type, wherein the plurality of backup methods have different backup performances corresponding to different data sizes and different data types.
[0135] In some optional implementations, the method selection module 302 includes:
[0136] The model screening unit is used to input the target data size into the target model, screen multiple backup methods, and obtain the target backup method. The target model is obtained by training the backup performance of the historical backup data based on the data size of the historical backup data, the historical backup method of the historical backup data, and the historical backup method.
[0137] In some optional implementations, the data backup module 303 includes:
[0138] A data compression unit, used for compressing the target backup data to obtain a target compressed file if the target backup method is remote server backup;
[0139] The remote server backup unit is used to upload the target compressed file to the target remote server for backup.
[0140] In some optional embodiments, the first compression unit includes:
[0141] The data classification subunit is used to classify the data in the target backup data according to the data type to obtain sub-backup data of different data types;
[0142] The data compression subunit is used to compress each sub-backup data to obtain a sub-compressed file of each sub-backup data, so as to obtain a target compressed file, wherein the target compressed file includes the sub-compressed files of each sub-backup data.
[0143] In some optional implementations, the data backup module 303 further includes:
[0144] The cloud space backup unit is used to upload the target backup data to the target cloud space for backup based on the data type of the data in the target backup data if the target backup method is cloud space backup.
[0145] In some optional implementations, the data backup module 303 further includes:
[0146] A space creation unit, used to create a local backup space before the target system is upgraded if the target backup method is local backup;
[0147] The local backup unit is used to store the target backup data in the local backup space. The local backup space is also used to store the system update file of the target system. The system update file is used to update the target system.
[0148] In some optional implementations, the data backup device further includes:
[0149] The data compression module is used to compress the target backup data in the local backup space before the local backup space storage system updates the file.
[0150] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0151] The data backup device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0152] The present disclosure also provides an electronic device having the above Figure 3 The data backup device shown.
[0153] See also Figure 4 , Figure 4 is a structural block diagram of an electronic device provided by an optional embodiment of the present disclosure, such as Figure 4As shown, the electronic device includes: one or more processors 401, memory 402, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 401 is taken as an example.
[0154] The processor 401 may be a central processing unit, a network processor or a combination thereof. The processor 401 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0155] The memory 402 stores instructions executable by at least one processor 401 , so that the at least one processor 401 executes the method shown in the above embodiment.
[0156] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0157] The memory 402 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 402 may also include a combination of the above types of memory.
[0158] The electronic device also includes an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0159] The input device 403 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 404 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0160] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0161] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0162] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data backup method, characterized in that: The method comprises: Obtain target backup data of the target system and its target data size; Determining a target backup method from a plurality of backup methods based on the target data size, the plurality of backup methods comprising remote server backup, cloud space backup, and local backup, the plurality of backup methods having different backup performances corresponding to different data sizes; The target backup data is backed up based on the target backup method.
2. The data backup method according to claim 1, characterized in that: The step of determining a target backup method from among a plurality of backup methods based on the target data size includes: Acquire a target data type of the target backup data; The target backup method is determined from the plurality of backup methods based on the target data size and the target data type, and the plurality of backup methods have different backup performances corresponding to different data sizes and different data types.
3. The data backup method according to claim 1, characterized in that: The step of determining a target backup method from among a plurality of backup methods based on the target data size includes: The target data size is input into a target model, and the multiple backup methods are screened to obtain the target backup method, wherein the target model is obtained by training the backup performance of the historical backup data based on the data size of the historical backup data, the historical backup method of the historical backup data, and the historical backup method.
4. The data backup method according to claim 1, characterized in that: If the target backup method is the remote server backup, then backing up the target backup data based on the target backup method includes: Compressing the target backup data to obtain a target compressed file; The target compressed file is uploaded to the target remote server for backup.
5. The data backup method according to claim 4, characterized in that: The step of compressing the target backup data to obtain a target compressed file includes: Dividing the data in the target backup data according to data types to obtain sub-backup data of different data types; Each of the sub-backup data is compressed to obtain a sub-compressed file of each of the sub-backup data, so as to obtain the target compressed file, wherein the target compressed file includes the sub-compressed file of each of the sub-backup data.
6. The data backup method according to claim 1, characterized in that: If the target backup method is the cloud space backup, then backing up the target backup data based on the target backup method includes: Based on the data type of the data in the target backup data, the target backup data is uploaded to a target cloud space for backup.
7. The data backup method according to claim 1, characterized in that: If the target backup method is the local backup, backing up the target backup data based on the target backup method includes: Before the target system is upgraded, a local backup space is established; The target backup data is stored in the local backup space, and the local backup space is also used to store the system update file of the target system, and the system update file is used to update the target system.
8. The data backup method according to claim 7, characterized in that: Before storing the system update file in the local backup space, the method further includes: The target backup data in the local backup space is compressed.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data backup method according to any one of claims 1 to 8 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data backup method according to any one of claims 1 to 8.